feat(web): add pin-in-progress session layout modes - #1758
techotaku39 wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Findings
- None.
Summary
- Review mode: initial
- No reportable correctness, security, regression, data-loss, performance, or maintainability issues found in the latest diff. Residual risk: the new split active/archived grouping has no focused coverage for project-pinned sessions changing active state or for its interaction with active-only/search filters.
Testing
- Not run (automation; PR content was not executed). GitHub status at review time: integration passed; test and pr-review pending.
HAPI Bot
…layout-modes # Conflicts: # web/src/components/SessionList.tsx # web/src/lib/locales/en.ts # web/src/lib/locales/zh-CN.ts # web/src/routes/settings/display.tsx # web/src/routes/settings/index.test.tsx
There was a problem hiding this comment.
Findings
- None.
Summary
- Review mode: follow-up after new commits
- No reportable correctness, security, regression, data-loss, performance, or maintainability issues found in the latest full diff. The follow-up head merges current main; the resolved overlaps in SessionList.tsx, display settings, locale files, and settings tests retain both the layout-mode behavior and the intervening upstream features. Residual risk: combined mode still lacks focused coverage for project-pinned sessions transitioning between active/inactive state and for active-only/search/unread filter interactions.
Testing
- Not run (automation; PR content was not executed). GitHub status at review time: integration and windows-codex-mcp passed; test and pr-review pending.
HAPI Bot
…layout-modes # Conflicts: # web/src/components/SessionList.tsx
There was a problem hiding this comment.
Review mode: follow-up after new commits
Requirement — Pass
An optional project-grouped layout lets users see all connected sessions together while retaining the existing Detailed layout as the default. This fits HAPI’s session-management workflow.
Evidence
- The snapshot description requests persisted Detailed/Combined modes, unrestricted active-session visibility, and expandable archived previews.
- web/src/components/SessionList.tsx:2137 implements the layout choice while retaining the existing running and active sections.
- web/src/hooks/usePinInProgressSessionsMode.ts:5 preserves Detailed as the default.
Approach — Pass
A local display preference and reuse of directory grouping provide a viable implementation. Both layouts consume the existing filtered session set, and separate collapse keys distinguish active and archived groups.
Evidence
- web/src/components/SessionList.tsx:1414 derives Combined groups from machineFilteredSessions.
- web/src/components/SessionList.tsx:1773 tracks selection expansion using layout-specific group keys.
- web/src/routes/settings/display.tsx:181 places the selector alongside pinning and disables it when pinning is off.
- web/src/hooks/usePinInProgressSessionsMode.ts:74 synchronizes preference changes across hook instances and browser tabs.
Code — Reviewed
Reviewed the complete fixed-head merge-base diff. Found one search-ranking regression in Combined mode. PR code was not executed.
- [Minor] Preserve search relevance in Combined groups —
web/src/components/SessionList.tsx:1422
Testing
Not run (automation; PR code execution is prohibited).
- Fixed-head GitHub checks observed: integration passed; test, windows-codex-mcp, and pr-review were in progress.
- Added tests cover preference defaults and synchronization, selector disabling, active-session visibility, archived previews, and Detailed sections. They do not cover search relevance in Combined mode.
- The PR description reports successful typecheck, build, targeted Vitest, and Chromium checks; these were not independently executed under the read-only review rules.
HAPI Bot
| ) | ||
| const combinedArchivedGroups = useMemo( | ||
| () => isCombinedPinLayout | ||
| ? groupSessionsByDirectory(machineFilteredSessions.filter((session) => !session.globalPinned && !session.active)) |
There was a problem hiding this comment.
[Minor] Preserve search relevance in Combined groups
Both Combined group builders call groupSessionsByDirectory without applying rankSessionGroupsBySearchRelevance. That grouping function re-sorts rows and projects by pin/activity/recency, discarding the relevance order already computed upstream. For example, with a preview limit of two, three unpinned inactive sessions under /home/user/project, and an older session titled “Home Assistant”, searching “home” shows the two newer path-only matches and hides the stronger title match behind Expand. Detailed mode correctly ranks that title match first.
Suggested fix
Apply rankSessionGroupsBySearchRelevance to both Combined group arrays when searchScoreIndex and hasTextQuery are present, as the existing groups calculation does. Add Combined-mode coverage for row and project relevance, including an older title match beyond the preview limit.
There was a problem hiding this comment.
Review mode: follow-up after new commits
Requirement — Pass
An optional project-grouped layout makes connected sessions easier to browse while retaining the existing Detailed layout by default. This fits HAPI’s session-management workflow.
Evidence
- The snapshot description requests persisted Detailed/Combined layouts, all active sessions visible, and expandable archived previews.
- web/src/hooks/usePinInProgressSessionsMode.ts:5 preserves Detailed as the default.
- web/src/components/SessionList.tsx:2151 retains both rendering modes.
Approach — Pass
A local display preference and reuse of directory grouping address the requirement without changing shared contracts. Both Combined sections now preserve search relevance.
Evidence
- web/src/components/SessionList.tsx:1414 derives both Combined sections from the existing filtered sessions and applies relevance ranking.
- web/src/components/SessionList.tsx:2153 bypasses preview limits for active sessions and retains archived previews.
- web/src/routes/settings/display.tsx:181 groups the selector with pinning and disables it when pinning is off.
Code — Reviewed
Reviewed the complete fixed-head merge-base diff. The previous search-ranking finding is resolved; one collapse-state defect remains.
- [Minor] Preserve Combined collapse state across temporary filters —
web/src/components/SessionList.tsx:1836
Testing
Not run (automation; PR code execution is prohibited).
- PR code, tests, builds, and scripts were not executed under the read-only review rules.
- Fixed-head CI: integration passed; test, windows-codex-mcp, and pr-review were in progress.
- Added coverage includes preference synchronization, disabled layout choices, active-session visibility, archived previews, Detailed sections, and archived search relevance. Collapse-state preservation across filters is not covered.
- The PR description reports passing typecheck, build, targeted Vitest, and Chromium checks; these were not independently executed.
HAPI Bot
| knownKeys.add(g.key) | ||
| knownKeys.add(`sessions::${g.key}`) | ||
| } | ||
| for (const g of combinedActiveGroups) { |
There was a problem hiding this comment.
[Minor] Preserve Combined collapse state across temporary filters
Collapse an unselected project in Combined mode, search for another project so the collapsed project disappears, then clear the search. Its collapse override is deleted because the suffixed known keys come from filtered combinedActiveGroups/combinedArchivedGroups. The project consequently reopens, undoing the user's layout choices. Switching machine filters has the same effect. Existing directory overrides survive these operations because their known keys come from allGroups.
Suggested fix
Derive the active and archived known keys from the unfiltered group inventory, so filtering does not count as removing a project. Add a Combined-mode regression test that collapses a project, filters it out, clears the filter, and verifies it remains collapsed.
There was a problem hiding this comment.
Review mode: follow-up after new commits
Requirement — Pass
An optional project-grouped layout makes connected sessions easier to browse while retaining Detailed as the default. The scope fits HAPI’s session-management workflow.
Evidence
- The snapshot description requests persisted Detailed/Combined layouts, all active sessions visible, and expandable archived previews.
- web/src/hooks/usePinInProgressSessionsMode.ts:5 preserves Detailed as the default.
Approach — Pass
A local display preference and reuse of existing filtering, grouping, and rendering implement the requirement without changing shared contracts.
Evidence
- web/src/components/SessionList.tsx:1418 derives Combined groups from filtered sessions and preserves search relevance.
- web/src/components/SessionList.tsx:2156 shows all active rows while retaining archived preview controls and the Detailed rendering branch.
- web/src/routes/settings/display.tsx:181 groups the selector with pinning and disables it when pinning is off.
Code — Reviewed
Reviewed the entire fixed-head merge-base diff and relevant surrounding code. No actionable defects found. The previous collapse-state finding is resolved: Combined state cleanup now uses the unfiltered project inventory, with a regression test for temporary search filtering.
No reportable code issues found.
Testing
Not run (automation; PR code execution is prohibited).
- PR code, tests, builds, and scripts were not executed under the read-only review rules.
- Fixed-head CI checks test, integration, windows-codex-mcp, and pr-review were in progress when inspected.
- Added coverage includes preference persistence and synchronization, disabled layout choices, active-session visibility, archived previews, search ranking, collapse-state preservation, and Chromium layout checks.
- The PR description reports passing typecheck, build, targeted Vitest, and Chromium checks; these results were not independently reproduced.
HAPI Bot
Summary
Validation
bun run typecheck— passed.bun run build— passed.Related Issues
None
AI Assistance
Implemented and validated with OpenAI Codex (GPT-5.6).