Repository navigation
feat(web): honor EditorConfig tab widths and show whitespace - #15286
AndreiShenets wants to merge 19 commits into
Conversation
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a substantial cross-layer code-view feature rather than a small isolated change, including new EditorConfig parsing, hosted configuration reads, DOM decoration, editor remount behavior, and Git path metadata plumbing. It also introduces a new persisted product setting with a default, so human review is required. You can add or adjust custom eligibility rules. Learn more. |
…tespace # Conflicts: # apps/web/package.json # pnpm-lock.yaml
|
Note Written by Thanks for working on EditorConfig support and whitespace inspection. Although your description links scope approval, this PR changes 2,685 lines across 38 files, beyond the size we can take over from an unvouched contributor under our limited review capacity. Right now we are only taking focused bug fixes from outside contributors. Please preserve the incorrect tab-width report in #11076 and discuss a smaller defect-only fix there for reconsideration. |
Extract the diff.relative correction and its regression coverage from pingdotgg#15286. Related to pingdotgg#11076; this fix is independently cherry-pickable.
Extract snapshot read correctness from pingdotgg#15286. Related to pingdotgg#11076; this fix is independently cherry-pickable. Correct the stale test import left by the provider package move.
Split EditorConfig resolution and viewer integration from pingdotgg#15286, with its parser, snapshot caching, repository-root plumbing, and editor state regression coverage. Related to pingdotgg#11076. Whitespace markers and their setting are isolated on feat/show-whitespace.
Split the default-off display setting and whitespace decorations from pingdotgg#15286. Preserve text, native selection, and editable-row updates. Move the native editor selection regression cases into a whitespace-only suite. Related to pingdotgg#11076; independent of EditorConfig support.
Problem
Code viewers use a fixed tab width of 2 instead of the file's EditorConfig settings, and invisible whitespace makes mixed indentation and trailing spaces difficult to inspect.
Fixes #11076.
Change
.editorconfig:tab_widthtakes precedence overindent_size, with a fallback of 2. Honor inherited sections,root, andunset.repositoryRootin existing Git status/preview responses so EditorConfig lookup uses the correct base for nested projects, repositories without remotes and worktrees.diff.relative=true.Scope and approval
juliusmarminge approved this direction and scope. This covers the shared web viewers used by web and desktop; mobile is deferred per that approval.
Verification
Focused checks on Windows with Node 24.21.0. Upstream
mainat71dbaf1f9merged without conflicts in388aff13a:**traversal, adjacent numeric ranges and one-megabyte bounds without numeric expansion or backtracking.fileEditorFocus.test.tsx,fileEditorVirtualization.test.ts,codeWhitespace.test.tsandcodeViewTabWidths.test.ts, including selection/caret, draft/focus and decoration geometry coverage.vp test run apps/server/src/vcs/GitVcsDriverCore.test.ts apps/server/src/git/GitManager.test.ts -t "returns the diff path root without a remote|local status exposes the repository root|loads repository-relative files from a nested project directory"— 4 passed.diff.relativeon/off in patch and numstat output.An isolated Edge pass at
d85210779verified computed tab widths of 2, 4 and 8 for the same source/layout, settings search and off/on behavior in file and split-diff views. Native editing and saving of a grammarless file retained actual tabs, repeated spaces and trailing spaces with marks both off and on, without marker-glyph substitutions.Selection/caret across toggles and draft/focus across config changes are covered by automated tests, not established by this browser pass. Native desktop, checkpoint/PR viewers and remote/relay connections were not manually exercised. No video was captured.
Screenshots
Matching off/on pairs captured at
d85210779:Same-source, same-layout configuration comparison at
d85210779, not an old-checkout baseline:unset)Evidence is hosted on GitHub; no PR-only assets are committed.
Models: GPT-6 Astra and GPT-6.1 Sol. Harness: OpenCode.
Closes discussions