feat(website): add community/official/all filter to collections overview#1273
Open
fhennig wants to merge 6 commits into
Open
feat(website): add community/official/all filter to collections overview#1273fhennig wants to merge 6 commits into
fhennig wants to merge 6 commits into
Conversation
Adds a segmented control to the collections overview page so users can filter by community submissions, official (GenSpectrum) collections, or all. Filtering is done client-side based on ownedBy. The system user ID is resolved server-side in the Astro page via a new getSystemUserId() helper in config.ts and passed down as a prop. Closes #1271 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…trol Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
the test failure is unrelated. idea for a fix here: #1277 |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a client-side segmented filter to the collections overview so users can switch between Community, Official, and All collections, using a centralized system-user ID to distinguish “Official” ownership.
Changes:
- Passes a
systemUserIdvalue from the Astro page into the client component. - Removes backend-side
excludeSystemCollectionsfiltering and filters client-side byownedBy. - Extends browser specs to cover default/community behavior and switching to Official/All.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
website/src/pages/collections/[pathFragment]/index.astro |
Passes systemUserId into the collections overview component. |
website/src/config.ts |
Adds getSystemUserId() helper for staging/prod system user IDs. |
website/src/components/collections/overview/CollectionsOverview.tsx |
Implements client-side filtering and adds the segmented filter UI. |
website/src/components/collections/overview/CollectionsOverview.browser.spec.tsx |
Updates/extends browser tests for the new filter behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+111
to
+133
| return ( | ||
| <div className='flex text-sm'> | ||
| {FILTER_OPTIONS.map((opt, i) => ( | ||
| <Fragment key={opt.value}> | ||
| <input | ||
| type='radio' | ||
| id={`${id}-${opt.value}`} | ||
| name={id} | ||
| className='hidden' | ||
| checked={filter === opt.value} | ||
| onChange={() => onChange(opt.value)} | ||
| /> | ||
| <label | ||
| htmlFor={`${id}-${opt.value}`} | ||
| className={`tooltip w-24 cursor-pointer border p-2 text-center ${i === 0 ? 'rounded-l-md' : '-ml-px rounded-none'} ${i === FILTER_OPTIONS.length - 1 ? 'rounded-r-md' : ''} ${filter === opt.value ? 'border-primary relative z-10' : 'border-gray-300'}`} | ||
| data-tip={opt.tooltip} | ||
| > | ||
| {opt.label} | ||
| </label> | ||
| </Fragment> | ||
| ))} | ||
| </div> | ||
| ); |
Contributor
There was a problem hiding this comment.
https://daisyui.com/components/join/#join-radio-inputs-with-btn-style
This is probably what we want
Comment on lines
+111
to
+115
| /* The system user gets created first by the backend, so if we ever re-create the staging DB, it will be 1 | ||
| * (and is 1 at the moment as well). On prod, the system user is ID 3. */ | ||
| export function getSystemUserId(): number { | ||
| return isStaging() ? 1 : 3; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1271
Summary
[ Community ] [ Official ] [ All ]) to the collections overview pageownedBy; "Community" is the default, preserving current behaviorgetSystemUserId()toconfig.ts(returns1on staging,3on prod); called server-side in the Astro page and passed as a prop so it doesn't reach the browserScreenshot
Screen.Recording.2026-06-11.at.13.45.12.mov
Test plan
🤖 Generated with Claude Code