Skip to content

view!: selectable text and inline links - #99

Merged
1bye merged 6 commits into
mainfrom
codex/view-text-links-87
Nov 22, 2026
Merged

1bye merged 6 commits into
mainfrom
codex/view-text-links-87

Conversation

@1bye

@1bye 1bye commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Paragraphs and headings can opt into text selection with select-text or a literal class="select-text". <a href> works inside and outside paragraphs, with named Link nodes, retained keyboard focus, Enter activation, and pointer targets over the actual wrapped text runs. Dragging selects without following the link, and copy preserves painted text and whitespace.

Single-slash app paths use the current window's router. HTTP(S), mailto and tel use open_url; protocol-relative URLs, whitespace/control characters, backslashes and other schemes are rejected on native and Web. Link and selection styling use the existing semantic primary/selection tokens. Base owns selection; its small adapter and copy changes are recorded in vendor/gpui-base/RAKE-PATCH.md.

Adds the link-name lint and generated guides, parser/href/interaction regressions, a selectable linked paragraph and standalone link in the view example, and updates docs/view.md.

Review follow-up

  • Inline links repeated by a loop require explicit stable IDs. The macro and view-loop-index-id lint both diagnose omissions, including under nested styling and control flow.
  • The first rendered router owns app-path links for its window until close. The bridge keeps one registration per window and logs the href and error on route decode or navigation failure.

Release hold: rake-ui must not be published until gpui-base ships these APIs and Rake upgrades. Cargo publishing is disabled for rake-ui in the meantime. The gpui-base 0.10.0 patch is prepared locally. Whitespace-preserving copy remains a separate proposal.

Review follow-up verification passed on macOS: rake format --check, rake lint (787 files, zero diagnostics), rake-view-syntax tests, rake-ui and rake-app library/view tests, all 70 CLI lint tests, and strict Clippy for the three affected library crates. The Rake UI and app crates also passed a Wasm target check.

Closes #87

Validation:

  • Worktree-built rake-app-cli; all 49 lint unit tests passed, including the new rule and generated-artifact checks.
  • cargo test -p rake-view-syntax --lib: 27 passed.
  • cargo test -p rake-ui --features test-support --lib: 12 passed, including key-up duplication, wrapped-row activation, drag-versus-click, styled-run copy, whitespace, and visible-only truncated copy.
  • Scoped native rake-view --features devtools build and worktree CLI Web build passed. No toolchain/package installs; an existing matching wasm-bindgen binary was used.
  • Ran the example on this Mac and drove it through rake ctl: accessible names, managed focus, Tab focus in a rendered capture, focus background, pointer/keyboard dispatch, theme switching, and exact 92-character native clipboard contents.
  • Rendered the Web bundle in light and dark; verified wrapped-row clicks, one activation per Enter, drag suppression, and exact copy payloads for Command-C and Control-C. Browser URL/clipboard API calls were intercepted for assertions.
  • rake format on changed Rust files and --check passed; worktree-built rake lint checked 787 files with zero diagnostics. Full workspace builds were left to CI.

Limits of verification:

  • Browser clipboard readback timed out; the exact navigator.clipboard.writeText payload was verified instead. Native clipboard readback passed.
  • The existing Web canvas DOM accessibility snapshot exposes its IME input rather than the GPUI semantic tree. Native and Rake inspection Link roles/names were verified; browser screen-reader behavior is not established.
  • The root-only view example uses external links. App-path classification and route callback dispatch are tested, but real router history changes were not manually exercised through a link.

The target directory was deleted after builds. The worktree and verification logs remain locally. This PR is draft and must not be merged automatically.

🤖 Generated with Claude Code

1bye and others added 6 commits November 21, 2026 09:29
Closes #87

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep retained link focus tied to stable keys and give each window one router. Hold rake-ui publishing until its selectable text APIs ship upstream.
@1bye
1bye marked this pull request as ready for review November 22, 2026 12:40
@1bye
1bye merged commit 34f517a into main Nov 22, 2026
11 checks passed
1bye added a commit that referenced this pull request Nov 22, 2026
Resolves overlaps with the secrets API dependencies (#98) and the
link and selection view tests (#99).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

view!: selectable text and inline links

1 participant