Skip to content

Prevent margin from displacing content out of the viewport. - #13153

Open
Perritu wants to merge 2 commits into
continuedev:mainfrom
Perritu:patch-1
Open

Prevent margin from displacing content out of the viewport.#13153
Perritu wants to merge 2 commits into
continuedev:mainfrom
Perritu:patch-1

Conversation

@Perritu

@Perritu Perritu commented Aug 18, 2026

Copy link
Copy Markdown

Prevent code block from expanding the chat webview beyond it's horizontal limits by setting thread message div width to 100vw.

Solves #13056 #13055

Description

Added a css property to force the thread message block to match the viewport witdth.

AI Code Review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

After:

image

Before:

image

Tests

Prevent code block from expanding the chat webview beyond it's horizontal limits by setting thread message div width to 100vw.
@Perritu
Perritu requested a review from a team as a code owner August 18, 2026 02:54
@Perritu
Perritu requested review from sestinj and removed request for a team August 18, 2026 02:54
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Perritu

Perritu commented Aug 18, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@bluemoehre

Copy link
Copy Markdown

In my opinion vw isn't the best unit to use here. There's no guarantee that scrollbars won't take up space and this behavior may vary across OSes and window layouts / panel arrangements. CSS provides better alternatives like dvw and svw, which are designed to handle dynamic viewport changes more reliably.

Additionally, I believe this approach has another flaw: inline padding appears to accumulate (see the linked issues), which causes the inset area to be offset twice.

Remove width: 100vw from thread messages and apply w-screen to the main container to fix chat layout rendering.
@Perritu

Perritu commented Aug 20, 2026

Copy link
Copy Markdown
Author

In my opinion vw isn't the best unit to use here. There's no guarantee that scrollbars won't take up space and this behavior may vary across OSes and window layouts / panel arrangements. CSS provides better alternatives like dvw and svw, which are designed to handle dynamic viewport changes more reliably.

Additionally, I believe this approach has another flaw: inline padding appears to accumulate (see the linked issues), which causes the inset area to be offset twice.

Agreed.
I've modified the PR to align with TW conventions and to use the global chat object instead of the thread-specific one.

@Perritu Perritu changed the title Set thread message width to 100vw Prevent margin from displacing content out of the viewport. Aug 20, 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