Skip to content

fix(web): hide conversation outline when it cannot expand - #1278

Merged
wbxl2000 merged 2 commits into
mainfrom
fix/web-outline-fit
Jul 1, 2026
Merged

fix(web): hide conversation outline when it cannot expand#1278
wbxl2000 merged 2 commits into
mainfrom
fix/web-outline-fit

Conversation

@wbxl2000

@wbxl2000 wbxl2000 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

No linked issue — this is a small robustness fix for the web conversation outline.

Problem

The conversation outline (the rail of bars beside the chat) reveals each query's title on hover/focus, expanding up to 220px of label to the right. The previous guard was a hard-coded @container (max-width: 920px) rule, so between roughly 920px and 1254px of pane width the rail stayed visible but its expanded labels clipped against the right edge of the pane / window.

What changed

ConversationToc.vue now measures the room to the right of the reading column with a ResizeObserver on its positioning container. When the expanded label (240px, including a small buffer) would not fit, the rail is hidden via visibility: hidden rather than being unmounted, so its position keeps getting measured and it reappears automatically once space is available again. This replaces the static container query with a check that tracks the actual layout (reading-column width, docked panels, window resizes).

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. (kimi-web has no component/jsdom test infrastructure — this change is DOM measurement; verified with typecheck + check:style.)
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 42b17b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d00426bd0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +51 to +53
onMounted(() => {
const parent = navRef.value?.offsetParent as HTMLElement | null;
if (!parent) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Re-measure after the TOC becomes visible

When this component mounts while visible is false, such as during sessionLoading, on mobile, or before a conversation has more than one user turn, navRef is null and this early return prevents both the initial measurement and the ResizeObserver setup. If the TOC later becomes visible, fits stays at its default true, so the outline is shown even in the narrow layouts this change is meant to hide. Watch visible/navRef and initialize measurement after the nav is rendered.

Useful? React with 👍 / 👎.

@pkg-pr-new

pkg-pr-new Bot commented Jul 1, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@42b17b9
npx https://pkg.pr.new/@moonshot-ai/kimi-code@42b17b9

commit: 42b17b9

When ConversationToc mounts while hidden (sessionLoading, mobile, or before a second user turn), navRef is null and the ResizeObserver is never set up, so fits stays true and the outline shows even in narrow layouts. Re-initialize the measurement whenever the nav is rendered.
@wbxl2000

wbxl2000 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 42b17b9dc5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@wbxl2000
wbxl2000 merged commit bbda90a into main Jul 1, 2026
9 checks passed
@wbxl2000
wbxl2000 deleted the fix/web-outline-fit branch July 1, 2026 16:44
@github-actions github-actions Bot mentioned this pull request Jul 1, 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.

1 participant