Skip to content

feat(skills): registry card polish and persisted pagination state#2102

Merged
samuv merged 6 commits intomainfrom
fn-registry-card
Apr 27, 2026
Merged

feat(skills): registry card polish and persisted pagination state#2102
samuv merged 6 commits intomainfrom
fn-registry-card

Conversation

@samuv
Copy link
Copy Markdown
Collaborator

@samuv samuv commented Apr 24, 2026

Follow-up polish to the Skills → Registry tab on top of #2097 / #2098.

Kapture.2026-04-24.at.19.18.32.mp4

Summary

  • Normalized repo label replaces the io.github.stacklok subheading on registry cards and the namespace badge on the skill detail page. GitHub URLs render as org/repo, other hosts as host/path. The namespace stays on props — only hidden from the UI. Table view is untouched.
  • Pagination bar pinned to the viewport bottom so it stays anchored with 3 cards or 30. Overflowing grids still scroll as before.
  • Last-page button (>|) added to the shared Pagination component, next to the existing next/first/prev controls.
  • Items-per-page is remembered across sessions via a new ui.pageSize.skillsRegistry preference, wired through the same uiPreferences IPC path used for view-mode. URL ?limit= still wins over the stored value.

@samuv samuv self-assigned this Apr 24, 2026
Copilot AI review requested due to automatic review settings April 24, 2026 17:21
Copy link
Copy Markdown
Contributor

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

This PR adds UI polish and state persistence improvements to the Skills → Registry experience, including normalized repo labels, pagination enhancements, and a persisted “items per page” preference stored via the existing UI preferences IPC.

Changes:

  • Add getDisplayRepoLabel() utility + tests, and swap registry card/detail badge UI to show a normalized repo label instead of namespace.
  • Enhance shared Pagination with a “last page” control and adjust Skills registry layout so pagination stays anchored at the bottom of the registry tab panel.
  • Persist Skills Registry page size across sessions via new ui.pageSize.skillsRegistry preference with preload + main-process IPC wiring and tests.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
renderer/src/routes/skills.tsx Makes limit optional in route search parsing and falls back to default when querying.
renderer/src/features/skills/lib/get-display-repo-label.ts New helper to normalize repository URL display strings.
renderer/src/features/skills/lib/tests/get-display-repo-label.test.ts Unit tests for repo label normalization behavior.
renderer/src/features/skills/components/skills-page.tsx Wires persisted page size preference into registry query/pagination and adjusts layout classes.
renderer/src/features/skills/components/skill-detail-page.tsx Replaces namespace badge with normalized repo label in the detail header.
renderer/src/features/skills/components/card-registry-skill.tsx Replaces card subtitle from namespace to normalized repo label.
renderer/src/features/skills/components/tests/skills-page.test.tsx Adds tests covering persisted page size + URL precedence.
renderer/src/features/skills/components/tests/card-registry-skill.test.tsx Updates tests to assert namespace is hidden and repo label is shown when available.
renderer/src/common/mocks/electronAPI.ts Extends Electron API test stub with page-size preference methods.
renderer/src/common/hooks/use-page-size-preference.ts New React Query hook to read/write persisted page size via IPC.
renderer/src/common/hooks/tests/use-page-size-preference.test.tsx Hook tests for loading state, read, and optimistic write behavior.
renderer/src/common/components/ui/pagination.tsx Adds a “go to last page” button.
renderer/src/common/components/ui/tests/pagination.test.tsx Extends pagination tests to cover the new last-page control.
preload/src/api/ui-preferences.ts Adds preload API methods for get/set page size preference.
main/src/ui-preferences.ts Adds page-size preference keys and DB read/write helpers with validation.
main/src/ipc-handlers/ui-preferences.ts Adds IPC handlers for get/set page size preference.

Comment thread renderer/src/features/skills/components/skills-page.tsx Outdated
Comment thread renderer/src/features/skills/components/skills-page.tsx Outdated
Comment thread renderer/src/features/skills/components/skill-detail-page.tsx
Comment thread main/src/ipc-handlers/ui-preferences.ts Outdated
Comment thread main/src/ipc-handlers/ui-preferences.ts
Copy link
Copy Markdown
Collaborator

@peppescg peppescg left a comment

Choose a reason for hiding this comment

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

🚀

@samuv samuv merged commit 29d89ac into main Apr 27, 2026
20 of 21 checks passed
@samuv samuv deleted the fn-registry-card branch April 27, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants