Repository navigation
feat(ui): add generation history panel - #19
Merged
Merged
Conversation
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.
Task T3.3 (History) from
docs/ARCHITECTURE.md§14.2 (P3 — UI against contracts). Implements FR-08 / AC13: history preview, restore, and individual deletion.What changed
frontend/src/components/HistoryPanel.tsx(new): native<details>disclosure afterPlaybackPanel, collapsed by default on narrow viewports (≤ 700 px) per §12. Loadsapi.listGenerations()on mount and once per terminal current generation that is not already listed.getGeneration+getAudioBlob→SELECT_HISTORY_ITEM(no SSE, per the T3.1/T3.2 contract). Onlysucceededrows are restorable; the restored blob URL is revoked when playback moves on or on unmount.deleteGeneration→HISTORY_DELETED; disabled forqueued/running/cancellingrows (API answers 409GENERATION_BUSY).App.tsx: replaces the T3.1/T3.2 history placeholder withHistoryPanel.styles.css: additive history/disclosure rules.docs/TASKS.md: T3.3 recorded as Doing with verification, decisions, and frozen downstream labels.Verification
tsc --noEmit; Prettier (CRLF); live + mockvite build.<time>, restore loads subtitle text +<audio>, deleting one entry keeps the other, deleting the open entry clears playback, no console errors.src/tts tests; strict mypy;git diff --check.Decisions
SELECT_HISTORY_ITEMonly carries detail + audio).matchMedia; resizing later does not force-collapse it.Shared-file note
App.tsxandstyles.cssare not owned by T3.3 but received additive edits; T3.1/T3.2 explicitly reserved the history placeholder for this task.contracts.ts,appContext.tsx,api/*, and the mock are untouched (all needed actions/methods already existed).Frozen downstream
T5.1's AC13 spec can rely on: classes
.history-item,.history-preview,.history-meta,.history-actions;aria-label="Open generation: <preview>"/aria-label="Delete generation: <preview>"; count lineN saved generation(s); empty state "Nothing here yet. Generate audio and it will appear in this list."