-
Notifications
You must be signed in to change notification settings - Fork 36.8k
Refactor border radius for inline edit components #283057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the border radius values across inline edit components to improve design consistency. The main approach is to introduce a shared constant (INLINE_EDITS_BORDER_RADIUS = 3) exported from theme.ts and a corresponding CSS variable (--inline-edit-border-radius: 3px) to replace hardcoded 4px values throughout the codebase.
Key changes:
- Introduced a centralized border radius constant (3px) in TypeScript and CSS
- Replaced hardcoded
4pxborder radius values with the new constant across 9 view files - Updated the stylelint configuration to recognize the new CSS variable
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/view.css |
Defines CSS variable --inline-edit-border-radius: 3px and replaces hardcoded values in gutter indicator and character insert styles |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.ts |
Exports INLINE_EDITS_BORDER_RADIUS = 3 constant for use in TypeScript files |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.ts |
Changes border radius from 4 to 6 (inconsistent with other changes); splits padding into top/bottom only |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordReplacementView.ts |
Replaces four instances of hardcoded '4px' with template string using INLINE_EDITS_BORDER_RADIUS |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsWordInsertView.ts |
Replaces three instances of hardcoded '4px' with the new constant |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsSideBySideView.ts |
Assigns local BORDER_RADIUS constant to use INLINE_EDITS_BORDER_RADIUS |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.ts |
Replaces four instances of border radius values with the new constant |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsInsertionView.ts |
Assigns local BORDER_RADIUS constant to use INLINE_EDITS_BORDER_RADIUS |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsDeletionView.ts |
Assigns local BORDER_RADIUS constant to use INLINE_EDITS_BORDER_RADIUS |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsCustomView.ts |
Replaces hardcoded '4px' with template string using INLINE_EDITS_BORDER_RADIUS |
src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.ts |
Replaces two instances of hardcoded '4px' with the new constant |
build/lib/stylelint/vscode-known-variables.json |
Registers --inline-edit-border-radius as a known CSS variable for stylelint validation |
| import { jumpToNextInlineEditId } from '../../../../controller/commandIds.js'; | ||
|
|
||
| const BORDER_RADIUS = 4; | ||
| const BORDER_RADIUS = 6; |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change increases the border radius from 4 to 6, which is inconsistent with the PR's goal of reducing border radius to 3px for consistency. Consider changing this to use INLINE_EDITS_BORDER_RADIUS (which is 3) instead of hardcoding 6, or if this component intentionally needs a different border radius, add a comment explaining why it differs from the standard.
...ns/browser/view/inlineEdits/inlineEditsViews/longDistanceHint/inlineEditsLongDistanceHint.ts
Outdated
Show resolved
Hide resolved
benibenj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I extracted the border radius into a const so it's easier to tweak in the future. Also, I undid the padding change for the long distance preview editor. We can't just change the padding in the widget to be applied only vertically as these paddings are part of the layout computation. If you'd like to make that change you'll need to split previewEditorMargin into a horizontal and vertical constant.
|
@benibenj thanks for explaining - I will take a look at that later, it wasn't high priority & I don't want to break anything! |
Reduce the border radius for various inline edit components from 4px to 3px to achieve a more consistent design.
Addresses #272928