Skip to content

Paint scoped ::selection ranges for Code OSS and xterm #750

Description

@wieslawsoltes

Active implementation checkpoint — 20 September 2026

Exact upstream heads are WebScene 3cc78ac28101e23f07ded947b44869277da6632d and AppScene acf42662309ea601720ed07c440cf183d7c73fe3; unchanged Code OSS is 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c. Local vscode-demo is 06b5fa4328bae547e40462cbd049b6322f8e8d8e, clean, 294 commits ahead, and intentionally unpushed with Actions disabled.

Focused merge stacks

One-agent mode is enforced. No subagent is active. Reusable runtime behavior continues to land in WebScene or AppScene; unchanged Code OSS remains pinned. The change-related #752 and #753 runs passed. Broad PR CI/NuGet plus consolidation, post-merge main and previous-main runs were canceled to release runners; no WebScene job is intentionally retained between focused PRs. Full package, performance, visual, physical-platform and VM qualification remains deferred under the fast implementation directive; focused parser/native correctness and allocation checks are complete locally.

Next: finish the remaining planned CSS and product features, then physical Linux pixels, synchronization/device-loss/resize/soak/performance, visual comparison, VM/computer-use, and unchanged Code OSS Release qualification. Rich clipboard MIME, MULTIPLE/SAVE_TARGETS, recorded desktop-service/cross-platform work, workspace/Explorer, file/save, terminal, Markdown preview, accessibility, lifecycle, package-size, and no-browser promotion gates remain tracked and incomplete.

Parent selector/CSS trackers: #237, #241, and epic #235

Proven gap

Unchanged Code OSS and bundled xterm/Markdown styles contain global and scoped ::selection rules. WebScene deliberately excludes these rules from ordinary selector indexing, and its existing Window Selection model publishes no retained selection pixels. Text selection therefore lacks the authored foreground/background colors even though Range/text-fragment intersection now exists through #740.

Scope

  • parse global and selector-qualified ::selection rules without creating pseudo DOM nodes;
  • retain the Code OSS property subset: color and background-color, including theme variables, importance, specificity, source/layer order, stylesheet replacement, and scoped origin matching;
  • publish the live Window Selection anchor/focus range through the retained range/text-fragment paint path, normalizing forward/backward endpoints;
  • update on selection mutation, pointer/keyboard selection, style/theme change, detach, navigation, and nested-context teardown;
  • paint backgrounds before ordinary text and selected foreground after it, with zero idle frames and no DOM/visual-tree nodes;
  • keep input/textarea native selection paint as a separate control-specific follow-up if its byte-oriented selection state cannot share the DOM Selection range safely.

Gates

  • browser/native same-node, cross-node, forward/backward, collapsed, scoped/global cascade, custom-property, stylesheet mutation, hidden/detached, nested-context, and cleanup contracts;
  • exact Code OSS/xterm fixture mapping;
  • bounded work against unrelated DOM/rules, mutation coalescing, zero settled frame demand, repeated selection/clear/navigation memory stability, scene commands, and visual comparison.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestvscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions