Skip to content

fix(ui): remove duplicate reply range connectors - #1046

Merged
benvinegar merged 2 commits into
mainfrom
fix/reply-range-connectors
Sep 8, 2026
Merged

benvinegar merged 2 commits into
mainfrom
fix/reply-range-connectors

Conversation

@benvinegar

Copy link
Copy Markdown
Member

Summary

  • keep the external range rail connected to each thread's root comment
  • omit the duplicate right-side connector from child replies, which already connect through the left thread gutter
  • determine root-card continuation using later root notes rather than child replies

Visual evidence

Before: child replies repeat the connection on the right even though the thread is already connected on the left.

Child replies with duplicate right-side connectors

Validation

  • bun test packages/hunk/src/ui/diff/reviewRenderPlan.test.ts packages/hunk/src/ui/components/panes/AgentInlineNote.test.tsx (59 passed)
  • bun run typecheck
  • git diff --check

Platform: Linux. No real-TTY after screenshot captured.

This PR description was generated by Pi using gpt-5.6-sol

@vercel

vercel Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
hunk-web Ignored Ignored Preview Sep 8, 2026 2:44am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adjusts inline-note range-rail planning so threaded replies rely on the left thread gutter instead of drawing duplicate right-side connectors.

  • Keeps external range connectors on root cards.
  • Determines root-card continuation from later root notes rather than child replies.
  • Adds a focused regression test and a patch changeset.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking opportunity to avoid quadratic work when many notes share an anchor.

The connector behavior matches production thread metadata and ordering, but the per-note suffix copying and scanning can unnecessarily degrade render-plan performance for large note groups.

Files Needing Attention: packages/hunk/src/ui/diff/reviewRenderPlan.ts

Important Files Changed

Filename Overview
packages/hunk/src/ui/diff/reviewRenderPlan.ts Suppresses external range connectors for replies and recalculates continuation between root notes; the new repeated suffix scan introduces avoidable quadratic planning work.
packages/hunk/src/ui/diff/reviewRenderPlan.test.ts Adds a regression test confirming that only the root card retains the external range connector.
Prompt To Fix All With AI
### Issue 1
packages/hunk/src/ui/diff/reviewRenderPlan.ts:498-500
**Quadratic note scanning**

For every note at an anchor, this copies and scans the remaining notes to find a later root. Because all notes resolving to the same row share one unbounded bucket, a large group can cause quadratic work and many temporary allocations each time the render plan is rebuilt. Computing later-root presence in one reverse pass would avoid this non-blocking responsiveness risk.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix(ui): remove duplicate reply range co..." | Re-trigger Greptile

Comment on lines +498 to +500
const hasLaterRootNote = anchoredNotes
.slice(placementIndex + 1)
.some((candidate) => (candidate.note.thread?.depth ?? 0) === 0);

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.

P2 Quadratic note scanning

For every note at an anchor, this copies and scans the remaining notes to find a later root. Because all notes resolving to the same row share one unbounded bucket, a large group can cause quadratic work and many temporary allocations each time the render plan is rebuilt. Computing later-root presence in one reverse pass would avoid this non-blocking responsiveness risk.

Knowledge Base Used: Terminal application UI

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/hunk/src/ui/diff/reviewRenderPlan.ts
Line: 498-500

Comment:
**Quadratic note scanning**

For every note at an anchor, this copies and scans the remaining notes to find a later root. Because all notes resolving to the same row share one unbounded bucket, a large group can cause quadratic work and many temporary allocations each time the render plan is rebuilt. Computing later-root presence in one reverse pass would avoid this non-blocking responsiveness risk.

**Knowledge Base Used:** [Terminal application UI](https://app.greptile.com/modem/-/custom-context/knowledge-base/modem-dev/hunk/-/docs/terminal-application-ui.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch. Replaced the per-note slice().some() scan with one initial root count that is decremented during the existing pass, removing the quadratic scans and temporary arrays. The focused render-plan tests and typecheck pass.

Responded by Pi using gpt-5.6-sol.

This comment was generated by Pi using gpt-5.6-sol

@benvinegar

Copy link
Copy Markdown
Member Author

Rebased onto the latest main after #1044 and #1045 landed. The previously failing note-navigation PTY cases now pass locally (bun test test/pty/notes.test.ts: 22 passed), along with the focused render-plan tests and typecheck. The branch was force-pushed only to refresh the rebase.

This comment was generated by Pi using gpt-5.6-sol

@benvinegar
benvinegar force-pushed the fix/reply-range-connectors branch from b0c4c25 to bc84a24 Compare September 8, 2026 02:44
@benvinegar
benvinegar merged commit 923ce03 into main Sep 8, 2026
12 checks passed
@benvinegar
benvinegar deleted the fix/reply-range-connectors branch September 8, 2026 02:50
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.

1 participant