Skip to content

Let a member hide components on their own canvas - #74

Merged
Royal-lobster merged 1 commit into
mainfrom
hide-components
Nov 10, 2026
Merged

Royal-lobster merged 1 commit into
mainfrom
hide-components

Conversation

@Royal-lobster

Copy link
Copy Markdown
Owner

Trigger

Feature pages often carry component sections that serve agents and designers as references. A reviewer who only wants the screens had no way to clear them away, and since only agents can change a canvas, there was nothing a member could do about it.

Behavior

  • The file menu has a Show components checkbox. Turning it off removes component nodes from this viewer's canvas, along with any section left empty. Remaining screens reflow, and Fit (⇧1) frames only what is visible.
  • The setting is per browser (localStorage["sharpner:hide-components"]), shared across files. Nothing goes to the FileRoom, so other members, share-link viewers and agents still see everything. MCP and get_app_state are unchanged.
  • The Design System page always shows its components.
  • Comment pins on hidden components are hidden and excluded from navigation bounds. A comment on a deleted node behaves as before. Opening a comment pinned to a component, or a link that targets one, turns components back on.
  • Hiding drops selected components from the selection, so the selection bar never names something that isn't on screen.

The filter, withoutComponents, runs before layoutRects inside CanvasLayout.page, and the geometry cache keys on the flag.

Verification

  • pnpm test (711 passed), pnpm typecheck and pnpm build pass. The new src/canvas-layout.test.ts covers component and section filtering and the hidden-anchor rule.
  • Driven with verify-sharpner on a local instance. I made a page with a screen section, a components-only section and a comment on a component, then checked:
    • toggling hides the components, their section and the comment pin
    • the setting survives a reload
    • a share-link viewer in a separate browser still saw the components while the member had them hidden
    • opening the comment from the panel brought components back and centered on its pin
    • a design-system page kept its component while hiding was on
    • the menu and Fit work at 390×844
  • Not verified: touch devices. Screenshots stay outside the repo, in the local verify run's evidence directory. No PR attachment mechanism was available.
  • The verify-sharpner feature map has a new recipe for the toggle, and the share-link step that listed the viewer's menu items is updated.

🤖 Generated with Claude Code

A "Show components" toggle in the file menu leaves component nodes, and
sections they empty, off this viewer's canvas. The setting lives in this
browser's localStorage, so other members, viewers and agents still see
everything. The Design System page always shows its components, and
opening a link or comment that targets a component turns them back on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Royal-lobster
Royal-lobster merged commit 69dad75 into main Nov 10, 2026
2 checks passed
@Royal-lobster
Royal-lobster deleted the hide-components branch November 10, 2026 20:57
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