Repository navigation
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
There was a problem hiding this comment.
This doesn't work as submitted yet. bun run typecheck in packages/app fails on the new code: createStore and displayName are used in controller.tsx without being imported, so Home would throw as soon as the sessions controller is created. The project groups also don't match the types that createHomeScrollController (route.tsx:19) and the titleOpacity/setHeader props in region.tsx expect. The scroll and sticky-header code needs to handle the new group shape, not just have its types widened.
Public API: unchanged (app UI only).
Other concerns, most important first (details inline):
- The group body in
view.tsxreadsgroup(),viewModeand the collapsed state once, so collapsing, switching view mode and live session updates stop working, in the date view too. HomeSessionLocationnow always shows the location, including on mobile, and the hover and Alt-hold reveal no longer does anything.- The running dot shows the same state as the avatar's existing busy indicator.
- This PR also contains the prompt navigation rail commit (
prompt-rail.*,virtualizer.tsx, the timeline e2e spec and two i18n keys), which is unrelated and is the same as your open #57869. Please drop it from this PR so each change can be reviewed on its own. Note thatdevrecently removed the turn navigator (ee8221c).
Once it compiles, before/after screenshots of Home in both view modes, with a group collapsed, would help.
Related: #55446
| const platform = usePlatform() | ||
| const queryClient = useQueryClient() | ||
|
|
||
| const [viewMode, setViewMode] = createStore<{ mode: HomeSessionViewMode }>({ mode: "date" }) |
There was a problem hiding this comment.
createStore isn't imported (only solid-js is), and neither is displayName at line 461. Type-checking fails, and this throws at runtime as soon as Home builds the sessions controller. record.projectName already holds the resolved display name, so you could use that instead of displayName.
| ].filter((group) => group.sessions.length > 0) | ||
| } | ||
|
|
||
| function groupSessionsByProject(records: HomeSessionRecord[]): HomeSessionProjectGroup[] { |
There was a problem hiding this comment.
groups can now return HomeSessionProjectGroup[], but createHomeScrollController in home/scroll.ts (used from route.tsx) is typed and keyed on the today/yesterday/older ids for its header offsets and title fades. Widening the view's prop types to string doesn't change that, so region.tsx fails type-checking. Giving project groups the same { id, title, sessions } shape as date groups would let the scroll code and the view handle both without casts.
| </> | ||
| )} | ||
| {(group, index) => { | ||
| const isProjectGroup = props.viewMode === "project" |
There was a problem hiding this comment.
Index runs this callback once per slot, without tracking, so isProjectGroup, groupTitle, groupSessions and isCollapsed are captured on first render and never update. Clicking the chevron won't collapse the group, switching mode won't refresh the slots that stay mounted, and <Key each={groupSessions}> keeps the first array it got, so new or moved sessions stop showing up in the date view too. Read these inside the JSX, or as accessors such as () => props.isGroupCollapsed(group().id).
| desktop: boolean | ||
| }) { | ||
| if (!props.desktop) return null | ||
| const worktree = () => props.location.worktree |
There was a problem hiding this comment.
This drops the desktop guard and the show/instantHide handling, so worktree and branch now show on every row, mobile included, and squeeze titles there. The Alt-hold and hover reveal (showLocations, show=) is still wired up but no longer does anything. If always-visible locations is the goal, the leftover reveal code should go too, and narrow layouts still need handling.
| unread: avatar.unread, | ||
| loading: avatar.loading, | ||
| open: () => props.isOpenTab(props.record), | ||
| running: () => avatar.loading() && !avatar.unread(), |
There was a problem hiding this comment.
avatar.loading() is already false whenever the session needs attention (which is what makes unread true), so running is effectively the same as loading, which the avatar already shows as busy. The dot repeats an existing indicator rather than adding information.
Summary
Refactored the sessions tab to improve organization and visual feedback:
Features
Implementation
unning\ state
Files Changed
Added by the opencode bot (AI-generated).
Related: #55446