Repository navigation
feat(hub): full-page redesign with trending feed, search, and persisted state - #6349
Conversation
…smatch - bug: a quant with its bytes on disk was marked not fully downloaded when the API-preferred main filenames did not match or the mmproj adapter was absent - fix: fall back to the on-disk quant byte signal, the same one inventory uses for on-device, so a present quant is no longer demoted - broaden mmproj detection to accept any mmproj-looking cached file, not only the API-preferred name
…ed state - convert the hub to a full-page view with a new layout, model cards, and a sortable models table - add a trending/latest/finetune feed with model and section deep-link params validated on the hub route - add recent searches and rework model and dataset search with pagination and infinite scroll - persist feed and token state through a dedicated store and persist-storage layer
There was a problem hiding this comment.
Code Review
This pull request introduces a major redesign and refactoring of the Hub page and catalog components, including a new feed layout with carousels, support for comfortable/compact views, a recent searches panel, and throttled state persistence. On the backend, GGUF variant caching is improved to prevent false demotions. The review feedback is highly constructive, highlighting several key improvement opportunities: resolving a potential data-loss bug in the throttled storage utility by tracking pending writes per key, defensively handling potential null/undefined values in both Python and TypeScript to prevent TypeErrors, conditionally displaying the filter warning in the footer, using the destructured scrollMargin prop directly in the virtualizer, and simplifying the transport toggle tooltip by leveraging Radix UI's uncontrolled behavior.
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.
| export function createThrottledStorage( | ||
| base: StateStorage, | ||
| delayMs: number, | ||
| ): StateStorage { | ||
| let timer: ReturnType<typeof setTimeout> | null = null; | ||
| let pending: { name: string; value: string } | null = null; | ||
| const flush = (): void => { | ||
| if (timer !== null) { | ||
| clearTimeout(timer); | ||
| timer = null; | ||
| } | ||
| if (pending) { | ||
| base.setItem(pending.name, pending.value); | ||
| pending = null; | ||
| } | ||
| }; | ||
| if (typeof window !== "undefined") { | ||
| window.addEventListener("pagehide", flush); | ||
| } | ||
| return { | ||
| getItem: (name) => base.getItem(name), | ||
| setItem: (name, value) => { | ||
| pending = { name, value }; | ||
| if (timer === null) timer = setTimeout(flush, delayMs); | ||
| }, | ||
| removeItem: (name) => { | ||
| pending = null; | ||
| if (timer !== null) { | ||
| clearTimeout(timer); | ||
| timer = null; | ||
| } | ||
| base.removeItem(name); | ||
| }, | ||
| }; |
There was a problem hiding this comment.
The createThrottledStorage utility uses a single pending object reference. If multiple keys are written to the same throttled storage instance within the throttle window, the last write will overwrite pending, causing previous writes to be completely lost. Using a Map to track pending writes per key resolves this data-loss risk and makes the utility fully reusable.
export function createThrottledStorage(
base: StateStorage,
delayMs: number,
): StateStorage {
let timer: ReturnType<typeof setTimeout> | null = null;
const pending = new Map<string, string>();
const flush = (): void => {
if (timer !== null) {
clearTimeout(timer);
timer = null;
}
for (const [name, value] of pending.entries()) {
base.setItem(name, value);
}
pending.clear();
};
if (typeof window !== "undefined") {
window.addEventListener("pagehide", flush);
}
return {
getItem: (name) => base.getItem(name),
setItem: (name, value) => {
pending.set(name, value);
if (timer === null) timer = setTimeout(flush, delayMs);
},
removeItem: (name) => {
pending.delete(name);
base.removeItem(name);
},
};
}| def _quant_bytes_present(quant: str, size_bytes: int) -> bool: | ||
| # Small rounding tolerance for symlinks vs real sizes. | ||
| if size_bytes <= 0: | ||
| return False |
There was a problem hiding this comment.
Defensively handle cases where size_bytes might be None or not a valid integer. In Python, comparing None <= 0 raises a TypeError, which could crash the GGUF variant download-state detection if the size metadata is missing or unresolved.
| def _quant_bytes_present(quant: str, size_bytes: int) -> bool: | |
| # Small rounding tolerance for symlinks vs real sizes. | |
| if size_bytes <= 0: | |
| return False | |
| def _quant_bytes_present(quant: str, size_bytes: Optional[int]) -> bool: | |
| # Small rounding tolerance for symlinks vs real sizes. | |
| if size_bytes is None or size_bytes <= 0: | |
| return False |
| export function DiscoverFetchMoreFooter({ | ||
| scannedCount, | ||
| manualFetchAvailable, | ||
| hasActiveFilters, | ||
| isLoadingMore, | ||
| onFetchMore, | ||
| }: { | ||
| scannedCount: number; | ||
| manualFetchAvailable: boolean; | ||
| hasActiveFilters: boolean; | ||
| isLoadingMore: boolean; | ||
| onFetchMore: () => void; | ||
| }) { | ||
| return ( | ||
| <div className="relative z-10 flex flex-col items-center gap-2 bg-card px-4 py-4 text-center"> | ||
| <p className="text-[11.5px] leading-4 text-muted-foreground"> | ||
| {hasActiveFilters | ||
| ? "Some results may be hidden by your filters." | ||
| : manualFetchAvailable | ||
| ? `Scanned ${scannedCount.toLocaleString()} results. Load more to continue.` | ||
| : "More results are available."} | ||
| Some results may be hidden by your filters. | ||
| </p> |
There was a problem hiding this comment.
The simplified DiscoverFetchMoreFooter now unconditionally displays Some results may be hidden by your filters. even when there are no active filters. This can be highly confusing to users. Consider passing hasActiveFilters as a prop and conditionally rendering this warning.
export function DiscoverFetchMoreFooter({
hasActiveFilters,
isLoadingMore,
onFetchMore,
}: {
hasActiveFilters: boolean;
isLoadingMore: boolean;
onFetchMore: () => void;
}) {
return (
<div className="relative z-10 flex flex-col items-center gap-2 bg-card px-4 py-4 text-center">
{hasActiveFilters && (
<p className="text-[11.5px] leading-4 text-muted-foreground">
Some results may be hidden by your filters.
</p>
)}
| {hasMore && ( | ||
| <DiscoverFetchMoreFooter | ||
| isLoadingMore={isLoadingMore} | ||
| onFetchMore={onFetchMore} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
| function inventoryItemTitle(item: InventoryItem): string { | ||
| return item.variant === "cached" ? item.row.repo : item.row.title; | ||
| } |
There was a problem hiding this comment.
Defensively handle potential missing or undefined repo or title properties on item.row to prevent localeCompare from throwing a TypeError during sorting.
| function inventoryItemTitle(item: InventoryItem): string { | |
| return item.variant === "cached" ? item.row.repo : item.row.title; | |
| } | |
| function inventoryItemTitle(item: InventoryItem): string { | |
| return (item.variant === "cached" ? item.row.repo : item.row.title) ?? ""; | |
| } |
| top: 0, | ||
| left: 0, | ||
| width: "100%", | ||
| transform: `translateY(${virtualRow.start - virtualizer.options.scrollMargin}px)`, |
There was a problem hiding this comment.
Instead of accessing the internal virtualizer.options.scrollMargin property, you can directly use the scrollMargin prop destructured at the top of the component. This is cleaner and less prone to breaking if the internal structure of @tanstack/react-virtual changes.
| transform: `translateY(${virtualRow.start - virtualizer.options.scrollMargin}px)`, | |
| transform: `translateY(${virtualRow.start - scrollMargin}px)`, |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b442866d70
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (isDatasetMode) return discoverRows; | ||
| return discoverRows.filter( | ||
| (row) => | ||
| matchesFormat(detectResultFormat(row.result), deferredFormatFilter) && |
There was a problem hiding this comment.
Apply the section preset before filtering rows
When a user opens or refreshes a section URL such as /hub?section=finetune, handleOpenList never runs, so discoverFormat stays at the default trending gguf value even though the finetune preset is checkpoint. This filter then removes the bnb-4bit checkpoint rows returned by the active channel, leaving the deep-linked fine-tune section empty until the user manually changes the format filter.
Useful? React with 👍 / 👎.
| } | ||
| void navigate({ | ||
| to: "/hub", | ||
| search: (prev) => ({ ...prev, model: id }), |
There was a problem hiding this comment.
Preserve dataset mode in detail URLs
handleSelect is used for dataset rows as well as model rows, but it persists only model=id in the URL. If a user opens a dataset detail and refreshes or shares that URL, the page boots in the default models mode and resolves the dataset id as a model, so the detail view shows missing/wrong metadata instead of the selected dataset. Include the resource type in the search state or avoid writing dataset selections to this model-only param.
Useful? React with 👍 / 👎.
…tence - sort dropdown: drive HF-wide browse across all repos by the chosen sort, respecting format and capability filters - section deep-link: apply the section preset (format and sort) on refresh and deep-link, not only on click - dataset detail URL: persist the resource kind so refresh and share resolve datasets correctly - gguf card: show a Loading state for hub-cache dir-path repos via repo-id match - active-model CTA: New Chat now actually opens a fresh chat - persist-storage: fix throttle keying with a Map and dedupe a duplicated util - transport-toggle: drop redundant controlled-tooltip state
|
2459a7c Addressed some of the review comments, others were hallucinated. Fixed browse sorting and the section and dataset deep-links so they resolve on refresh and share, added a loading state for cached gguf repos, and made the active-model New Chat button open a fresh chat. Also tidied up persist-storage throttling and a redundant tooltip state. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2459a7c597
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| search: (prev) => ({ | ||
| ...prev, | ||
| kind: next === "datasets" ? "datasets" : undefined, | ||
| section: undefined, | ||
| }), |
There was a problem hiding this comment.
Clear stale detail selection when changing resource type
When a user has a model or dataset detail open and then toggles Models/Datasets, this navigation preserves the existing model search param. Because detailOpen is driven only by urlModel, the inspector stays open and reinterprets the old model ID under the new resource type, so a model can be shown as a dataset (or vice versa) with the wrong download/readme actions. Clear model here the same way tab and section changes do.
Useful? React with 👍 / 👎.
| const [fallbackTab, setFallbackTab] = useState<ModelsTab>( | ||
| () => readModelsTabPreference() ?? "downloaded", | ||
| () => readModelsTabPreference() ?? "discover", | ||
| ); | ||
| const tab = urlTab ?? fallbackTab; |
There was a problem hiding this comment.
Open model deep links on Discover by default
Because the tab falls back to the persisted preference, a user who last left Hub on On Device and then opens a valid remote detail URL like /hub?model=unsloth/foo without an explicit tab is immediately kept on downloaded; the downloaded resolver cannot resolve remote-only repos, so the detail overlay shows no model unless that repo is already on disk. When a model deep link is present without tab, prefer Discover (or avoid writing the stored tab over the deep link) so shared/typed model URLs resolve remotely.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41a2689439
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Refinements on top of the hub full-page redesign: - Unify every segmented control (Discover/On Device, models/datasets, Unsloth/All, recent/name/size, settings tabs, train dataset source, profile shape, theme, OS toggle) on one filled-pill design. - Hub list now loads in larger batches with a shorter fetch interval so results fill in fast instead of dripping one row at a time. - Disable remote avatar fetches in list rows and brighten the colored initial fallbacks so they read clearly without network calls. - Add a split master-detail view for model lists and make it the default. - Left-align the split "Showing GGUF models" header with the rows below. - Round the "Load more" footer box and tidy On Device stats layout. - Show recent trainings on Recipes and Export, falling back to recent chats when there is no training history.
|
Pushed a round of UI polish on top of the redesign:
Frontend builds clean. Let me know if anything needs adjusting. |
- DiscoverFetchMoreFooter only shows the "results may be hidden by your filters" note when a filter is actually active, instead of always. - Use the destructured scrollMargin prop directly in the row transform rather than reaching into virtualizer.options.scrollMargin.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 437f3bd3c1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (isDatasetMode) return discoverRows; | ||
| return discoverRows.filter( | ||
| (row) => | ||
| matchesFormat(detectResultFormat(row.result), deferredFormatFilter) && |
There was a problem hiding this comment.
Use the feed channel format for the latest list
On the default Hub feed, liveListChannel is unsloth-latest, whose preset format is all, but this filter still uses the persisted/default discoverFormat initialized from the trending GGUF channel. As a result the “Latest Unsloth Models” list silently drops non-GGUF checkpoint/safetensors repos until the user manually changes the format filter, even though the latest channel is meant to show all latest Unsloth models.
Useful? React with 👍 / 👎.
| const [resourceType, setResourceType] = useState<ResourceTypeFilter>(() => | ||
| hubSearch.kind === "datasets" ? "datasets" : "models", | ||
| ); |
There was a problem hiding this comment.
Sync resource type when the URL kind changes
This only reads hubSearch.kind during the initial mount, so same-route navigation such as toggling Models → Datasets → Models and then using the browser Back button leaves resourceType stuck on the previous state while the URL says kind=datasets. In that case the Hub renders/searches models under a dataset URL (and vice versa) until the user toggles the control again; add an effect or derive this state from hubSearch.kind so back/forward navigation stays consistent.
Useful? React with 👍 / 👎.
| view={allModelsView} | ||
| onViewChange={setAllModelsView} | ||
| onBack={handleBackToFeed} | ||
| actions={splitView ? undefined : ownerToggle} |
There was a problem hiding this comment.
Hide the owner toggle for owner-locked sections
When the user opens a curated section such as Trending or Fine-tune Ready, the active listChannel still carries owner: "unsloth", so useHubModelSearch hard-restricts the request to Unsloth and ignores ownerScope. Showing this toggle in that channel-list header lets the control say All while the results remain Unsloth-only, so hide it for owner-fixed sections or make changing it leave the section.
Useful? React with 👍 / 👎.
| setDiscoverFormat("all"); | ||
| setCapabilityFilter("all"); | ||
| setSortBrowseActive(false); | ||
| setQuery(trimmed); |
There was a problem hiding this comment.
Search base-model chips across all publishers
Clicking a Base model chip keeps the current owner scope, which is unsloth by default. For common base tags like google/gemma... or meta-llama/..., this handler sets the query but leaves useHubModelSearch searching only the Unsloth org, so the promised Hub search often cannot surface the original publisher repo; switch the scope to all for this action or otherwise bypass the owner restriction.
Useful? React with 👍 / 👎.
The split master-pane rows (discover + on device) added a ring-1 around the owner avatar that read as a shadow. Remove it so split-view avatars match the flat avatars elsewhere; grid cards and the full list keep theirs.
Recent/Name/Size and Unsloth/All were segmented controls that dropped to their own row in the narrow split pane. Make each a compact dropdown pill (HubOptionMenu) that sits in the header actions slot next to the view-mode tabs in every layout, so split view no longer needs a separate row.
- Vertically center the "On device" / "Showing GGUF models" title with the dropdown pill and view-mode tabs (items-center instead of items-end), so a short title no longer sits low against the taller tab row. - Nudge the back chevron 2px further left (-ml-2) so its glyph edge lines up with the start of the row hover below it.
The arrow glyph is inset ~6px inside its centered icon box, so an edge-aligned button left the visible chevron sitting in from the column. Pull the button out (-ml-3.5) so the chevron tip lands on the row hover's left edge instead of floating to its right.
Point all plain checkmarks at the canonical @/lib/tick-icon tick (the one already used in the chat composer and menus), so there is a single tick across the app: - Hub: model-inspector, hub-option-menu, path-info-button were importing the stock hugeicons Tick02Icon; switch them to the shared icon. - Chat / assistant-ui: artifact-surface, prompt-storage-dialog, reasoning, tool-ui-python, tool-ui-terminal, tool-ui-code-execution, and the tool-fallback status map used lucide CheckIcon; render the shared tick via HugeiconsIcon instead (tool-fallback wraps it to fit its icon map). The circular CheckmarkCircle success badges are intentionally left as-is. No bare CheckIcon/stock Tick02Icon references remain; verified the tick renders in every converted spot via typecheck + build.
-ml-3.5 pushed the chevron a touch too far left; -ml-3 sits it just inside the row hover edge, aligned with the avatars below.
|
Pushed another round of hub polish and a few fixes:
Frontend typechecks and builds clean. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d94c1d1103
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| # Fall back to the quant's GGUF bytes on disk — the same signal the | ||
| # inventory uses to mark a repo on-device — so a present quant is | ||
| # never demoted by a missing mmproj or a main-filename mismatch. | ||
| return _quant_bytes_present(quant, variant.size_bytes) |
There was a problem hiding this comment.
Require the mmproj before marking vision GGUF variants complete
For vision GGUF repos where the main quant file is present but the mmproj companion is missing and there is no manifest/marker to set is_partial, this fallback now marks the variant downloaded solely from the main quant bytes after the stricter filename+mmproj check failed. The Hub then shows the quant as complete/Run-ready and does not offer to download the missing companion, so the cached vision model is treated as usable without the file the loader needs for vision; keep this byte-only fallback to non-vision requirements or still require an mmproj when requirement.mmproj_filenames is non-empty.
Useful? React with 👍 / 👎.
Clicking a Base model chip searches the Hub for the upstream repo, which lives under another publisher (google, meta, etc.). It left ownerScope at the default "unsloth", so the search hard-restricted to the Unsloth org and could never surface the base model. Switch the scope to "all" for this action.
The focused list heading showed "Showing Checkpoint ... models" while the format dropdown labels the same checkpoint filter value "Safetensors". Match the dropdown so the header reads "Showing Safetensors ... models".
Drop the format/capability composition (e.g. "Showing Safetensors Reasoning models") so the focused list heading just reads "Models" (or "Datasets"). Search keeps its "Results for ..." label.
|
Another small round, mostly addressing review feedback and tidying the list header:
Frontend typechecks and builds clean. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 500f8ec51d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const firstId = isDiscoverTab | ||
| ? listRows[0]?.id | ||
| : (effectiveCachedRows[0]?.id ?? effectiveLocalRows[0]?.id); |
There was a problem hiding this comment.
Select the first visible on-device row
When split view auto-opens on the On Device tab with a search or format filter active, this picks from the raw inventory arrays instead of the filtered rows that the master pane actually renders. If the first cached/local model is filtered out, the detail pane opens on a hidden model (with the “hidden by filters” warning) rather than previewing the first visible row, so the selected detail does not match the split list.
Useful? React with 👍 / 👎.
The detail pane relied on the sticky back-bar's fade, which is now hidden in split view. Add the same hub-scroll-fade overlay the master list uses so the readme fades consistently at the top when scrolled. The back-bar, when shown, sits above and covers it.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Pushed a few functionality-only fixes on top of the redesign. No layout, styling, component, or copy changes, only state and logic:
Verified with typecheck and build green, the backend gguf tests, and a live pass over the Hub (first-load feed, search, download, Models/Datasets back-forward, format switch) with no console errors. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
* Studio: restore sidebar roundness to its pre-#6349 state * Studio: keep train recents as a rounded rectangle, not a pill --------- Co-authored-by: Unsloth <[email protected]>
Full-page redesign of the Hub: trending/latest/finetune feed, recent searches, reworked model and dataset search with pagination and infinite scroll, and a new model card and table layout. Feed and token state persisted client side.
Also fixes GGUF download-state detection so a quant already on disk is not demoted by a missing mmproj adapter or a main-filename mismatch.