Skip to content

fix(canvas): refine lasso toolbar, session picker, and selection stability - #288

Merged
Liangwei Wang (LiangweiOIO) merged 2 commits into
mainfrom
fix/lasso-selection-ux
Oct 10, 2026
Merged

Liangwei Wang (LiangweiOIO) merged 2 commits into
mainfrom
fix/lasso-selection-ux

Conversation

@LiangweiOIO

Copy link
Copy Markdown
Collaborator

Summary

Refine the retained-Lasso workflow introduced in #285 and stabilize selection rendering.

  • Split Lasso controls into coordinated editing and Agent capsules, add Ink/mixed-selection identity icons, and move Delete into the shared overflow menu.
  • Make the session picker toggle reliably on repeated mouse/touch activation, keep its trigger surface-colored, place Continue conversation before New conversation, subordinate External Agents, and shorten the localized tooltip.
  • Prefetch recent conversations to avoid loading-label flashes. Treat cached/local destinations as previews: Send waits for current server confirmation, while an explicit choice immediately confirms and locks the destination against late responses.
  • Preserve persisted node stacking during Lasso and tolerate viewport corrections smaller than 0.5 screen pixels during grounding capture.
  • Stabilize Note text compositing when selection enables native scrolling, eliminating low-zoom text jumps without changing geometry or scroll ownership.
  • Update current architecture documentation and the proposal lifecycle reference.

Review fixes

  • Reproduced and fixed a race where a background recency response could replace the target during grounding preparation and cancel an enabled submission.
  • Reproduced Send overflowing a 360px viewport by 25px; capsules now wrap according to their combined content width rather than a fixed mobile breakpoint.

Validation

  • 111 focused unit tests passed across destination/picker, grounding, selection-order, toolbar, and shared Agent-menu suites.
  • All 6 Ink toolbar browser tests passed, including click/tap toggle, keyboard focus, retained-selection destination behavior, and English/Chinese layouts at 320, 359, 360, 375, 390, 414, 768, and 1100px.
  • 6 additional browser tests passed for Note scroll ownership, Text selection geometry, and exact Note content-pixel stability across select/deselect at 25%, 51%, and 100% zoom.
  • Repository pnpm typecheck, pnpm format, pnpm check:i18n, and git diff --check passed.
  • Repository pnpm lint:fix encountered 5 pre-existing no-undef errors in the Git-ignored local file tmp/dev-ipad.mjs, which is not included in this PR. Re-running with pnpm lint:fix --ignore-pattern tmp/dev-ipad.mjs passed, with existing repository warnings. The files changed by the review fixes also passed zero-warning targeted ESLint.

Scope

Existing local Tailnet development-proxy changes are deliberately excluded. No new API contract, dependency, or storage migration is introduced. Browser validation uses Chromium; real iPad Safari and large-Note GPU memory behavior were not revalidated in this pass.

…ility

Preview cached destinations without enabling Send until server confirmation, preserve explicit targets against late responses, and wrap toolbar groups by available width. Keep Lasso stacking and grounding stable and prevent Note text raster shifts on selection.

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.

🟡 Changes recommended

Toolbar wrapping uses viewport width rather than the narrower canvas boundary, allowing overlap with adjacent panels.

1 open finding
What changed in this PR

Refines retained-Lasso controls, destination selection, stacking stability, and Note rendering.

Changes:

  • Splits editing and Agent controls with responsive wrapping and improved menus.
  • Adds safe destination prefetch/confirmation and viewport-tolerant grounding.
  • Stabilizes Lasso z-order and Note text compositing with regression coverage.
