This document lists issues identified during the legacy code audit that require significant effort and should be addressed in dedicated sessions.
Safari builds will fail at runtime. The codebase uses Chrome-specific APIs without any fallback or polyfill for Safari's Web Extension API.
chrome.identity.getAuthToken()- Google OAuth (71+ instances in background.ts)chrome.alarms.*- Periodic sync schedulingchrome.notifications.*- Desktop notificationschrome.tabs.query()/chrome.tabs.sendMessage()- Tab communication
tasks/manifest-webpack-plugin.jsline 33: Usesmanifest-v2.jsonfor Safari- Only changes
content_scripts[0].matches[0]tohttps://*/* - No API compatibility layer exists
- Create a browser abstraction layer (
src/features/browser/index.ts) - Implement
browser.tsfor Firefox/Safari usingbrowser.*API - Implement
chrome.tsfor Chrome/Edge usingchrome.*API - For Safari: disable calendar sync features gracefully (show "not supported" message)
- Consider using
webextension-polyfillnpm package
src/background.ts(entire file)src/content_script.ts(message passing)src/features/chrome/index.tstasks/manifest-webpack-plugin.js
src/features/tact/folder-ui.ts is 1972 lines with 40+ any types.
Too large for a single file, defeating the purpose of TypeScript's type safety.
- Extract tab rendering into separate components
- Create proper interfaces for API response types
- Replace all
anywith typed interfaces - Split into:
folder-ui-tabs.ts,folder-ui-tree.ts,folder-ui-assignments.ts
Root background.js (44KB) is a stale build artifact tracked in git.
src/background.ts is the source, webpack compiles to dist/background.js.
- Delete
background.jsfrom repo root - Add
/background.jsto.gitignore - Verify no scripts reference the root file directly
221+ console.log/error statements throughout the codebase, including
emoji-prefixed debug logs ([DEBUG] tags) in production code.
src/background.ts- Extensive debug loggingsrc/content_script.ts- Multiple debug statementssrc/calendarSync.ts- Debug logging
- Create a logger utility with log levels (debug/info/warn/error)
- Only output debug-level logs when
NODE_ENV !== 'production' - Replace all
console.log('[DEBUG]...')withlogger.debug(...)
mustache package is listed in package.json but not imported anywhere
in src/. This increases bundle size unnecessarily.
- Run
npm uninstall mustacheafter verifying no usage in build scripts
_locales/en/messages.json and _locales/ja/messages.json contain
tact_forum_* keys that are no longer referenced in any source code
(the forum feature was removed with the dead index files).
- Remove unused
tact_forum_*keys from both locale files
src/calendarSync.ts uses any[] for assignments and quizzes parameters
instead of typed interfaces.
- Replace
any[]withEntryProtocol[]orEntityProtocol[]
Root-level test-cache-behavior.js appears to be a standalone test/debug
script not integrated into the test suite.
- Evaluate if it should be moved to
src/tests/or deleted
miniSakai uses chrome.storage for assignment/quiz cache, while folder-ui uses
localStorage for folder structure and assignment cache. This means the same
assignment data can be fetched and stored twice via different mechanisms, and
cache invalidation is not coordinated between them.
- chrome.storage (miniSakai): assignment/quiz fetch times, settings
- localStorage (folder-ui):
folder-structure-cache-{siteId},assignment-cache-{courseId}
- Choose a single storage backend (likely
chrome.storage.localfor consistency) - Create a unified cache service with typed keys and expiration logic
- Share assignment data between miniSakai and folder-ui to avoid duplicate API calls
- Coordinate cache invalidation so a refresh in one view updates the other
src/content_script.ts(miniSakai data fetching)src/features/tact/folder-ui.ts(localStorage caching)src/utils.ts(cache utility functions)
- Safari Compatibility (blocks Safari release)
- folder-ui.ts Refactoring (code quality)
- Debug Console Statements (production readiness)
- background.js cleanup (repo hygiene)
- Everything else (polish)