Skip to content

Fix unexpected log line details pop-up in log viewer UI#62637

Merged
edoakes merged 7 commits into
ray-project:masterfrom
doanxem99:unexpected_log_line_details
Apr 23, 2026
Merged

Fix unexpected log line details pop-up in log viewer UI#62637
edoakes merged 7 commits into
ray-project:masterfrom
doanxem99:unexpected_log_line_details

Conversation

@doanxem99

@doanxem99 doanxem99 commented Apr 15, 2026

Copy link
Copy Markdown

Description

This PR fixes the unexpected log line details popup behavior in the Logs viewer.

Before this change, clicking anywhere on a log line immediately opens the "Log line details" dialog

Root cause: The entire log line binded a click handler that opened the dialog, so any click on that line would trigger it.

Expected behavior:

  • Hovering a log line (with structured JSON) shows a "Show details" button, and the dialog only opens when that button is clicked
  • Non-JSON log lines do not show the "Show details" button at all
  • Prevents confusing behavior where hover area and button visibility become inconsistent after horizontal scrolling.

Demo of the fix:

Video_Demo_LR.mp4

Related issues

Fixes #52347

Additional information

Implementation notes:

  • Show details remains rendered only for structured JSON lines (formattedLogLine !== null).
  • Hover behavior is handled via CSS/sx instead of per-row React hover state to keep rendering lightweight.
  • Button placement remains pinned to the visible right edge during horizontal scrolling by using a scroll-offset CSS variable.
  • Row hover hit area is extended in a minimal way so hovering blank area on the same row can still reveal the button after horizontal scroll.

