Skip to content

[codex] Improve project-grouped sidebar - #557

Merged
Astro-Han merged 4 commits into
apache:mainfrom
sunheyi6:codex/project-group-sidebar
Jul 6, 2026
Merged

[codex] Improve project-grouped sidebar#557
Astro-Han merged 4 commits into
apache:mainfrom
sunheyi6:codex/project-group-sidebar

Conversation

@sunheyi6

@sunheyi6 sunheyi6 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a clickable status/project grouping toggle with pressed-button semantics.
  • Render project-grouped sessions as folder sections with an initial four-session preview and a Show more control.
  • Let each project folder header expand or collapse only its own conversations.

Why

The project grouping view previously did not match the requested folder-style design, and project headers were not interactive. This makes the sidebar behave like a project tree while preserving the compact session rows.

Validation

  • npm --workspace @maka/ui run build
  • npm --workspace @maka/desktop run build:main
  • node --test dist\main\tests\session-project-view-contract.test.js
  • node --test dist\main\tests\sidebar-scroll-contract.test.js
  • npm --workspace @maka/desktop run build:renderer

@Astro-Han please take a look.

@sunheyi6
sunheyi6 marked this pull request as ready for review July 5, 2026 23:59
sunheyi6 and others added 4 commits July 6, 2026 22:00
… project headers

- Collapsed panel keeps a 4-row grid: the view-mode toggle is display:none in collapsed mode and does not participate in grid layout, so the 5-row template dropped the footer into the minmax(0,1fr) track.
- Project group headers and the show-more control now route through UiButton (variant=quiet, size=nav) for the shared hover/focus/active contract, matching the status-group header; bespoke :hover/:focus-visible/svg-size CSS removed.
- Set justify-content: flex-start on both: UiButton's buttonVariants base adds justify-center, which centered heading content under width:100%.
- Tests: collapsed 4-row grid contract; folder-header disclosure assertion is now attribute-order independent (BaseButton reorders props).
The 32px (--space-8) indent under each project folder was redundant — folder hierarchy is already conveyed by the heading folder icon + group spacing, and it pushed session rows ~2 chars in from the project heading.
apache#571 rerouted the view-mode toggle through the shared SettingsSegmented primitive; its <button> puts the label inline (no wrapping <span>) and marks selection via aria-pressed + data-pressed. Drop the <span>/type-order assumptions from the assertion.
@Astro-Han

Copy link
Copy Markdown
Contributor

Reviewed #557 and applied fixes on top — branch fix/557-collapse-grid-ui-unify, rebased onto latest main (incl. #571/#572).

Findings & fixes:

  1. Collapsed sidebar layout regression. The 5-row grid was kept in collapsed mode even though the view-mode toggle is display:none there. A display:none item doesn't participate in grid layout, so the footer dropped into the minmax(0,1fr) track and the settings button floated mid-rail. Fix: collapsed mode uses a 4-row grid; added a CSS contract test.
  2. Project group headers + "show more" used raw <button>, diverging from the status-group header which already routes through UiButton (variant=quiet, size=nav) for the shared hover/focus/active contract. Migrated both to UiButton; dropped the bespoke :hover/:focus-visible/svg CSS. Also fixed content centering — UiButton's base adds justify-center, which centered the heading under width:100%; set justify-content: flex-start.
  3. Session rows over-indented under projects. The 32px (--space-8) left indent was redundant (folder hierarchy is already conveyed by the heading icon + group spacing) and pushed rows ~2 chars in from the heading. Removed so rows align left.
  4. Test hardening. Folder-header disclosure assertion is now attribute-order independent; view-mode pressed assertion updated for SettingsSegmented (fix(ui): designer-audit round 1 — sidebar overlap, count mismatch, tab split, empty-state placement, vaporware chrome #571 rerouted the toggle through it).

Validation: @maka/ui + @maka/desktop:main build clean; both sidebar contract suites pass (12/12); typecheck clean.

Note: the original view-mode toggle CSS had hardcoded px + referenced non-existent tokens — #571 already replaced it with SettingsSegmented, so this branch adopts #571's version.

@Astro-Han
Astro-Han force-pushed the codex/project-group-sidebar branch from 9fabf60 to 771fc98 Compare July 6, 2026 14:04
@Astro-Han
Astro-Han merged commit 6f4b571 into apache:main Jul 6, 2026
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.

2 participants