Skip to content

Prioritize cited chunks in parsed list#22

Merged
suguanYang merged 1 commit into
stagingfrom
fix/citation-priority-list
May 10, 2026
Merged

Prioritize cited chunks in parsed list#22
suguanYang merged 1 commit into
stagingfrom
fix/citation-priority-list

Conversation

@suguanYang
Copy link
Copy Markdown
Contributor

Summary

  • Replace citation focus scrolling with a simpler prioritized-list behavior: the focused/cited chunk is moved to index 0 and highlighted there.
  • Reset the chunk virtualizer to offset 0 whenever a focused chunk request is applied, so the parsed chunk list starts at the highlighted citation chunk.
  • Remove the special virtual range injection and scrollIntoView path that tried to jump to the focused chunk at its original virtual index.

Verification

  • Red first: pnpm test src/components/chunks-panel.test.ts -- --runInBand and pnpm test src/components/workspace-shell.test.ts -- --runInBand failed before implementation because focused/cited chunks stayed at their original index.
  • pnpm test src/components/chunks-panel.test.ts -- --runInBand
  • pnpm test src/components/workspace-shell.test.ts -- --runInBand
  • pnpm test
  • pnpm exec tsc --noEmit
  • pnpm lint
  • pnpm build
  • git diff --check
  • Real browser mobile check with Chrome DevTools at 390x844: clicked a TSLA demo citation to table-13; after the fix the table-13 row was data-index="0", data-focused-chunk="true", viewport scrollTop=0, and the row was about 12px below the chunks viewport top.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

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

Project Deployment Actions Updated (UTC)
knowhere-notebook-staging Ready Ready Preview, Comment May 10, 2026 7:22am

Request Review

@suguanYang suguanYang merged commit 4eed353 into staging May 10, 2026
2 checks passed
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