Repository navigation
fix(remote): give host project groups their own sidebar section and the shared project sort - #2394
Conversation
Host-owned groups trailed the local project list with no heading, so a host project read as a retained local one, and every host conversation repeated a "Remote" chip that the section heading can carry once. Group order also followed the host's session array, so opening a conversation in one host project moved that group above another while the local list stayed put. The project comparator now lives in one helper used by both lists, so a host group sorts through the same project sort as a local one and a project's position no longer depends on which of its sessions arrived first. The section heading is emitted only while a host has a group, and rows inside it drop the per-row source chip. Covered by a component test for the heading wiring, the shared fold state and the chip suppression, a grouping test for order stability, and ordering assertions in the paired-host journey script.
|
This branch currently conflicts with |
…oup-section Keeps the branch on current main so the host-group section and shared project sort can be reviewed against the code that will actually ship. The single conflict was in `Sidebar.tsx`, where main wrapped the projects section in `showProjectsSection` and added the Recent-sessions area: the resolution keeps main's structure and places the `Remote` heading plus the host groups inside the existing projects list, with the section still emitted only while a host has a group.
|
Merged the latest The only conflict was in Re-ran everything at the updated head
The PR body now reflects the new base and the merge note. Still 18 files, |
Summary
Issue #2370 was fixed on
mainby #2382 (project id on attach, group fold,source-chip wrapping). This is the part of that report that is still missing,
split out of #2371 after #2382 landed so it can be reviewed on its own:
project list with no heading, so a host project read as a retained local one
and every host conversation repeated a per-row
Remotechip. They now situnder their own
Remoteheading (data-sidebar-section="remote"), emittedonly while at least one host group is visible, and rows inside that section
drop the redundant chip.
groupRemoteProjectSessionsreturned groups in host session-array order, so opening a conversation in one
host project moved that group to the top while the local list stayed put.
Groups now sort through the same comparator the local list uses, so their
position follows the sidebar project sort (
recent,created,oldest,name).The project comparator moved out of
Sidebar.tsxintoapps/desktop/src/lib/project-order.tsso both lists read one rule instead oftwo copies of the same archive/pin/manual/date chain. The local list is
behaviour-preserving: its comparator was moved, not rewritten.
Verification
node scripts/e2e-remote-project-groups-journey.mjs(real paired host)node --teston the 3 touched desktop test filespnpm --filter @pi-desktop/desktop typecheckpnpm --filter @pi-desktop/docs check:docspnpm lint:biomepnpm check:pr-baseorigin/main(950200348)Merged
origin/main(950200348) into the branch. The one conflict, inSidebar.tsx, was that main now wraps the project list inshowProjectsSectionand renders a
Recentsection above it: the resolution keeps main's structureand puts the
Remoteheading plus the host groups at the end of the existingproject list, so the section is still only emitted while a host has a group.
All checks above were re-run after that merge.
The journey script now also covers the ordering report, so the acceptance is
runnable rather than manual:
It ran against a real paired
pi-desktop-host-coreon Windows at this head withPI_HOST_CORE_BINARY=target/debug/pi-desktop-host-core.exe, so thelist → attach → group retention, persisted collapse, and stable ordering path is
covered end to end. New unit-level coverage:
apps/desktop/test/remote-project-groups.test.mjs— the heading appears beforethe groups and only when a host has one, its box matches the shared label
inset, the surface drops the per-row chip, every locale names the section, and
the fold uses the shared
projectCollapsedstate under theremote::keywithout touching
openProjectPaths.apps/desktop/test/remote-project-session.test.mjs— the same two hostprojects produce the same group order whether the host lists the opened
session first or last, under both
recentandname.Scope
Sidebar.tsx,project-order.ts(new),remote-project-catalog.ts,sessions.css, one dialog-free component test, one grouping test, the journeyscript, nine locale lines, and two spec paragraphs. No protocol, persistence,
database, or host-core change.
#2371is closed in favour of this pull request; its identity, fold, and chipfixes all landed in #2382 and are not duplicated here.