fix(adapter): prevent panel avoidance from over-constraining ChatGPT composer width - #808
Merged
Merged
Conversation
…composer width ChatGPT 2025 redesign nests the composer input area inside #thread, sharing max-w-(--thread-content-max-width) containers (Tailwind v4) with conversation content. The previous broad [class*="thread-content-max-width"] selector matched both thread content and composer wrappers, causing panel avoidance CSS to apply redundant max-width constraints across multiple wrapper layers and collapse the input box horizontally. - Split THREAD_WIDTH_SELECTOR into three independent WidthSelectorConfig entries so :has() failure in one does not cascade to the others - Add :not(:has(form[data-type="unified-composer"])) to thread content and legacy selectors to exclude composer-containing wrappers - Remove dead #composer-background selector (element no longer in DOM)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChatGPT 2025 redesign nests the composer input area inside
#thread, sharingmax-w-(--thread-content-max-width)containers (Tailwind v4) with conversation content. The previous broad[class*="thread-content-max-width"]selector matched both thread content and composer wrappers, causing panel avoidance CSS to apply redundantmax-widthconstraints across multiple wrapper layers and collapse the input box horizontally.Changes
CHATGPT_THREAD_WIDTH_SELECTORinto three independentWidthSelectorConfigentries ingetPanelAvoidanceConfig(). Each selector now generates its own CSS rule — if:has()fails in a browser, only that rule is dropped; the other two survive independently.:not(:has(form[data-type="unified-composer"]))to thread content and legacy selectors, so they exclude composer-containing wrappers while still constraining the composer form directly via a separate selector.#composer-backgroundselector — this element no longer exists in the current ChatGPT DOM.getWidthSelectors()unchanged — page-width mode constrains all thread-content-max-width elements including composer wrappers, which is the correct behavior when no panel is open.Verification
pnpm typecheck— passedpnpm lint:check— no new warningspnpm format:check— passed (unrelatedchatgpt-demo.htmexcluded)