Skip to content

fix: add issue detail jump button#3018

Closed
get6 wants to merge 2 commits into
multica-ai:mainfrom
get6:fix/issue-detail-jump-latest
Closed

fix: add issue detail jump button#3018
get6 wants to merge 2 commits into
multica-ai:mainfrom
get6:fix/issue-detail-jump-latest

Conversation

@get6
Copy link
Copy Markdown

@get6 get6 commented May 21, 2026

What does this PR do?

Adds a floating jump control to the issue detail timeline so users can quickly move to the latest activity, and back to the top when already near the bottom. The issue timeline is virtualized with Virtuoso, so the bottom jump uses scrollToIndex instead of relying on partially measured scrollHeight.

Related Issue

No GitHub issue found/linked.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Refactor / code improvement (no behavior change)
  • Tests (adding or improving test coverage)
  • Documentation update
  • CI / infrastructure

Changes Made

  • packages/views/issues/components/issue-detail.tsx: tracks overflow/near-bottom state and renders the jump FAB when useful, scoped to the issue detail pane.
  • packages/views/issues/components/issue-jump-fab.tsx: adds the tooltip + button component for jump-to-top/bottom.
  • packages/views/locales/*/issues.json: adds jump labels.
  • packages/views/issues/components/issue-detail.test.tsx: covers Virtuoso-backed jump behavior.

How to Test

  1. pnpm --filter @multica/views exec vitest run issues/components/issue-detail.test.tsx
  2. pnpm --filter @multica/views typecheck
  3. pnpm --filter @multica/views lint

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have run tests locally and they pass
  • I have added or updated tests where applicable
  • If this change affects the UI, I have included before/after screenshots
  • I have updated relevant documentation to reflect my changes
  • If I added a new runtime / coding tool / UI tab, I synced the change to landing copy (apps/web/features/landing/i18n/) and relevant docs (apps/docs/content/docs/)
  • If this PR touches Chinese product copy, I checked it against apps/docs/content/docs/developers/conventions.zh.mdx (terminology, mixed-rule for task / issue / skill)
  • I have considered and documented any risks above
  • I will address all reviewer comments before requesting merge

Risk: low UI-only change, but manual mobile verification is still recommended because this adds a floating issue-detail control and Virtuoso scrolling behavior.

AI Disclosure

AI tool used: Hermes Agent / GPT-5.5

Prompt / approach:
Implemented from user feedback that issue detail lacks a quick way to jump to the latest/bottom comment. Kept issue timeline virtualization intact, scoped the FAB to the issue detail pane to avoid overlaying the sidebar, and validated with focused unit test/typecheck/lint.

Screenshots (optional)

Not included; manual mobile visual check recommended before merge.

Copilot AI review requested due to automatic review settings May 21, 2026 12:29
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

@get6 is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a floating “jump” FAB to the Issue Detail timeline to quickly scroll to the latest activity (Virtuoso scrollToIndex) and toggle to “jump to top” when near the bottom, while keeping the chat FAB placement consistent.

Changes:

  • Introduces IssueJumpFab and renders it in IssueDetail when the timeline overflows and chat isn’t open.
  • Implements Virtuoso-backed jump-to-bottom behavior via VirtuosoHandle.scrollToIndex.
  • Updates chat FAB positioning and adds i18n labels + a focused unit test for jump behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/views/issues/components/issue-detail.tsx Tracks overflow/near-bottom state; uses Virtuoso ref to jump to latest; conditionally renders the jump FAB.
packages/views/issues/components/issue-jump-fab.tsx New reusable tooltip + button component for jump-to-top/bottom.
packages/views/chat/components/chat-fab.tsx Changes FAB positioning from absolute to fixed for consistent floating alignment.
packages/views/issues/components/issue-detail.test.tsx Adds Virtuoso jump test; expands DOM scroll mocking to support overflow detection.
packages/views/locales/en/issues.json Adds jump button labels under detail.*.
packages/views/locales/zh-Hans/issues.json Adds jump button labels under detail.*.
Comments suppressed due to low confidence (1)

packages/views/chat/components/chat-fab.tsx:53

  • Changing the FAB from absolute to fixed alters its positioning context (it’s no longer constrained by a relative parent). In the desktop renderer layout there’s an explicit note that the content area is relative so ChatWindow/ChatFab are constrained to that inset container; with fixed, the FAB may instead pin to the window and overlap the sidebar/outside the rounded content area. If only the issues page needs viewport-fixed alignment, consider making the positioning configurable (prop/className) or keeping absolute and adjusting the issues jump button layout accordingly.
      <TooltipTrigger
        onClick={handleClick}
        className={cn(
          "fixed bottom-2 right-2 z-50 flex size-10 cursor-pointer items-center justify-center rounded-full ring-1 ring-foreground/10 bg-card text-muted-foreground shadow-sm transition-transform hover:scale-110 hover:text-accent-foreground active:scale-95",
          // Impulse the button itself while a chat task is running — no
          // outer ring to keep things calm.
          isRunning && "animate-chat-impulse",
        )}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1037 to +1038
}, [scrollContainerEl, updateJumpScrollState, items.length]);

Comment on lines 343 to +362
scrollIntoViewSpy.mockClear();
virtuosoScrollToIndexSpy.mockClear();
Object.defineProperty(HTMLElement.prototype, "scrollHeight", {
configurable: true,
get: () => 0,
});
Object.defineProperty(HTMLElement.prototype, "clientHeight", {
configurable: true,
get: () => 0,
});
Object.defineProperty(HTMLElement.prototype, "scrollTop", {
configurable: true,
writable: true,
value: 0,
});
Object.defineProperty(HTMLElement.prototype, "scrollTo", {
configurable: true,
writable: true,
value: vi.fn(),
});
@get6
Copy link
Copy Markdown
Author

get6 commented May 21, 2026

Closing this as a duplicate of #2992.

#2992 already implements the issue detail jump control, links/closes #2726, includes tests, and has desktop/mobile demos. If there is any specific improvement from this branch, we should fold it into #2992 instead of keeping two overlapping PRs open.

@get6 get6 closed this May 21, 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.

2 participants