Skip to content

Keep the current request visible in console - #1702

Merged
gjkim42 merged 1 commit into
mainfrom
feat/console-current-request
Aug 26, 2026
Merged

gjkim42 merged 1 commit into
mainfrom
feat/console-current-request

Conversation

@gjkim42

@gjkim42 gjkim42 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a compact Current request bar to the console conversation view when the request for the visible response has scrolled out of view. The bar follows the relevant request while browsing conversation history and scrolls back to the full request when clicked.

The bar stays hidden while the original request is visible and while viewing file changes, so it does not consume conversation space unnecessarily.

Which issue(s) this PR is related to:

N/A

Special notes for your reviewer:

  • Includes a focused frontend test for request selection, visibility, and click-to-scroll behavior.
  • Regenerated internal/consoleserver/web/app.js with make update.
  • Verified with make test and make verify. The unit test command was run without inherited Codex runtime configuration variables so the entrypoint isolation tests use their intended fixtures.

Does this PR introduce a user-facing change?

The web console now shows a compact link to the current request while reading long agent responses.

@github-actions github-actions Bot added kind/feature Categorizes issue or PR as related to a new feature needs-triage needs-priority needs-actor release-note labels Aug 26, 2026
@gjkim42

gjkim42 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

/kelos claude-review

@kelos-bot

kelos-bot Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Kelos Task Status

Task kelos-claude-reviewer-issue-comment-c62fbc990913 has succeeded. ✅

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread internal/consoleserver/frontend/app.ts
Comment thread internal/consoleserver/web/app.js Outdated
Comment thread internal/consoleserver/web/app.js
Comment thread internal/consoleserver/frontend/app.ts
@kelos-bot

kelos-bot Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🤖 Kelos Claude Reviewer Agent @gjkim42

Review Summary

Verdict: APPROVE
Overall correctness: patch is correct
Scope: Adds a floating "Current request" bar to the console conversation view that tracks the request whose response is being read and scrolls back to it on click.

Findings Overview

Priority Count File:Line Summary
P0 0 — none
P1 0 — none
P2 1 docs/reference.md:337 New user-facing console behavior ships without a docs update
P3 1 internal/consoleserver/frontend/app.ts:3906 Jump lands the target row under the floating bar, which then relabels to the preceding request

Findings

Documentation completeness

  • [P2] docs/reference.md:337 — This PR adds user-facing console behavior but no docs update. docs/reference.md already documents the web conversation view at exactly this granularity (history paging via Load earlier messages, tool output previews, scroll preservation on reconnect), so the Current request bar belongs there too: add a sentence to the web chat section describing that a compact Current request link appears when the request for the visible response has scrolled out of view, follows the relevant request while browsing history, scrolls back to the full request when clicked, and stays hidden while viewing file changes.

Correctness

  • [P3] internal/consoleserver/frontend/app.ts:3906 — jumpToCurrentRequest uses scrollIntoView({block: 'start'}), which lands the target row at the exact top of the #messages scrollport. Two side effects at that boundary: (1) the floating bar overlays the top of the scrollport (grid row 2, align-self: start), so it covers the first line of the request the user just jumped to; (2) in updateCurrentRequest, the landed row hits bounds.top >= viewportTop and breaks the loop with request still pointing at the preceding user row, so the bar immediately relabels to the previous request while the jumped-to request is fully visible — repeated clicks walk up through history, and the PR's stated behavior ("hidden while the original request is visible") does not hold in this state. Adding scroll-margin-top (sized to clear the bar) on .event-row.user fixes the occlusion; treating a row whose top sits within the bar's height as the current one would restore the hide-when-visible behavior after a jump.

Suggestions (optional)

  • [P3] internal/consoleserver/frontend/app.ts:5221 — The scroll listener runs querySelectorAll('.event-row.user') plus a getBoundingClientRect per scrolled-out row on every scroll event. Fine at typical conversation sizes since the loop breaks at the first visible row, but a requestAnimationFrame throttle (or IntersectionObserver) would keep long sessions cheap.

Key takeaways

  • The feature logic is sound: every user row goes through renderAcceptedUser (live, history replay, and pending-acceptance paths), so dataset.requestText is always populated, and update hooks cover scroll, resize, tab switches, session activation/reset, and both history-replay paths.
  • The CSS grid re-layout is safe — all five direct children of .conversation now have explicit grid-row placements, and the overlay uses pointer-events: none on the wrapper so it never blocks the scrollbar.
  • The new test covers selection, straddle-hide, and click-to-scroll through the real generated app.js code, and the harness querySelectorAll compound-class fix is a genuine test-infra improvement.
  • Main ask before/after merge: a one-sentence addition to the web chat section of docs/reference.md.

@gjkim42
gjkim42 force-pushed the feat/console-current-request branch from 6cbb69e to 09e760a Compare August 26, 2026 13:12
@gjkim42

gjkim42 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the current review findings in 09e760a:

  • documented the Current request behavior in docs/reference.md
  • preserved and refreshed request context when switching between console views
  • fixed the exact-top jump boundary and hid the bar before navigation
  • throttled scroll geometry work with requestAnimationFrame and skipped unchanged DOM updates
  • added focused coverage for view restoration, jump boundaries, and throttling

Validation: make test and make verify pass. The branch is squashed to one commit.

@gjkim42
gjkim42 enabled auto-merge August 26, 2026 13:15
@gjkim42
gjkim42 added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit de052c3 Aug 26, 2026
40 checks passed
@gjkim42
gjkim42 deleted the feat/console-current-request branch August 26, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature needs-actor needs-priority needs-triage release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant