You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(toc): prevent right ToC from shrinking; enforce 250px min width (#14872)
fix(toc): prevent right ToC from shrinking; enforce 250px min width
Context
- Right-hand ToC width (set to 250px) was shrinking in the flex layout
between the 'toc' breakpoint (1490px) and the ultra-wide breakpoint
(2057px), especially visible when Session Replay UI alters available
width.
- Additionally, some pages had extremely long, unbroken content inside
code blocks (e.g., long URLs/paths/tokens). When code options changed,
these long lines could expand the content column and indirectly squeeze
the ToC.
Changes
- ToC: Make the <aside> a non-shrinking flex item and enforce a minimum
width.
- Updated `src/components/docPage/index.tsx` ToC aside classes from
`hidden toc:block w-[250px]` to `hidden toc:block flex-none w-[250px]
min-w-[250px]`.
- Code wrapping: Wrap long lines inside code blocks so they don’t expand
layout.
- Updated `src/components/codeBlock/code-blocks.module.scss` to apply:
- `white-space: pre-wrap;`, `word-break: break-word;`, `overflow-wrap:
anywhere;` on `pre` and `pre[class*='language-']`.
- Same wrapping rules on `.code-line` to preserve highlight behavior.
- `max-width: 100%;` and `tab-size: 2;` on `pre`.
- Main content flex: Allow the main content column to shrink within the
flex layout.
- Added `min-w-0` to the `#doc-content` container in
`src/components/docPage/index.tsx`.
Result
- When the ToC is visible, it remains a fixed 250px and does not
compress due to layout shifts.
- Long code no longer forces the content area to expand; lines wrap
within the available width.
- Existing responsive behavior remains unchanged: ToC hidden below the
`toc` breakpoint; pinned/fixed layout ≥2057px.
Files
- `src/components/docPage/index.tsx`
- `src/components/codeBlock/code-blocks.module.scss`
0 commit comments