Skip to content

feat(session): navigate to comments by id - #845

Open
Yuki9814 wants to merge 1 commit into
modem-dev:mainfrom
Yuki9814:feat/session-navigate-comment
Open

feat(session): navigate to comments by id#845
Yuki9814 wants to merge 1 commit into
modem-dev:mainfrom
Yuki9814:feat/session-navigate-comment

Conversation

@Yuki9814

Copy link
Copy Markdown

Problem

hunk session comment list --json exposes stable comment IDs, but callers cannot use one of those IDs to focus that exact comment. They must reconstruct a file/line target or use relative next/previous navigation.

Closes #490.

Approach

  • add hunk session navigate --comment <id> and reject combinations with the existing navigation selectors;
  • resolve the ID against the selected session's live comments in the daemon, then reuse the existing navigate_to_hunk payload;
  • return a clear 400 response for an unknown ID and bump daemon compatibility for the new request field;
  • document the new mode, regenerate the published references, and add a minor Changeset.

This stays in the existing session CLI/daemon path. It does not add a new UI socket command or change how comments are stored.

Validation

Tested on macOS arm64:

  • bun ./scripts/run-test-suite.ts — 3021 passed, 24 platform/tool-gated skips, 0 failed;
  • bun test src/app/cli.test.ts src/session/protocolSchemas.test.ts src/session/agent/cliClient.test.ts src/session/broker/brokerServer.helpers.test.ts src/session/client/capabilities.test.ts src/session/agent/commands.daemon.test.ts src/hunk-review/skillDocument.test.ts scripts/generate-docs.test.ts — 199 passed, 0 failed;
  • oxfmt --check .;
  • oxlint . --deny-warnings;
  • tsc --noEmit;
  • bun ./scripts/generate-docs.ts --check;
  • bun ./scripts/generate-changelog.ts --check;
  • depcruise src packages --config .dependency-cruiser.cjs --ignore-known.

The Linux-only live-session CLI integration is included but platform-gated locally; CI can exercise it. There is no visual UI change.

Implemented with OpenAI Codex assistance. The final diff and verification results were reviewed before submission.

Co-authored-by: OpenAI Codex <codex@openai.com>
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

@Yuki9814 is attempting to deploy a commit to the Modem Team on Vercel.

A member of the Team first needs to authorize it.

@benvinegar benvinegar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Requesting changes because the new comment-ID navigation path currently drops exact-line reveal semantics and its added integration test fails on Linux.

Validation: bun test test/session/cli.test.ts -t "navigate works" (1 failed).

This comment was generated by Pi using GPT-5.6 Sol

filePath: comment?.filePath ?? input.filePath,
hunkIndex:
comment?.hunkIndex ??
(input.hunkNumber !== undefined ? input.hunkNumber - 1 : undefined),

@benvinegar benvinegar Aug 25, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P1] Preserve exact-line navigation for comment IDs

This forwards hunkIndex together with side/line, but useTerminalReview.navigateToLocation only calls revealLine when hunkIndex is absent. As a result, --comment selects only the hunk rather than revealing the annotated row, and the command result omits side/line. The new integration test confirms the regression: bun test test/session/cli.test.ts -t "navigate works" fails at test/session/cli.test.ts:655. Please omit hunkIndex for resolved comments (letting the line resolve its containing hunk), or make the terminal handler prioritize an exact line whenever side/line are present.

This comment was generated by Pi using GPT-5.6 Sol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --comment flag to hunk session navigate

2 participants