Repository navigation
Fix Hub On Device Selection Across Refresh and Download Changes - #9922
danielhanchen merged 23 commits into
Conversation
Keep cached and local HF-cache identities resolvable while resume and cancellation swap the inventory row source. Canonicalize optimistic IDs, preserve legacy raw-ID links, and keep On Device details attached to the current row.
|
Confirmed this hits selection-resolution.ts where the downloaded selection is matched by exact row id, so the On Device selection is dropped when a download transitions between the local cache row and the hub cache row. Will get this reviewed. |
|
The reported problem is real and in scope. On merge base I found and fixed these concrete gaps in the original implementation:
Focused validation:
|
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cb3efd1b5
ℹ️ 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".
| if ( | ||
| !isDiscoverTab && | ||
| resolvedSelectedId && | ||
| resolvedSelectedId !== urlModel | ||
| ) { | ||
| return { action: "replace", selectedId: resolvedSelectedId }; |
There was a problem hiding this comment.
Preserve a cleared URL on the downloaded tab
When the downloaded tab has inventory rows but no model query parameter, resolveDownloadedSelection still resolves the first row while selectionInputId and urlModel are both null. This branch then returns replace, repopulating the URL and opening the detail overlay; after “Back to Hub” clears the URL, the same sequence immediately reopens a model. Only rewrite the URL when resolving an existing non-null selection identity, leaving the explicit null state intact.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The premise does not hold: resolveDownloadedSelection returns null when selectedId is null because all three transition resolvers reject a null id. The only first-row fallback is the split-view preview effect, and Back to Hub exits split view before clearing the URL.
|
Post-push review and CI update Fixed in
Verification:
|
|
Pass 2 found and fixed two additional selection bugs in 7e487aa:
Exact-head verification passed:
Both review threads were answered and resolved. The single full fork suite was already completed before this focused pass; its ten failures were proven unchanged or outside the PR diff. |
|
Pass 3 found and fixed the remaining scoped adoption gap in cab2a4f. Persisted pre-change scoped jobs and probeAndAdopt now infer inventory kind from their backend file list through the same startJob path. Explicit caller classification still wins. Exact-head verification passed:
The review thread was answered and resolved. |
|
Before/after evidence for the On Device selection fix, from two isolated Studio installs: the merge base The scenario is the one this PR is about. On Device holds a single unclassified partial of
The last two rows are the control. The row list and the running BF16 job are identical on both halves, and so is One detail worth recording for anyone reproducing this. Cancelling a download through the Hub API does not leave an unclassified row: the cancel writes a variant-keyed state file that Cross-platform and cross-engine runs on the current head, all green:
|
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
The comment pass removed 100 lines from hub-page.tsx, which overlaps the hunks fe76559 changed on main, so the branch stopped merging cleanly. The other fifteen files keep their reduction.
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |


Fixed
The implementation uses local inventory data only. It adds no network dependency, filesystem behavior, or platform-specific logic.