Skip to content

fix(sidebar): put host project group headers on the local project rail - #2534

Open
mybolide wants to merge 1 commit into
vastsa:mainfrom
mybolide:fix/remote-project-group-rail
Open

mybolide wants to merge 1 commit into
vastsa:mainfrom
mybolide:fix/remote-project-group-rail

Conversation

@mybolide

Copy link
Copy Markdown
Contributor

Problem

Host project groups in the sidebar were rendered with the generic Button
primitive instead of the title primitive a local project group uses. That put
btn btn-ghost on top of sidebar-session-group-title, so the button reset's
centered content and 12px padding overrode the title box's 6px inset.

Measured in a running 0.23.0 desktop against a real SSH host:

group title padding-left chevron x folder x label x
local 6px 18 36 54
host pi-desktop-plugins 12px 24 43 62
host 713Air 12px 58 77 96

Because the reset centers its content, a shorter host project name was pushed
furthest right, so a host group read as a nested child of the group above it
instead of a sibling section under its own Remote heading.

Fix

  • Render the header title through TooltipButton, the same primitive
    Sidebar.tsx uses for a local project group, so only
    sidebar-session-group-title carries the box.
  • Give the trailing new-task control the shared sidebar-session-group-add
    class, so it gets the same reveal behaviour and hit area as the local one.

After the change every group on the rail resolves to the same geometry:
title x 12, chevron 18, folder 36, label 54, body x 23, first row x 32 — for
local projects and both host groups alike.

Tests

  • New regression test in apps/desktop/test/remote-project-groups.test.mjs
    asserts the rendered header carries no btn class, keeps
    sidebar-session-group-title project-toggle, and that the add control keeps
    sidebar-session-group-add. It fails on the previous markup.
  • remote-project-groups, sidebar-modules-visibility,
    sidebar-project-runs: 19/19 passed.
  • pnpm build:js: exit 0.
  • pnpm --filter @pi-desktop/desktop typecheck: exit 0.
  • pnpm lint: 0 findings (lint:biome clean, style tokens OK).
  • Verified on a packaged Windows 0.23.0 build connected to a real remote host,
    including expanding both host groups; the geometry above was read from the
    live DOM through the DevTools protocol.

docs/spec/06-delivery/e2e/live-and-remote.md records that a host group header
shares the local group's title rail.

A host project header rendered through the generic Button primitive, so it
carried `btn`/`btn-ghost` on top of `sidebar-session-group-title`. The
button reset centers its content and adds 12px of padding, which overrode the
title box's 6px inset and pulled the chevron, folder, and label off the rail
every local project group sits on. A short host project name was pushed
furthest right, so the group read as nested under its neighbour.

Render the title through `TooltipButton` like the local group does, and give
the trailing new-task control the shared `sidebar-session-group-add` class so
it takes the same reveal behaviour. The regression test asserts the rendered
header carries no `btn` class and the add control keeps that class.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant