Skip to content

Feature/texta selection - #53

Merged
frouaix merged 8 commits into
mainfrom
feature/texta-selection
Jul 19, 2026
Merged

frouaix merged 8 commits into
mainfrom
feature/texta-selection

Conversation

@frouaix

@frouaix frouaix commented May 2, 2026

Copy link
Copy Markdown
Owner

Description

Brief description of changes.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Build/tooling change

Validation

  • pnpm build passes
  • pnpm build:examples passes
  • Manual verification completed (if applicable)

Checklist

  • Code follows project conventions
  • Documentation updated if needed
  • No unrelated changes included

Copilot AI review requested due to automatic review settings May 2, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds selection-geometry support for custom blocks so the GUI text-selection system can work with texta() blocks (in addition to regular text()), and provides a demo/debug page plus a regression test.

Changes:

  • Extend the custom block registry API with getSelectionGeometry and wire it into the GUI CharacterBoundsAdapter.
  • Implement getSelectionGeometry for texta() by computing per-unit character bounds as part of texta layout.
  • Add a Texta selection debug demo page, update navigation/docs, and add a Vitest regression test.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/texta/test/vitrine-selection.test.ts Adds a regression test asserting selection bounds work for both text() and texta() blocks.
packages/texta/src/vitrine.ts Implements Texta selection geometry and refactors layout to include per-unit bounds.
packages/gui/src/selection/character-bounds-adapter.ts Adapts selection bounds extraction to include custom blocks via the block registry.
packages/core/src/core/block-registry.ts Adds CustomBlockSelectionApi / CustomBlockSelectionGeometry and getSelectionGeometry handler hook.
packages/core/src/index.ts Re-exports the new selection-related registry types.
packages/demo/vite.config.ts Registers a new demo entrypoint for Texta selection debugging.
packages/demo/text-selection-debug.html Updates navigation to link to the new Texta debug page.
packages/demo/text-selection-debug-texta.html New Texta selection debug page.
packages/demo/text-selection-debug-texta.css Styling for the new Texta selection debug page.
packages/demo/text-selection-debug-texta-setup.js Mounts the debug component and logs hit-test/selection info.
packages/demo/text-selection-debug-texta-scene.js Builds a scene of varied texta() blocks to stress selection/hit-testing.
packages/demo/component-demo.html Clarifies the existing text selection debug link label.
docs/TEXT_SELECTION_REGULAR_TEXT.md Updates scope docs to include custom-block selection geometry (including Texta).
Comments suppressed due to low confidence (1)

packages/texta/src/vitrine.ts:9

  • measureText and calculateTextOffset are imported from vitrine but no longer used in this module. With noUnusedLocals/linting enabled this will fail CI; please remove the unused imports (or switch back to using them).
import {
  customBlock,
  registerBlockType,
  measureText,
  calculateTextOffset,
  SF_TEXT_ADVANCE_APPROX_DEFAULT
} from 'vitrine';

Comment thread packages/texta/src/vitrine.ts
Comment thread packages/texta/src/vitrine.ts Outdated
Comment thread packages/texta/src/vitrine.ts Outdated
frouaix and others added 2 commits July 18, 2026 19:23
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Comment thread packages/texta/src/vitrine.ts
Comment thread packages/texta/src/vitrine.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Comment thread packages/texta/src/vitrine.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@frouaix
frouaix merged commit 14f38e3 into main Jul 19, 2026
3 checks passed
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