Repository navigation
refactor(timetracking): deepen the Time Tracking modules (#331, #335, #336) - #351
Merged
Merged
Conversation
Move lookups (projectById, customerById), the active / in-use rules, validation, work-week rules and prefill into timetracking-model.js, which imports nothing that touches storage, IndexedDB or the emitter. Report, filter, entry fields, balance and settings now take lookups from it, so importing them no longer loads storage. Commands stay in timetracking-crud.js and timetracking-settings.js. timetracking-references.js and timetracking-work-week-model.js merge into the model; the duplicate customerOf lookup is gone. The model is unit-tested without mocks, and an import-graph test keeps the pure modules free of storage. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… adapters; tracker takes it (#335) createTimeTracking(port) in timetracking-api.js holds the commands, settings, display and device prefs and change subscription without loading storage or the emitter. createStorageTimeTracking() wraps the Read Model and emitter for the app; the test fixture createTestTimeTracking() folds events through the real reducer. The page shell creates one and passes it to the tracker panel (and the reports panel's getters). timetracking-crud.js stays as a module-level facade until #336. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#335) Drops the storage and emitter mocks and the hand-written reducer inside them. Adds coverage for archive, unarchive, in-use guard, raced delete (archives instead) and tombstone restore as seen in the tracker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…interface (#336) Projects (incl. the Work week editor), Settings and Reports panels read, change and subscribe through the interface the page shell creates once. The temporary timetracking-crud.js facade and the shell's getPrefs option are gone. Time Tracking tests use the test adapter instead of mocking storage and the emitter; an import-graph guard keeps panels off storage. The tracker's live Work week test drives the Projects editor again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…331, #335, #336) - Rename CRUD_ERROR to TT_ERROR; fix the stale in-use comment. - Legacy Work week migration uses customerById. - timetracking-api: emitTT and fieldChange helpers; archive/delete use the model lookups. - Projects panel: rename goes through itemActions; tracker reaches the interface one way. - Trim banner and header comments; CONTEXT.md §6 lists the Time Tracking modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mdiener21
marked this pull request as ready for review
November 20, 2026 16:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Package 3 of #326: deepen Time Tracking. Behaviour-preserving refactor; no CHANGELOG line.
timetracking-model.js: lookups (projectById,customerById— now the only customer lookup), active/in-use rules, work-week rules, prefill. Imports nothing that touches storage, IDB or the emitter;model-imports.test.jsguards that for the model and the pure consumers.createTimeTracking(port)intimetracking-api.js(state, settings, prefs, commands,subscribe), with a storage adapter (timetracking-api-storage.js) and a test adapter (tests/fixtures/time-tracking.js) that folds events through the real reducer. Tracker panel moved first; new DOM tests cover archive, restore and guarded delete through the tracker.mountTimeTrackingcreates it once.timetracking-crud.jsandtimetracking-references.jsdeleted. Time-tracking unit/DOM tests no longervi.mockstorage or the emitter.CRUD_ERROR→TT_ERROR, emit/field-change helpers, rename folded intoitemActions,CONTEXT.md§6 Time Tracking rows.Deliberately left as-is:
settings.test.jsandlegacy-work-week.test.jsrun on the storage adapter + fake-indexeddb: they test persistence.Local runs: lint clean; unit 998/998; DOM 805/805; all timetracking e2e pass.
notifications.spec.ts:177fails locally on this branch and its base alike (no notifications code touched) — CI is the verdict.Closes #331
Closes #335
Closes #336
Closes #326
Checklist
CHANGELOG.md[Unreleased]: one user-facing line, if users notice the change (none: internal)CONTEXT.mdor an ADR updated if architecture or a domain term changeddocs/spec/touched up, if a described behaviour changed (never blocks merging)🤖 Generated with Claude Code