feat(web): add combined session list filters - #1772
Open
techotaku39 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Findings
- [Major] Scratchlist status is omitted from unreplayable-reconnect resync - the new independent cache at
web/src/hooks/queries/useScratchlistSessionIds.ts:13is invalidated for live scratchlist patches, butweb/src/App.tsx:256only invalidates the sessions list and session-detail caches whenresumed=false. If a scratchlist is created or deleted during an SSE gap that cannot be replayed, the active scratchlist filter can continue using old IDs;staleTimemarks data stale but does not poll.
Suggested fix:const invalidations = [ queryClient.invalidateQueries({ queryKey: queryKeys.sessions }), queryClient.invalidateQueries({ queryKey: queryKeys.scratchlistSessionIds }), queryClient.invalidateQueries({ queryKey: ['session'] }) ]
Summary
- Review mode: initial
- One Major correctness issue found in reconnect cache synchronization.
Testing
- Not run (automation). Add a reconnect test where the handshake reports
resumed=falseafter scratchlist membership changes and assertqueryKeys.scratchlistSessionIdsis invalidated/refetched.
HAPI Bot
| } { | ||
| const queryEnabled = Boolean(api && enabled) | ||
| const query = useQuery({ | ||
| queryKey: queryKeys.scratchlistSessionIds, |
There was a problem hiding this comment.
[MAJOR] Scratchlist status survives an unreplayable reconnect
This new cache is invalidated for live scratchlistUpdatedAt patches, but the full-resync path in App.handleSseConnect (web/src/App.tsx:256) invalidates only queryKeys.sessions and ['session']. When the hub reports resumed=false, scratchlist creates/deletes during the gap are not replayed, so this query can keep driving the filter with old IDs. staleTime does not trigger polling by itself.
Suggested fix:
const invalidations = [
queryClient.invalidateQueries({ queryKey: queryKeys.sessions }),
queryClient.invalidateQueries({ queryKey: queryKeys.scratchlistSessionIds }),
queryClient.invalidateQueries({ queryKey: ['session'] })
]Please add a non-resumed reconnect regression test for this cache.
There was a problem hiding this comment.
Findings
- None.
Summary
- Review mode: follow-up after new commits
- The prior Major reconnect-cache finding is resolved on the current head. No additional issues found in the full latest diff.
- Residual risk: floating filter/date-picker behavior still depends on browser layout and mobile safe-area combinations beyond the pure positioning unit tests.
Testing
- Not run locally (automation). GitHub checks
test,integration, anddrift-gatepassed.
HAPI Bot
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
Problem / Motivation
Previously, filtering was split across separate controls and did not provide a shared multi-select model. Users could not directly build combined queries such as “unread sessions updated within a date range that also contain scratchlist entries”, or consistently combine session criteria with machine filtering from one filter surface.
Scratchlist data was already persisted in the Hub and synchronized across clients, but the session list had no way to identify sessions containing scratchlist entries without opening them individually. Long date ranges and filter menus also needed more reliable positioning on narrow mobile viewports.
Implementation Notes
GET /api/sessions/scratchlist-status, returning distinct scratchlist-bearing session IDs within the authenticated namespace.Validation
bun run typecheck— passed for CLI, Web, Hub, and Relay.bun run --cwd hub test -- src/web/routes/sessions-scratchlist.test.ts src/store/migration-v12.test.ts— 38/38 passed..\scripts\Invoke-HapiTaskPlaywright.ps1 -Name investigate-draft-session-filter -Suite Root e2e/terminal-wrap-fidelity.spec.ts— 2/2 passed.bun run build— passed.Related Issues
None
AI Disclosure
OpenAI Codex (GPT-5.6)