Conversation
There was a problem hiding this comment.
Hey - 我发现了两个问题,并给出了一些整体性的反馈:
LogsPanel中新增的scrollTo({ behavior: 'smooth' })会在每次logs变化时运行;建议只在用户本来就接近底部时才自动滚动,以避免和用户滚动“打架”,并减少在日志快速更新时可能出现的性能问题或卡顿。- 在
ScreenshotPanel中,标题栏仍然是带有role="button"和自定义onKeyDown处理逻辑的div;为了语义更合理,并与ConnectionPanel保持一致,建议将其改为真正的<button>元素,让浏览器自行处理键盘交互。 - 用来协调
background-color和border-radius动画时间的内联transition样式在ScreenshotPanel和ConnectionPanel中是重复的;建议将其提取到一个共享的 class 或 helper 中,以便保持行为一致并让维护更容易。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- The new `scrollTo({ behavior: 'smooth' })` in `LogsPanel` runs on every `logs` change; consider only auto-scrolling when the user is already near the bottom to avoid fighting user scroll and potential performance/jank during rapid log updates.
- In `ScreenshotPanel`, the title bar is still a `div` with `role="button"` and custom `onKeyDown` handling; for better semantics and consistency with `ConnectionPanel`, consider switching this to a real `<button>` element and letting the browser handle keyboard interaction.
- The inline `transition` style for coordinating `background-color` and `border-radius` timing is duplicated between `ScreenshotPanel` and `ConnectionPanel`; consider extracting this into a shared class or helper to keep the behavior consistent and easier to maintain.
## Individual Comments
### Comment 1
<location> `src/components/LogsPanel.tsx:127-128` </location>
<code_context>
{/* 右侧信息面板 */}
{!rightPanelCollapsed && (
<div
- className={`flex flex-col p-3 bg-bg-primary overflow-y-auto overflow-x-hidden border-l border-transparent ${sidePanelExpanded ? 'gap-3' : ''}`}
+ className={`flex flex-col p-3 bg-bg-primary overflow-x-hidden border-l border-transparent ${sidePanelExpanded ? 'gap-3 overflow-y-auto' : 'overflow-hidden'}`}
</code_context>
<issue_to_address>
**issue (bug_risk):** The clickable header `div` isn't keyboard-focusable despite `role="button"` and key handlers.
Because it lacks `tabIndex={0}`, this `div` can’t be reached via keyboard focus, so the key handlers and focus styles won’t actually be usable for keyboard users. Please add `tabIndex={0}` or, preferably, convert it to a semantic `<button>` to ensure consistent, accessible keyboard interaction.
</issue_to_address>
### Comment 2
<location> `src/components/ScreenshotPanel.tsx:509-510` </location>
<code_context>
{/* 右侧信息面板 */}
{!rightPanelCollapsed && (
<div
- className={`flex flex-col p-3 bg-bg-primary overflow-y-auto overflow-x-hidden border-l border-transparent ${sidePanelExpanded ? 'gap-3' : ''}`}
+ className={`flex flex-col p-3 bg-bg-primary overflow-x-hidden border-l border-transparent ${sidePanelExpanded ? 'gap-3 overflow-y-auto' : 'overflow-hidden'}`}
</code_context>
<issue_to_address>
**issue (bug_risk):** The screenshot panel header `div` with `role="button"` is not keyboard-focusable.
This header uses `role="button"`, an `onKeyDown` handler, and focus-visible styles, but without `tabIndex={0}` it can’t be reached via keyboard. Add `tabIndex={0}` or use a `<button>` so the semantics and behavior match and keyboard users can see and use the focus state.
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've found 2 issues, and left some high level feedback:
- The new
scrollTo({ behavior: 'smooth' })inLogsPanelruns on everylogschange; consider only auto-scrolling when the user is already near the bottom to avoid fighting user scroll and potential performance/jank during rapid log updates. - In
ScreenshotPanel, the title bar is still adivwithrole="button"and customonKeyDownhandling; for better semantics and consistency withConnectionPanel, consider switching this to a real<button>element and letting the browser handle keyboard interaction. - The inline
transitionstyle for coordinatingbackground-colorandborder-radiustiming is duplicated betweenScreenshotPanelandConnectionPanel; consider extracting this into a shared class or helper to keep the behavior consistent and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `scrollTo({ behavior: 'smooth' })` in `LogsPanel` runs on every `logs` change; consider only auto-scrolling when the user is already near the bottom to avoid fighting user scroll and potential performance/jank during rapid log updates.
- In `ScreenshotPanel`, the title bar is still a `div` with `role="button"` and custom `onKeyDown` handling; for better semantics and consistency with `ConnectionPanel`, consider switching this to a real `<button>` element and letting the browser handle keyboard interaction.
- The inline `transition` style for coordinating `background-color` and `border-radius` timing is duplicated between `ScreenshotPanel` and `ConnectionPanel`; consider extracting this into a shared class or helper to keep the behavior consistent and easier to maintain.
## Individual Comments
### Comment 1
<location> `src/components/LogsPanel.tsx:127-128` </location>
<code_context>
{/* 右侧信息面板 */}
{!rightPanelCollapsed && (
<div
- className={`flex flex-col p-3 bg-bg-primary overflow-y-auto overflow-x-hidden border-l border-transparent ${sidePanelExpanded ? 'gap-3' : ''}`}
+ className={`flex flex-col p-3 bg-bg-primary overflow-x-hidden border-l border-transparent ${sidePanelExpanded ? 'gap-3 overflow-y-auto' : 'overflow-hidden'}`}
</code_context>
<issue_to_address>
**issue (bug_risk):** The clickable header `div` isn't keyboard-focusable despite `role="button"` and key handlers.
Because it lacks `tabIndex={0}`, this `div` can’t be reached via keyboard focus, so the key handlers and focus styles won’t actually be usable for keyboard users. Please add `tabIndex={0}` or, preferably, convert it to a semantic `<button>` to ensure consistent, accessible keyboard interaction.
</issue_to_address>
### Comment 2
<location> `src/components/ScreenshotPanel.tsx:509-510` </location>
<code_context>
{/* 右侧信息面板 */}
{!rightPanelCollapsed && (
<div
- className={`flex flex-col p-3 bg-bg-primary overflow-y-auto overflow-x-hidden border-l border-transparent ${sidePanelExpanded ? 'gap-3' : ''}`}
+ className={`flex flex-col p-3 bg-bg-primary overflow-x-hidden border-l border-transparent ${sidePanelExpanded ? 'gap-3 overflow-y-auto' : 'overflow-hidden'}`}
</code_context>
<issue_to_address>
**issue (bug_risk):** The screenshot panel header `div` with `role="button"` is not keyboard-focusable.
This header uses `role="button"`, an `onKeyDown` handler, and focus-visible styles, but without `tabIndex={0}` it can’t be reached via keyboard. Add `tabIndex={0}` or use a `<button>` so the semantics and behavior match and keyboard users can see and use the focus state.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| <div | ||
| role="button" |
There was a problem hiding this comment.
issue (bug_risk): 可点击的标题 div 虽然使用了 role="button" 和按键处理函数,但仍然无法通过键盘聚焦。
由于缺少 tabIndex={0},这个 div 无法通过键盘获得焦点,因此按键处理逻辑和焦点样式实际上对键盘用户不可用。请添加 tabIndex={0},或者(更推荐)将其改为语义化的 <button> 元素,以确保一致且可访问的键盘交互体验。
Original comment in English
issue (bug_risk): The clickable header div isn't keyboard-focusable despite role="button" and key handlers.
Because it lacks tabIndex={0}, this div can’t be reached via keyboard focus, so the key handlers and focus styles won’t actually be usable for keyboard users. Please add tabIndex={0} or, preferably, convert it to a semantic <button> to ensure consistent, accessible keyboard interaction.
| <div | ||
| role="button" |
There was a problem hiding this comment.
issue (bug_risk): 截图面板的标题 div 使用了 role="button",但无法通过键盘聚焦。
这个标题同时使用了 role="button"、onKeyDown 处理函数以及 focus-visible 样式,但在没有 tabIndex={0} 的情况下,用户无法通过键盘聚焦到它。请添加 tabIndex={0},或者改用 <button>,以便语义和行为保持一致,并让键盘用户能够看到并使用焦点状态。
Original comment in English
issue (bug_risk): The screenshot panel header div with role="button" is not keyboard-focusable.
This header uses role="button", an onKeyDown handler, and focus-visible styles, but without tabIndex={0} it can’t be reached via keyboard. Add tabIndex={0} or use a <button> so the semantics and behavior match and keyboard users can see and use the focus state.
There was a problem hiding this comment.
Pull request overview
This pull request optimizes the UI of the right-side panel components by addressing visual glitches and improving layout behavior. The changes focus on fixing border-radius rendering gaps, improving transition timing, and enhancing scroll behavior.
Changes:
- Replaced
border border-borderwithring-1 ring-inset ring-border+overflow-hiddento eliminate visual gaps between borders and rounded corners - Added delayed border-radius transitions to prevent visual glitches during panel collapse animations
- Improved logs auto-scroll implementation using
scrollToon container instead ofscrollIntoView - Added minimum height constraint to LogsPanel and refined overflow behavior in right panel container
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/components/ScreenshotPanel.tsx | Updated border styling to use ring utilities, added delayed border-radius transition, changed keyboard handler to use .click(), and improved focus styling |
| src/components/LogsPanel.tsx | Applied consistent ring-based borders, changed scroll implementation to use container ref with scrollTo, added minimum height constraint, and removed sentinel element |
| src/components/ConnectionPanel.tsx | Updated to ring-based border styling with delayed border-radius transition for consistency with other panels |
| src/App.tsx | Refined overflow behavior to conditionally apply vertical scrolling only when side panel is expanded |
|
|
||
| return ( | ||
| <div className="flex-1 flex flex-col bg-bg-secondary rounded-lg border border-border overflow-hidden"> | ||
| <div className="flex-1 flex flex-col bg-bg-secondary rounded-lg ring-1 ring-inset ring-border overflow-hidden min-h-50"> |
There was a problem hiding this comment.
The class min-h-50 translates to min-height: 12.5rem (200px) in Tailwind CSS. This is likely too large for a minimum height constraint on a logs panel that should be flexible. Consider using a smaller value like min-h-32 (128px) or min-h-24 (96px) to better match typical UI requirements while still preventing excessive compression in small windows.
| <div className="flex-1 flex flex-col bg-bg-secondary rounded-lg ring-1 ring-inset ring-border overflow-hidden min-h-50"> | |
| <div className="flex-1 flex flex-col bg-bg-secondary rounded-lg ring-1 ring-inset ring-border overflow-hidden min-h-32"> |
优化下
Summary by Sourcery
改进右侧面板的布局、滚动行为,以及悬停/聚焦视觉效果,使界面更流畅且更具可访问性。
增强内容:
Original summary in English
Summary by Sourcery
Improve the right-side panels’ layout, scrolling behavior, and hover/focus visuals for a smoother and more accessible UI.
Enhancements: