Paginate the grid and split click from double-click#9
Conversation
The panel capped results at 400 rows, so on a 6000-shot index the grid only reached back about two weeks. It now pages in older screenshots as you scroll, using a (captured_at, id) keyset cursor so the live indexer adding new shots mid-scroll can't dupe or skip rows. Single click now selects a thumbnail instead of copying; double click copies and closes, matching Enter. Also adds the bug and new-feature issue forms, issue config, and FUNDING.yml carried over from the ide repo. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
There was a problem hiding this comment.
Code Review
This pull request implements keyset pagination for screenshot search and recent views to support infinite scrolling in the UI. It introduces a Cursor struct, updates database queries in ScreenshotStore to filter by cursor, implements paging logic in SearchViewModel, and updates PanelContentView to trigger loadMore() on scroll. It also adds unit tests and GitHub templates. Feedback highlights two critical issues: first, loadMore() runs synchronously on the main actor, which blocks the main thread with database I/O and renders the isLoadingMore guard ineffective; second, the SQL query in ScreenshotStore.recent needs to explicitly order by id DESC as a tie-breaker alongside captured_at DESC to ensure deterministic keyset pagination and prevent skipping tied rows.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec0feff2e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR updates Vista’s screenshot grid to support keyset pagination (so the grid can scroll back through the full index without OFFSET-related duplication/skipping while new screenshots are inserted), adjusts thumbnail interaction to separate single-click selection from double-click primary action, and adds GitHub repository metadata files (issue forms + funding).
Changes:
- Added
(captured_at, id)keyset pagination support toScreenshotStore.recentandScreenshotStore.search, plus new pagination tests. - Updated the UI/view-model to load results in 200-row pages and trigger
loadMore()when the trailing grid cell appears. - Split single-click (select only) from double-click (primary action) behavior in the grid, and added GitHub issue templates +
FUNDING.yml.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/VistaCoreTests/ScreenshotStoreTests.swift | Adds tests validating cursor-based paging for both recent() and filtered search() results. |
| Sources/VistaCore/ScreenshotStore.swift | Introduces the pagination cursor and wires it into recent/search SQL query generation. |
| Sources/Vista/SearchViewModel.swift | Switches initial loads to page size 200 and adds a loadMore() API and paging state. |
| Sources/Vista/PanelContentView.swift | Adds infinite-scroll trigger on the trailing cell and separates single vs double click behavior. |
| .github/ISSUE_TEMPLATE/new-feature.yml | Adds a “New feature” issue form. |
| .github/ISSUE_TEMPLATE/bug.yml | Adds a “Bug report” issue form. |
| .github/ISSUE_TEMPLATE/config.yml | Enables blank issues in GitHub issue creation UI. |
| .github/FUNDING.yml | Adds funding links metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address review feedback on #9: - Add an id DESC tie-breaker to both pagination ORDER BY clauses so rows sharing a captured_at can't be skipped when a page boundary lands mid-tie. The cursor predicate already compares id; the sort now matches. - Run loadMore's query off the main actor. The store's serial queue is shared with the indexer's upserts, so a synchronous read could block the main thread behind a write batch and jank the scroll that triggered it. The detached read appends on the main actor with a staleness guard so a query/reload mid-flight drops the now-stale page. - Add a regression test for a tie group straddling the page boundary. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
Summary
(captured_at, id)keyset cursor so the live indexer adding shots mid-scroll can't dupe or skip rows. On a 6000-shot index the grid previously only reached back ~2 weeks.FUNDING.ymlcarried over from the ide repo.Test plan
swift buildcleanswift test --filter ScreenshotStoreTestspasses, including two new keyset-pagination tests (tie-on-timestamp walk + filtered-search paging)