Skip to content

Discussion open-scroll: land at start of latest reply item (poll or comment)#467

Open
Copilot wants to merge 5 commits intodevelopfrom
copilot/fix-thread-jump-location
Open

Discussion open-scroll: land at start of latest reply item (poll or comment)#467
Copilot wants to merge 5 commits intodevelopfrom
copilot/fix-thread-jump-location

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 5, 2026

Opening a long discussion from list view currently jumps to the bottom of the latest reply, which hides the beginning of that message. This change makes discussion open-scroll anchor to the start of the latest reply item instead.

  • Behavior change (discussion threads)

    • In frontend/src/components/CommentsArea.vue, default open-scroll now targets the latest reply item across both comments and polls (whichever is newer by creation) when no explicit comment/poll query is present and navigation is not from search.
    • This behavior is triggered from both comments and polls onSuccess handlers to stay correct regardless of load order.
    • Non-discussion timelines keep existing behavior (scrollToEnd()).
  • Element targeting reliability

    • Uses keyed timeline element refs (timelineItemElements) populated via setItemRef(...).
    • Reuses getTimelineItemKey for:
      • latest-reply anchor lookup
      • scrollToItem
      • getCommentContentElement
  • Representative diff

    // before: discussions opened to bottom/end
    } else if (!route.query.fromSearch && comments.data?.length > 0) {
      scrollToEnd()
    }
    
    // after: discussions open at top of latest reply item (poll or comment)
    } else if (!route.query.fromSearch && comments.data?.length > 0) {
      if (shouldScrollToLatestDiscussionReply()) {
        scrollToLatestReply()
      } else {
        scrollToEnd()
      }
    }

UI screenshot

Original prompt

This section details on the original issue you should resolve

<issue_title>UX: Opening a new thread should jump at start of last reply, not end</issue_title>
<issue_description>Steps:

  1. Find a long running thread with a reply that's longer than what fits in your screen
  2. Open thread from list view, it goes to end of the message and not start.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits March 5, 2026 12:55
Co-authored-by: netchampfaris <9355208+netchampfaris@users.noreply.github.com>
Co-authored-by: netchampfaris <9355208+netchampfaris@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix thread opening behavior to jump to start of last reply Discussion open-scroll: land at start of latest reply (not thread bottom) Mar 5, 2026
@netchampfaris netchampfaris marked this pull request as ready for review March 5, 2026 13:05
@netchampfaris
Copy link
Copy Markdown
Contributor

@copilot instead of the start of last "comment" it should be scrolled to start of last poll or comment

@cypress
Copy link
Copy Markdown

cypress bot commented Mar 5, 2026

gameplan    Run #405

Run Properties:  status check passed Passed #405  •  git commit f3bda189d5 ℹ️: Merge 80ad09576d598c9f25681c7fd4708f94f18e9641 into 7ab03f2d4c5ac04b2d26db9107f5...
Project gameplan
Branch Review copilot/fix-thread-jump-location
Run status status check passed Passed #405
Run duration 00m 52s
Commit git commit f3bda189d5 ℹ️: Merge 80ad09576d598c9f25681c7fd4708f94f18e9641 into 7ab03f2d4c5ac04b2d26db9107f5...
Committer Copilot
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 7
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

Copilot AI and others added 2 commits March 5, 2026 13:13
Co-authored-by: netchampfaris <9355208+netchampfaris@users.noreply.github.com>
Co-authored-by: netchampfaris <9355208+netchampfaris@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 5, 2026

@copilot instead of the start of last "comment" it should be scrolled to start of last poll or comment

Updated in commit f32d488 — default discussion open-scroll now targets the latest reply item across both polls and comments (whichever is newer), and still anchors to the start of that item.

Screenshot: UI screenshot

Copilot AI changed the title Discussion open-scroll: land at start of latest reply (not thread bottom) Discussion open-scroll: land at start of latest reply item (poll or comment) Mar 5, 2026
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.

UX: Opening a new thread should jump at start of last reply, not end

2 participants