Skip to content

Adding widthInEm field to injected text options - #332340

Draft
Aiday Marlen Kyzy (aiday-mar) wants to merge 23 commits into
mainfrom
elated-minnow
Draft

Adding widthInEm field to injected text options#332340
Aiday Marlen Kyzy (aiday-mar) wants to merge 23 commits into
mainfrom
elated-minnow

Conversation

@aiday-mar

Copy link
Copy Markdown
Contributor

wip

Establish stable dark and light visual baselines for color decorators and inline progress before changing injected text width handling.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allow focused wrapping tests to supply injected text without changing existing test behavior.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove focus-dependent current-line highlighting so fixture hashes remain stable across clean explorer sessions.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Thread optional injected-text width metadata through decoration normalization and line parts without changing wrapping or rendered output. The ordinary decoration path avoids allocating width storage when no fixed width is present.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cover wrapping width, atomic multi-character injections, and rendering through a width-enforcing wrapper that preserves decorated token spans.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Exercise fixed-width wrapping through the real DOM line-break computer and use registered editor contribution metadata in the existing visual fixtures.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Force the proportional-font fixture through the DOM line-break computer so it validates atomic fixed-width wrapping rather than the monospace fallback.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Treat widthInEm injections as atomic in both monospace and DOM line-break computation and enforce the width on the existing flat renderer span. Reject custom tokens with fixed widths and retain the unchanged fast path for ordinary lines.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Declare the existing 1em inline progress placeholder width for wrapping. Its computed geometry and component fixture screenshot remain unchanged.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Express the existing rounded pixel spacer width relative to the editor font so wrapping reserves the same width that CSS already renders.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reserve the existing 1.2em occupied width while retaining the original 0.8em square and margins. Dark and light component fixture hashes remain identical.

Fixes #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cover adjacent and oversized atomic injections, render the real padded inlay hint contribution in component fixtures, and add approved dark/light visual expectations for all fixed-width scenarios.

Refs #32856

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 24, 2026 14:55
@aiday-mar
Aiday Marlen Kyzy (aiday-mar) marked this pull request as draft August 24, 2026 14:56
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 584b2dac Current: a0ae3c9a

Added (8)

editor/injectedTextDecorations/ColorDecorators/Dark

current

editor/injectedTextDecorations/ColorDecorators/Light

current

editor/injectedTextDecorations/SelectedColorDecorator/Dark

current

editor/injectedTextDecorations/SelectedColorDecorator/Light

current

editor/injectedTextDecorations/InlineProgress/Dark

current

editor/injectedTextDecorations/InlineProgress/Light

current

editor/injectedTextDecorations/InlayHints/Dark

current

editor/injectedTextDecorations/InlayHints/Light

current

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 atomic widthInEm support for injected editor text, including wrapping, rendering, and component fixtures.

Changes:

  • Propagates fixed-width metadata through editor projection and rendering.
  • Migrates color decorators, inlay spacing, progress, and breakpoint placeholders.
  • Adds unit and visual coverage for fixed-width injected text.
Show a summary per file
File Description
src/vs/workbench/test/browser/componentFixtures/fixtureUtils.ts Supports visual descriptions.
src/vs/workbench/test/browser/componentFixtures/editor/injectedTextDecorations.fixture.ts Adds injected-text fixtures.
src/vs/workbench/contrib/debug/test/browser/breakpoints.test.ts Tests breakpoint width.
src/vs/workbench/contrib/debug/browser/media/debug.contribution.css Removes CSS width.
src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts Sets breakpoint width metadata.
src/vs/editor/test/common/viewModel/monospaceLineBreaksComputer.test.ts Tests fixed-width wrapping.
src/vs/editor/test/common/viewModel/lineBreakData.test.ts Tests option validation.
src/vs/editor/test/common/viewModel/inlineDecorations.test.ts Tests width projection.
src/vs/editor/test/common/viewLayout/viewLineRenderer.test.ts Tests rendered spans.
src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts Tests projected decorations.
src/vs/editor/test/browser/view/domLineBreaksComputer.test.ts Adds DOM wrapping tests.
src/vs/editor/standalone/browser/colorizer.ts Supplies empty width metadata.
src/vs/editor/contrib/stickyScroll/browser/stickyScrollWidget.ts Renders fixed-width parts.
src/vs/editor/contrib/inlineProgress/browser/inlineProgressWidget.css Removes CSS width.
src/vs/editor/contrib/inlineProgress/browser/inlineProgress.ts Sets progress width metadata.
src/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.ts Updates renderer arguments.
src/vs/editor/contrib/inlayHints/browser/inlayHintsController.ts Adds fixed-width hint spacing.
src/vs/editor/contrib/colorPicker/browser/colorPicker.css Refactors decorator sizing.
src/vs/editor/contrib/colorPicker/browser/colorDetector.ts Defines fixed swatch width.
src/vs/editor/common/viewModel/viewModelLines.ts Updates line data construction.
src/vs/editor/common/viewModel/viewModelImpl.ts Propagates width decorations.
src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts Accounts for fixed widths.
src/vs/editor/common/viewModel/modelLineProjection.ts Projects fixed-width parts.
src/vs/editor/common/viewModel/inlineDecorations.ts Introduces fixed-width decorations.
src/vs/editor/common/viewModel.ts Extends view-line data.
src/vs/editor/common/viewLayout/viewLineRenderer.ts Renders atomic-width spans.
src/vs/editor/common/viewLayout/linePart.ts Adds width metadata.
src/vs/editor/common/modelLineProjectionData.ts Computes injected-text ranges.
src/vs/editor/common/model/textModel.ts Stores and validates width options.
src/vs/editor/common/model.ts Declares widthInEm.
src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines.ts Updates renderer arguments.
src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.ts Updates renderer arguments.
src/vs/editor/browser/viewParts/viewLines/viewLine.ts Passes fixed-width decorations.
src/vs/editor/browser/view/domLineBreaksComputer.ts Supports DOM-based fixed-width wrapping.
src/vs/editor/browser/controller/editContext/native/screenReaderContentRich.ts Passes fixed-width decorations.
build/lib/stylelint/vscode-known-variables.json Updates CSS variable allowlist.

Review details

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

  • Files reviewed: 36/36 changed files
  • Comments generated: 6
  • Review effort level: Balanced

Comment thread src/vs/editor/common/model/textModel.ts Outdated
Comment thread src/vs/editor/common/viewLayout/viewLineRenderer.ts Outdated
Comment thread src/vs/editor/common/viewLayout/viewLineRenderer.ts Outdated
Comment thread build/lib/stylelint/vscode-known-variables.json Outdated
Comment thread src/vs/editor/test/browser/view/domLineBreaksComputer.test.ts Outdated
Comment thread src/vs/editor/common/modelLineProjectionData.ts Outdated
@aiday-mar Aiday Marlen Kyzy (aiday-mar) changed the title Adding widthInEm field to injected text options 3 Adding widthInEm field to injected text options Aug 24, 2026
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