Skip to content

Clean up, feature upgrades, and codebase audit fixes - #6

Merged
ParkerM2 merged 12 commits into
mainfrom
Clean-up-and-feature-upgrade
Feb 13, 2026
Merged

Clean up, feature upgrades, and codebase audit fixes#6
ParkerM2 merged 12 commits into
mainfrom
Clean-up-and-feature-upgrade

Conversation

@ParkerM2

@ParkerM2 ParkerM2 commented Feb 13, 2026

Copy link
Copy Markdown
Owner

Summary

Major cleanup, feature upgrades, and codebase audit across the Syrnia Tracker extension.

Codebase Audit Fixes

  • Remove noImplicitAny override from tsconfig, delete dead code (colorful-logger, const.ts, ColorType)
  • Replace uuid with native crypto.randomUUID(), remove unused deps (deepmerge, vite-plugin-node-polyfills)
  • Fix all 22+ hardcoded Tailwind colors across 8 files with theme variables
  • Extract shared CSV helpers (deduplicate 3 implementations) and time constants (replace magic numbers)
  • Consolidate Chrome message listeners into single useGlobalDataSync handler
  • Add onError handlers to TanStack Query mutations
  • Harden background service worker: error logging, timeout increase, exp bounds validation, runtime type guards
  • Split TrackedHistory component (415 → 125 lines) into PeriodSummaryCard + PeriodBreakdownTable
  • Remove empty content.css from manifest, silence storage base errors
  • Add accessibility: aria-labels, keyboard nav, narrow MutationObserver scope

Calendar Improvements

  • DayView untracked EXP fix: Single-hour records show only on their specific hour card (no more duplicates across every overlapping cell). Multi-hour records render as a dedicated overflow row at the top.
  • WeekView redesign: Replaced grid of compact CalendarCells with single-column scheduler layout using expandable DayRow cards with full stats (skills, drops, profit, etc.)
  • Current summary rows: Added "Today's Total" and "Week Total" rows with "Current" badge at top of Day/Week views
  • Reversed week ordering: Saturday (newest) at top, Sunday at bottom — matches DayView's newest-first pattern
  • Extracted shared badge styles, formatters, and UntrackedExpCard into Calendar/shared.tsx

Untracked EXP Resolution System (NEW)

  • Persistent notification banner under navbar detects unresolved untracked EXP gaps
  • Resolution editor expands in-place with editable rows: hour slots, skill dropdowns, exp inputs
  • Running totals per skill with color-coded progress (green=exact, red=over, muted=under)
  • Loot entry popover for adding known items with quantity to each hour slot
  • Save flow creates synthetic CSVRows appended to tracked data — resolved exp appears normally in calendar and loot views
  • Dismiss option to mark gaps resolved without creating data
  • Multi-gap navigation with prev/next when multiple unresolved periods exist
  • Data layer: useUntrackedResolution hook with gap grouping, initial row generation, and save logic
  • Storage: resolveUntrackedExpRecords marks records resolved; useUntrackedExp filters them out

Previous Feature Work (on this branch)

  • Untracked EXP detection system (session baseline, gap detection, storage with dedup + 90-day retention)
  • Navigation redesign with Card wrapper + 3-stage progressive collapse + mobile dropdown
  • Zoom feature (50-150%, persisted)
  • LootMap "week" grouping + GP total badges
  • Farming exp detection

Test plan

  • Build extension and load in Chrome
  • Verify notification banner appears when untracked EXP exists
  • Click banner to expand resolution editor
  • Edit exp values and verify running totals update correctly
  • Add loot via popover, verify pills appear and are removable
  • Save resolution and verify data appears in calendar/loot views
  • Dismiss a gap and verify it disappears
  • Test multi-gap navigation (prev/next)
  • Verify banner collapses and hides when all gaps resolved
  • Verify DayView shows single-hour untracked on correct hour only
  • Verify WeekView scheduler layout with expandable day cards
  • Verify no hardcoded colors — all theme variables

🤖 Generated with Claude Code

ParkerES and others added 12 commits February 13, 2026 15:05
The `noImplicitAny: false` setting was undermining `strict: true`. Removing
it only introduces 1 new TS7006 error (in build/zipper), well within tolerance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Delete app/utils/colorful-logger.ts (no-op logger, nothing imports it)
- Delete app/utils/const.ts (ANSI color codes, only used by ColorType)
- Remove ColorType from types/index.ts (only used by dead logger)
- Remove barrel exports from utils/index.ts
- Keep SKILL_COLORS in constants (actively used by ExpChart)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace text-red-500, text-green-500, text-blue-500, text-purple-500,
border-slate-*, bg-slate-*, and color="aqua" with theme-aware
alternatives (text-destructive, text-primary, text-accent-foreground,
text-secondary-foreground, border-border, border-accent, bg-accent,
hsl(var(--primary))) across 8 files:

- TrackedHistory: HP used, net profit, drop values
- Profile: gained exp, "Current" badge
- ProfileCard: hour exp, week exp, levels gained
- Performance: damage values
- EquipmentDisplay: enchant colors
- LoadingSpinner: ring loader color
- Tabs: selected/hover border colors
- statRowHelpers: damage row color

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eCSVLine

- Create app/utils/csv-helpers.ts with escapeCSVField and parseCSVLine
- Add tests in app/__tests__/csv-helpers.test.ts (10 test cases)
- Remove duplicated escapeCSVField from csv-tracker.ts and storage-service.ts
- Replace inline CSV parsing loops with parseCSVLine in csv-tracker.ts and storage-service.ts
- Move getUserStatsCSVHeader into storage-service.ts, delete legacy user-stats-storage.ts
- Add csv-helpers barrel export, remove user-stats-storage barrel export

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace uuid import with native crypto.randomUUID() in scrapeScreenData.ts
- Remove uuid from dependencies (no other usage)
- Remove deepmerge from devDependencies (unused)
- Remove vite-plugin-node-polyfills from all build configs (no Node.js
  APIs used in app code; was only needed for uuid)
- Remove colorfulLog import from make-manifest-plugin (was importing
  from deleted app/utils/colorful-logger.ts)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create app/utils/time-constants.ts with MS_PER_MINUTE, MS_PER_HOUR, MS_PER_DAY, MS_PER_WEEK
- Add tests in app/__tests__/time-constants.test.ts (4 test cases)
- Replace 90 * 24 * 60 * 60 * 1000 with 90 * MS_PER_DAY in storage-service.ts
- Replace 3_600_000 and 86_400_000 with MS_PER_HOUR and MS_PER_DAY in useUntrackedExp.ts
- Add time-constants barrel export

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove redundant messageListener and justUpdatedViaMessageRef from useTrackedDataQuery
- Remove redundant messageListener and justUpdatedViaMessageRef from useUserStatsQuery
- Fix double-invalidation: remove refetchQueries calls from storage listeners in
  useTrackedDataQuery, useSessionBaseline, and useUntrackedExp
- Change useUserStatsQuery refetchOnMount from false to "always" for fresh data
- Add sessionBaseline and weeklyStats invalidation on UPDATE_USER_STATS in useGlobalDataSync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add onError handler to clearMutation in useTrackedDataQuery
- Add onError handler to clearByHourMutation in useTrackedDataQuery
- Add onError handler to saveMutation in useItemValuesQuery

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…downTable

Extract two sub-components to reduce cognitive load. Add aria-expanded,
keyboard navigation, and role attributes to expandable rows for accessibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rror

Remove the unused CSS content_scripts entry from manifest.js since
content.css is empty. Replace console.error in storage/base.ts with
a silent catch comment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…erver scope

Add aria-label to the JSON copy button in DataView. Narrow the
MutationObserver in stats content script to #mainContent with
document.body fallback. Add beforeunload cleanup listener.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add error logging to 7 silent catch blocks in background service worker
- Increase stats tab timeout from 10s to 30s
- Add exp value bounds validation (reject < 0 or > 10B)
- Add isValidScreenData() runtime type guard for Chrome messages
- Update skill level regex to handle comma-formatted numbers
- Add try/finally to downloads API, increase URL revoke delay to 5s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ParkerM2
ParkerM2 merged commit 4013f5f into main Feb 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants