refactor(ui): update the UI of the code file#1826
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d0ed0f69c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| useEffect(() => { | ||
| if (containerRef.current && leftWidth === null) { | ||
| setLeftWidth(containerRef.current.offsetWidth * DEFAULT_LEFT_WIDTH_PERCENT) | ||
| } |
There was a problem hiding this comment.
Recalculate left panel width when container resizes
This width is only initialized once (when leftWidth is null), so after the initial render the left panel stays at a fixed pixel width even if the viewport/container width changes (e.g., the user resizes the browser or sidebars collapse). That’s a regression from the previous percentage-based layout: the left panel can exceed the intended max percentage and the right panel can end up narrower than MIN_RIGHT_WIDTH, leading to cramped or hidden code content on narrower windows. Consider listening for resize (or using a ResizeObserver) to recompute/clamp leftWidth whenever the container width changes.
Useful? React with 👍 / 👎.
code部分查看代码宽度可拖动