Skip to content

fix: Fix bug that could cause unneeded scrollbars to appear when deserializing workspace comments - #10424

Merged
gonfunko merged 1 commit into
mainfrom
ws-comment-serialization
Sep 10, 2026
Merged

fix: Fix bug that could cause unneeded scrollbars to appear when deserializing workspace comments#10424
gonfunko merged 1 commit into
mainfrom
ws-comment-serialization

Conversation

@gonfunko

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10416

Proposed Changes

This PR fixes a bug that caused workspace comments that were serialized without a scrollbar to display one when deserialized. Previously, deserialization set the comment's text before its bounds. Therefore, if the comment's text was (a) too large to fit in a default-sized workspace comment and (b) wider than the comment's serialized bounds minus the size of the scroll gutters, deserialization would:

  1. Load the text on a default-sized comment, displaying scrollbars, because the text was too wide to fit in the default comment bounds
  2. Resize the comment to the serialized bounds; since the text was wider than the comment's saved width minus the width of the scroll gutter, and the scrollbar was already showing because of step 1, the scrollbar would not disappear.

Inverting the order to set the bounds first and then the text when deserializing fixes this, because the text is narrow enough to fit without scrollbars as long as the scrollbar isn't already showing.

Reason for Changes

Serializing and deserializing a workspace should give identical results.

@gonfunko
gonfunko requested a review from a team as a code owner September 10, 2026 21:32
@gonfunko
gonfunko requested a review from lizschwab September 10, 2026 21:32
@github-actions github-actions Bot added the PR: fix Fixes a bug label Sep 10, 2026
@gonfunko
gonfunko merged commit 673eddb into main Sep 10, 2026
11 checks passed
@gonfunko
gonfunko deleted the ws-comment-serialization branch September 10, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unnecessary scroll bar when loading workspace comments

2 participants