Skip to content

refactor(ui): adopt Astryx disclosures - #1711

Merged
Astro-Han merged 3 commits into
mainfrom
refactor/1565-astryx-disclosures
Jul 31, 2026
Merged

refactor(ui): adopt Astryx disclosures#1711
Astro-Han merged 3 commits into
mainfrom
refactor/1565-astryx-disclosures

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Refs #1565 (Slice 8, flat PR A).

Moves every disclosure owned by chat-turn.tsx, tool-activity.tsx, and task-ledger-panel.tsx directly onto @astryxdesign/core Collapsible. Maka retains only product state: manual tool expansion survives streaming/status rerenders, permission prompts auto-open, deep thinking starts collapsed and follows live content only while open, error diagnostics remain redacted and bounded, and the task ledger keeps its tree ordering and recent-terminal count.

This is one ownership boundary: it migrates all remaining consumers of Maka's shared Collapsible and removes the public/shared primitives that consequently have no real consumers. It does not touch model pickers, composer model controls, General Settings, or their stories/tests/styles.

Deleted surface:

  • Maka's primitives/collapsible.tsx implementation and barrel exports
  • the unused Accordion implementation, exports, and Story
  • the unused Toggle, ToggleGroup, and Progress implementations, exports, and Stories
  • their dead CSS hooks/comments and the retired Base UI source-shape disclosure contract

Intentional capability/appearance changes:

  • Astryx owns the native button, chevron, focus ring, keyboard behavior, linked content region, and open-state chrome; Maka's duplicate quiet chevrons, focus framework, rotation hooks, and tool-card divider are gone.
  • Maka's existing product open state gates heavy disclosure children. Collapsed tool output, processing timelines, deep thinking, and raw error diagnostics no longer build hidden trees; opening mounts them inside the Astryx-owned content region. This also lets live output auto-follow run after visible layout exists.

Verification

  • rebased onto origin/main cf095e196
  • npm run build — passed (all workspaces plus desktop renderer production build)
  • npm run typecheck — passed after the dependency-ordered build refreshed cross-workspace declarations
  • npm run format:check — passed
  • npm run lint — passed
  • npm test -w @maka/core — 1,254 passed
  • npm test -w @maka/ui — 289 passed
  • npm test -w @maka/desktop — 2,691 passed
  • npm run build-storybook -w @maka/desktop — passed; DisclosureInteraction covers collapsed hit-testing, full-row trigger geometry, Enter expansion, visible content, and label/chevron alignment
  • npx playwright test --config e2e/playwright.config.ts e2e/disclosure-output.spec.ts — 1 passed in a real Electron window; verifies Processing and its tool row do not mount collapsed output, expansion follows a static 160-line live stream to within 1px of the tail without a new chunk, and Space collapses/unmounts it
  • MAKA_DISCLOSURE_E2E_SCREENSHOT=/tmp/maka-1565-disclosure-electron.png npx playwright test --config e2e/playwright.config.ts session-workbar.spec.ts — 2 passed earlier in this PR; verifies computed-style and keyboard ownership on the task-ledger journey. One live screenshot was captured locally; no screenshot baseline or generated image is committed.

Review focus

  • Product state remains Maka-owned; generic disclosure mechanics are Astryx-owned with no compatibility wrapper or parallel state path.
  • The task ledger already exposes role=tree/treeitem without focusable items, roving focus/aria-activedescendant, or APG Arrow/Home/End behavior. That existing accessibility gap is intentionally deferred to Slice 9; this PR only changes the surrounding recent-tasks disclosure. See the WAI-ARIA APG Tree View Pattern.
  • Settings/MCP native <details> and BaseButton disclosures remain untouched for Slice 10.

@Astro-Han
Astro-Han force-pushed the refactor/1565-astryx-disclosures branch from 7281ff7 to 74b381b Compare July 31, 2026 16:15
@Astro-Han
Astro-Han merged commit 80792ec into main Jul 31, 2026
7 of 9 checks passed
@Astro-Han
Astro-Han deleted the refactor/1565-astryx-disclosures branch July 31, 2026 16:56
jackwener added a commit that referenced this pull request Jul 31, 2026
These 149 tests read the project's own source and CSS off disk and
asserted on its text. They imported nothing under test and ran no code,
so they could only ever catch what a linter catches — "don't write a
bare 3px", "don't hand-write role=dialog" — while charging every
refactor a rewrite of its own guards. #1711 deleted two of them to land
an Astryx migration; #1716 had to rewrite six to move three buttons.

Deleted: 149 test files (~675 tests) plus one orphaned source helper.
Kept: the 219 behavioral tests in the same directory, every e2e spec,
and the fast scripts/check-*.mjs commands (dead-css, a11y, copy,
console) that cover the same ground in seconds without a build.

Also kept, deliberately, seven static guards that protect non-cosmetic
invariants rather than styling: the preload/IPC surface pins, the
renderer token-leak gate, external-link noopener, and secret redaction.
Those are cheap and guard things review reliably misses.

The CSS governance doc kept pointing at deleted guards, so its
enforcement section now says what actually holds the line: conventions
plus the check-* scripts, verified on the rendered surface.
jackwener added a commit that referenced this pull request Jul 31, 2026
* chore(desktop): drop the source-scanning contract test suite

These 149 tests read the project's own source and CSS off disk and
asserted on its text. They imported nothing under test and ran no code,
so they could only ever catch what a linter catches — "don't write a
bare 3px", "don't hand-write role=dialog" — while charging every
refactor a rewrite of its own guards. #1711 deleted two of them to land
an Astryx migration; #1716 had to rewrite six to move three buttons.

Deleted: 149 test files (~675 tests) plus one orphaned source helper.
Kept: the 219 behavioral tests in the same directory, every e2e spec,
and the fast scripts/check-*.mjs commands (dead-css, a11y, copy,
console) that cover the same ground in seconds without a build.

Also kept, deliberately, seven static guards that protect non-cosmetic
invariants rather than styling: the preload/IPC surface pins, the
renderer token-leak gate, external-link noopener, and secret redaction.
Those are cheap and guard things review reliably misses.

The CSS governance doc kept pointing at deleted guards, so its
enforcement section now says what actually holds the line: conventions
plus the check-* scripts, verified on the rendered surface.

* chore(desktop): drop postcss and unused source helpers with the suite

The deleted CSS-parse contract was postcss's only consumer, and the
tailwind-compile contract was the only TS importer of tailwindcss —
which styles.css still needs through `@import "tailwindcss"`, so it
stays declared and is now ignored by knip instead. Nine helper exports
lost their last readers with the suite; knip must report zero for
apps/desktop.
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