File Description
docs/​proposals/​ink-lasso-question-flow.md Updates proposal lifecycle status.
docs/​architecture/​web-architecture.md Documents Lasso stacking behavior.
docs/​architecture/​sketch-node.md Documents toolbar and destination behavior.
docs/​architecture/​note-node.md Documents compositing stability.
docs/​architecture/​canvas-input-interactions.md Documents shared menu styling.
apps/​web/​src/​i18n/​resources/​zh-CN/​common.json Adds Chinese toolbar labels.
apps/​web/​src/​i18n/​resources/​en/​common.json Adds English toolbar labels.
apps/​web/​src/​components/​Panels/​ChatPanel/​agentMenu.tsx Supports subordinate Agent headings.
apps/​web/​src/​components/​Panels/​ChatPanel/​agentMenu.test.tsx Tests default heading presentation.
apps/​web/​src/​components/​Panels/​Canvas/​selectionZOrder.ts Makes selection elevation optional.
apps/​web/​src/​components/​Panels/​Canvas/​selectionZOrder.test.ts Tests retained forest order.
apps/​web/​src/​components/​Panels/​Canvas/​FloatingToolbars/​useInkConversationDestination.ts Adds preview and confirmation states.
apps/​web/​src/​components/​Panels/​Canvas/​FloatingToolbars/​StrokeSelectionToolbar.tsx Splits toolbar capsules and overflow actions.
apps/​web/​src/​components/​Panels/​Canvas/​FloatingToolbars/​StrokeSelectionToolbar.test.tsx Expands destination and toolbar tests.
apps/​web/​src/​components/​Panels/​Canvas/​FloatingToolbars/​NodeToolbar.css Styles responsive Lasso capsules.
apps/​web/​src/​components/​Panels/​Canvas/​FloatingToolbars/​inkQuestionSubmission.ts Adds viewport stability tolerance.
apps/​web/​src/​components/​Panels/​Canvas/​FloatingToolbars/​inkQuestionSubmission.test.ts Tests viewport correction thresholds.
apps/​web/​src/​components/​Panels/​Canvas/​FloatingToolbars/​InkAgentDestinationPicker.tsx Reorders sections and fixes toggling.
apps/​web/​src/​components/​Panels/​Canvas/​FloatingToolbars/​InkAgentDestinationPicker.test.tsx Tests picker hierarchy and interaction.
apps/​web/​src/​components/​Panels/​Canvas/​CanvasToolbar.tsx Reuses shared menu styles.
apps/​web/​src/​components/​Panels/​Canvas/​CanvasToolbar.test.tsx Verifies resource-menu styling.
apps/​web/​src/​components/​Panels/​Canvas/​Canvas.tsx Disables elevation during Lasso.
apps/​web/​src/​components/​Nodes/​note/​noteScrollbar.css Stabilizes Note compositing.
apps/​web/​e2e/​production-selection-resize.spec.ts Tests selection pixel stability.
apps/​web/​e2e/​ink-toolbar.spec.ts Tests picker and responsive layouts.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

justify-content: center;
gap: 8px;
width: max-content;
max-width: calc(100vw - 16px);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in dbcde3f. CanvasFloatingPopover now exposes --canvas-popover-available-width using Floating UI size middleware with the same canvas boundary/padding as flip and shift. The Lasso container caps its width to that value, and the destination trigger reserves room for capsule chrome and Send. Added English/Chinese browser regressions with an unchanged 1100px viewport and an offset canvas resized 800 → 320 → 280 → 800px; the test failed before the fix and now passes. All 12 toolbar browser tests and 71 focused unit tests pass; repository typecheck and formatting pass. Repository lint remains blocked only by the previously noted ignored local tmp/dev-ipad.mjs; excluding that file passes. No ChatPanel layout or behavior changes.

Expose Floating UI available width to wrapping controls and reserve space for Send. Cover an offset canvas resizing independently from the browser viewport in both locales.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LiangweiOIO
Liangwei Wang (LiangweiOIO) merged commit ef48105 into main Oct 10, 2026
7 checks passed
@LiangweiOIO
Liangwei Wang (LiangweiOIO) deleted the fix/lasso-selection-ux branch October 10, 2026 05:34
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