How i tested it:

  1. Start Ray dashboard backend (port 8265) and frontend (npm start, open http://localhost:3000/#/logs).
  2. Open a log file that includes JSON lines.
  3. Verify baseline behavior:
    • Clicking a log row does not automatically open details.
    • Hovering a JSON row shows Show details.
    • Clicking Show details opens the dialog.
  4. Verify horizontal-scroll behavior:
    • Use a long JSON line and scroll horizontally.
    • Hover on the same row (including blank area within that row's visible line).
    • Confirm Show details still appears and remains pinned at the visible right edge.
  5. Verify non-JSON behavior:
    • On plain text rows, Show details should not render.

Contributors:
23127088 - Nguyễn Đình Mạnh
23127066 - Nguyễn Bách Khoa
23127530 - Trương Quang Huy

@doanxem99 doanxem99 requested a review from a team as a code owner April 15, 2026 16:18

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a "Show details" button for structured log lines in the log viewer, utilizing CSS hover effects and a dynamic CSS variable to maintain functionality during horizontal scrolling. Key feedback includes resolving a text selection conflict by adjusting the z-index of the hover-area pseudo-element, removing redundant positioning styles, improving accessibility with focus-visible states, and optimizing the scroll event listener to prevent unnecessary style recalculations.

Comment thread python/ray/dashboard/client/src/components/LogView/LogVirtualView.tsx Outdated
Comment on lines +270 to +273
"&:hover .log-line-details-btn": {
opacity: 1,
pointerEvents: "auto",
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The "Show details" button is currently only revealed on mouse hover. For better accessibility, it should also be made visible when it receives keyboard focus (e.g., via Tab navigation).

Suggested change
"&:hover .log-line-details-btn": {
opacity: 1,
pointerEvents: "auto",
},
"&:hover .log-line-details-btn, .log-line-details-btn:focus-visible": {
opacity: 1,
pointerEvents: "auto",
},

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don't think this is necessary based on the issues raised, but I will do it if it's required.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit f126e03f42958e00d792a709495ee883ec2d12da. Configure here.

Comment thread python/ray/dashboard/client/src/components/LogView/LogVirtualView.tsx Outdated
@doanxem99 doanxem99 force-pushed the unexpected_log_line_details branch from e566578 to 80383d5 Compare April 15, 2026 17:09
Sparks0219 and others added 3 commits April 16, 2026 00:14
ray-project#62492)

Following up on ray-project#54928 where we originally introduced a feature flag to
give users the option to not set CUDA_VISIBLE_DEVICES when num_gpus=0 or
None. We also output an error informing users that the default behavior
will be changed in a future ray version. Since it's been around 8 months
since we introduced this feature flag and the error is a bit
distracting, we're now setting this as the default behavior meaning we
will no longer override CUDA_VISIBLE_DEVICES when num_gpus = 0 or None.

---------

Signed-off-by: Joshua Lee <joshlee@anyscale.com>
Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: doanxem99 <nguyendinhphuongnam99@gmail.com>
Signed-off-by: doanxem99 <nguyendinhphuongnam99@gmail.com>
Signed-off-by: doanxem99 <nguyendinhphuongnam99@gmail.com>
@doanxem99 doanxem99 force-pushed the unexpected_log_line_details branch from 80383d5 to 9e0aa95 Compare April 15, 2026 17:14
@doanxem99 doanxem99 requested a review from a team as a code owner April 15, 2026 17:14
@ray-gardener ray-gardener Bot added dashboard Issues specific to the Ray Dashboard core Issues that should be addressed in Ray Core observability Issues related to the Ray Dashboard, Logging, Metrics, Tracing, and/or Profiling community-contribution Contributed by the community labels Apr 15, 2026
Signed-off-by: doanxem99 <nguyendinhphuongnam99@gmail.com>
@doanxem99 doanxem99 force-pushed the unexpected_log_line_details branch from 4120714 to 96ef111 Compare April 16, 2026 01:31
@doanxem99

Copy link
Copy Markdown
Author

Hi @alanwguo @scottsun94 @Sparks0219 @edoakes, just checking back on this whenever you have a moment. I’ve verified that this fix addresses the issue described in #52347 and all CI tests are passing. I've also attached a video demo below to show the expected behavior. Thanks.

@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Apr 22, 2026
@edoakes

edoakes commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

Looks good. I've enabled pre-merge CI tests, if they pass the PR will merge. If not please ping me once you've fixed them

@edoakes edoakes enabled auto-merge (squash) April 22, 2026 21:36
@github-actions github-actions Bot disabled auto-merge April 23, 2026 01:09
@doanxem99

Copy link
Copy Markdown
Author

Looks good. I've enabled pre-merge CI tests, if they pass the PR will merge. If not please ping me once you've fixed them

Hi @edoakes, all CI checks are now passing after updating the branch. Could you re-enable auto-merge when you get a chance? Thanks for the review!

@doanxem99 doanxem99 requested a review from edoakes April 23, 2026 09:41
@edoakes edoakes merged commit 399101c into ray-project:master Apr 23, 2026
6 checks passed
Lucas61000 pushed a commit to Lucas61000/ray that referenced this pull request May 15, 2026
…62637)

## Description
This PR fixes the unexpected log line details popup behavior in the Logs
viewer.

Before this change, clicking anywhere on a log line immediately opens
the "Log line details" dialog

> Root cause: The entire log line binded a click handler that opened the
dialog, so any click on that line would trigger it.

Expected behavior:
- Hovering a log line (with structured JSON) shows a "Show details"
button, and the dialog only opens when that button is clicked
- Non-JSON log lines do not show the "Show details" button at all
- Prevents confusing behavior where hover area and button visibility
become inconsistent after horizontal scrolling.

### Demo of the fix:


https://github.com/user-attachments/assets/7fd77784-dea4-41c6-979e-4141b62899f5



## Related issues
Fixes ray-project#52347

## Additional information
Implementation notes:
- `Show details` remains rendered only for structured JSON lines
(`formattedLogLine !== null`).
- Hover behavior is handled via CSS/sx instead of per-row React hover
state to keep rendering lightweight.
- Button placement remains pinned to the visible right edge during
horizontal scrolling by using a scroll-offset CSS variable.
- Row hover hit area is extended in a minimal way so hovering blank area
on the same row can still reveal the button after horizontal scroll.

How i tested it:
1. Start Ray dashboard backend (port `8265`) and frontend (`npm start`,
open `http://localhost:3000/#/logs`).
2. Open a log file that includes JSON lines.
3. Verify baseline behavior:
	- Clicking a log row does not automatically open details.
	- Hovering a JSON row shows `Show details`.
	- Clicking `Show details` opens the dialog.
4. Verify horizontal-scroll behavior:
	- Use a long JSON line and scroll horizontally.
- Hover on the same row (including blank area within that row's visible
line).
- Confirm `Show details` still appears and remains pinned at the visible
right edge.
5. Verify non-JSON behavior:
	- On plain text rows, `Show details` should not render.

**Contributors:**
23127088 - Nguyễn Đình Mạnh
23127066 - Nguyễn Bách Khoa
23127530 - Trương Quang Huy

---------

Signed-off-by: Joshua Lee <joshlee@anyscale.com>
Signed-off-by: doanxem99 <nguyendinhphuongnam99@gmail.com>
Co-authored-by: Joshua Lee <73967497+Sparks0219@users.noreply.github.com>
Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core dashboard Issues specific to the Ray Dashboard go add ONLY when ready to merge, run all tests observability Issues related to the Ray Dashboard, Logging, Metrics, Tracing, and/or Profiling

3 participants