Skip to content

fix(pixel): keep selection actions within the current draft capacity - #5535

Closed
tang-vu wants to merge 1 commit into
Osmantic:public-betafrom
tang-vu:feat/beta-selection-draft-capacity-20260916
Closed

tang-vu wants to merge 1 commit into
Osmantic:public-betafrom
tang-vu:feat/beta-selection-draft-capacity-20260916

Conversation

@tang-vu

@tang-vu tang-vu commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Evaluate each selected-passage action using its full prompt wrapper, the existing composer separator rules, and the actual 16,384-character page limit. Disable only actions that would overflow, explain how to recover, and recompute as the draft changes. Exact fits and slash-command replacement remain available.

Why this matters

Selecting text in an assistant reply and choosing Explain/Tone can currently append onto a nearly full draft and make it unsendable. The selection-length guard only bounds the passage itself; it never accounts for the existing draft or generated wrapper.

Behavioral invariant: A selection action never makes the composer exceed its page limit, silently truncates a passage, discards the existing draft, or consumes the selection when insertion is unavailable.

Overlap check

Searched all states for selected text capacity, selection composer limit and PixelSelectionActions length, plus PixelSelectionActions.jsx/Pixel.jsx history. #4445 concerns touch selection events. #4951 protects prompt/file insertion and #5494 advice insertion; neither passes draft capacity into the separate selected-passage toolbar. This retains their independent entry boundaries and the same shared separator semantics. Batch #5531 changes only Markdown code rendering in Pixel.jsx.

Production/test paths: ods/extensions/services/dashboard/src/components/PixelSelectionActions.jsx, ods/extensions/services/dashboard/src/pages/Pixel.jsx, ods/extensions/services/dashboard/src/pages/Pixel.selection-capacity.test.jsx. The original main was fast-forwarded from verified upstream before branching; the explicitly requested target is public-beta at 3c186f3f12ba21dad7b7266ec5449393529abb00.

Regression and validation

Exact candidate: 239f0ee45733790745629ff9ea10c3e6dd3043b0.

  • npx vitest run src/pages/Pixel.selection-capacity src/components/PixelSelectionActions --maxWorkers=4: 7 passed on Windows Node 24.14.1. 2 new public-boundary assertions fail with untouched beta production code, demonstrating the behavior addressed here.
  • Real Pixel page tests restore a conversation, select response text and check full drafts, exact-fit wrappers, longer disabled actions, editing recovery, slash replacement and composer focus. Existing mouse/touch selection tests remain green.
  • Focused ESLint (no errors), Vite production build, git diff --check, and changed-file secret/private-key/large-file hooks pass.
  • The exact unchanged beta baseline already passed 1,232 dashboard tests, full lint and build. Linux baseline make lint, smoke and simulation passed. Full gate remains limited by two existing no-sudo Docker assertions under root; BATS has five baseline WSL/root/disk-space failures. Full-tree hooks also find dummy private-key fixtures and missing Windows awk. These are not represented as successful runtime gates.
  • Current-head CI and the synthetic batch integration are being monitored; final receipts will be added. No installed model, GPU, hardware fleet or live service qualification is claimed.

Compatibility and review

Uses the same JavaScript character counting as the composer. This does not change backend token limits or claim that 16,384 characters always fit model context. No persisted schema or automatic submission; revert restores the previous unbounded selection action.

Implementation and relevant local checks are complete, so this PR is Ready for review immediately. Independent review remains outstanding. No upstream merge or deployment is authorized by this PR.

Codex assisted with implementation and validation.

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