Skip to content

[HOLD 3.1] feat(workspace): element picker for previews - #524

Merged
lorant-one merged 10 commits into
previewfrom
feat/workspace-element-picker
Nov 24, 2026
Merged

lorant-one merged 10 commits into
previewfrom
feat/workspace-element-picker

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Requested by Lorant · project thread

Stacked on #523. Second piece of the Workspace kit (plan: https://claude.ai/artifact/EwmxSDFjrYDtGH1wpWjNgs).

What

The pointer that lets a person point at part of a preview, so the next chat message is about it ("make this shorter"). Extracted from Aveiro 2.0's section-picker.ts and made generic:

  • armElementPicker(doc, options) (plain DOM). Blocks outline under the pointer and a click picks one. While armed, clicks don't follow links, and Escape cancels. A click that hits nothing goes to onMiss("outside" | "nothing") instead of being swallowed.
    • On a page built from <section>, it picks the outermost section and reports index / total and its heading.
    • On a page without sections, it picks a single heading, paragraph, image, link, and so on. This matches Aveiro#517's "pick elements on pages without sections".
    • Both selectors can be configured.
  • useElementPicker(frameRef, options): arms one pick on a same-origin frame and keeps the picked block outlined until clear(). On a cross-origin frame it does nothing.
  • markElement, pageSections, frameDocument helpers.
  • Docs: a useElementPicker section on Modules › Workspace.

Aveiro-specific parts stay in Aveiro: mapping the frame URL to a page path and the SectionSelection shape.

Checks

  • New element-picker.test.ts (7 tests: section pick with position and heading, miss outside a section with the link click prevented, element fallback, hover outline cleanup, Escape, mark).
  • Full suite: 4667 pass. The one local failure is ai-catalog "describes no component the spec does not have", which happens because the generated ai/ artifacts are deliberately not committed. CI regenerates them, as it did for [HOLD 3.1] feat(workspace): WorkspacePanel, useWorkspace and ActionCard #523.
  • tsc --noEmit clean, Biome clean on the touched files.

Generated by Claude Code

The workspace beside an assistant's conversation, extracted from Aveiro 2.0:
keyed tabs that open as a preview and switch to the app's real editor,
an open editor that keeps its version across refreshes, a cap on open tabs,
arrow keys and Delete in the tab strip. ActionCard is the card an assistant
answers with: icon, title, status, body and a footer whose primary button
is the proposed write.

Generic over the tab's data, so Aveiro, Sigilio, Tavilio and Stack apps
draw their own previews and editors. Docs page under Modules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtvpR3Lod9g4TL7GsZP
armElementPicker and useElementPicker, extracted from Aveiro 2.0's section
picker: point at a block in a same-origin preview so the next message is
about it. Picks the outermost <section> with its position and heading, or
a single heading, paragraph, image or link on a page without sections.
Clicks don't follow links while armed; Escape cancels; a miss is reported
instead of swallowed. The picked block stays outlined until cleared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtvpR3Lod9g4TL7GsZP
An arrow with a dashed selection box in the accent colour (selectCursor),
set by a style rule over the whole document so links and buttons show it
too, removed on disarm. The cursor option takes any CSS cursor instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtvpR3Lod9g4TL7GsZP
@lorant-one
lorant-one changed the base branch from feat/workspace-panel-action-card to preview November 24, 2026 01:45
@lorant-one
lorant-one merged commit 2ddfd75 into preview Nov 24, 2026
9 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 24, 2026
27 tasks done
@lorant-one lorant-one added the approved label Nov 24, 2026 — with Claude
@lorant-one
lorant-one deleted the feat/workspace-element-picker branch November 29, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants