-
Notifications
You must be signed in to change notification settings - Fork 74
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
fix: show at most one decoration per line #598
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.
A test would be nice!
src/extension.ts
Outdated
@@ -675,25 +675,23 @@ export class Extension implements RunHooks { | |||
activeDecorations.push({ range: location.range }); | |||
} | |||
|
|||
const completedDecorations: vscodeTypes.DecorationOptions[] = []; | |||
const completedDecorations: Record<number, vscodeTypes.DecorationOptions> = {}; | |||
for (const { location, duration } of completed) { | |||
if (uriToPath(location.uri) === uriToPath(editor.document.uri)) { |
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.
drive-by I would pre-compute the editor's uri instead of doing it 1000 times. Maybe even store decorations by line from the get go.
the previous PR already added a good test: playwright-vscode/tests/decorations.spec.ts Lines 90 to 111 in a95208d
|
Follow-up to #590.
Instead of capping the number of decorations per file, we now show at most one decoration per line. This still places a good upper limit so we don't overwhelm VS Code rendering with too many decorations. But it also prevents the confusing UI of decorations abruptly cutting off.
Screen.Recording.2025-01-17.at.10.32.07.mov