Repository navigation
Studio: make the drag preferences test compile, and ask the stricter question - #11503
Merged
Merged
Conversation
Frontend build + bundle sanity is red on main and on every PR that inherits it:
tests/sidebar-row-drag.test.ts(906,17): error TS2352: Conversion of type
'SidebarOrganizationState' to type 'Record<string, unknown>' may be a mistake
because neither type sufficiently overlaps with the other.
Index signature for type 'string' is missing in type 'SidebarOrganizationState'.
Introduced by #11441 (432b4db), which added both the test and the store change
it guards. Its own Frontend build lane failed at the time, so main inherited it.
The PR's intent is right: the three drag preference keys are gone on purpose and
should not come back. What is wrong is only the test's cast. SidebarOrganizationState
has no index signature, so `as Record<string, unknown>` is a conversion tsc refuses,
and a test that does not compile guards nothing.
Rather than widen the cast through unknown, the loop now asks `key in state`. That
needs no cast at all, and it is the stricter question: the old indexed read also
passed for a key that came back holding undefined, which is still the key being
back in the store.
Verified: tsc -p tsconfig.test.json and tsc -b are both clean, where the first
failed before, and the file is 25 passed under node --test. Sabotage check:
putting dragHints back on the interface and in the initial state fails this test
with "dragHints is back in the store".
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. |
Member
Author
|
@codex review |
Member
Author
|
@codex security review |
Member
Author
|
@codex review |
1 similar comment
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
…unslothai#11503) Frontend build + bundle sanity is red on main and on every PR that inherits it: tests/sidebar-row-drag.test.ts(906,17): error TS2352: Conversion of type 'SidebarOrganizationState' to type 'Record<string, unknown>' may be a mistake because neither type sufficiently overlaps with the other. Index signature for type 'string' is missing in type 'SidebarOrganizationState'. Introduced by unslothai#11441 (432b4db), which added both the test and the store change it guards. Its own Frontend build lane failed at the time, so main inherited it. The PR's intent is right: the three drag preference keys are gone on purpose and should not come back. What is wrong is only the test's cast. SidebarOrganizationState has no index signature, so `as Record<string, unknown>` is a conversion tsc refuses, and a test that does not compile guards nothing. Rather than widen the cast through unknown, the loop now asks `key in state`. That needs no cast at all, and it is the stricter question: the old indexed read also passed for a key that came back holding undefined, which is still the key being back in the store. Verified: tsc -p tsconfig.test.json and tsc -b are both clean, where the first failed before, and the file is 25 passed under node --test. Sabotage check: putting dragHints back on the interface and in the initial state fails this test with "dragHints is back in the store".
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.
What
Frontend build + bundle sanityis red on main, and on every PR that inherits it (11501, 11500, 11489, 11486, 11485):Where it came from
git blameputs the line in #11441 (432b4db69), which added both this test and the store change it guards. That PR's ownFrontend build + bundle sanitylane failed, so main inherited the break rather than the test ever having worked.Which side is wrong
The PR's intent is right and stays:
dragHints,reorderSwitchesSortanddragOpensFoldersare gone on purpose and must not come back.What is wrong is only the test's cast.
SidebarOrganizationStatehas no index signature, soas Record<string, unknown>is a conversion tsc refuses outright, and a test that does not compile guards nothing.The change
Rather than widen the cast through
unknown, the loop now askskey in state. That needs no cast at all, and it is the stricter question: the old indexed read also passed for a key that came back holdingundefined, which is still the key being back in the store.Test-only. No product file is touched.
Verification
tsc -p tsconfig.test.jsonandtsc -bare both clean, where the first failed before.node --experimental-strip-types --test.dragHintsback on the interface and in the store's initial state fails this test withdragHints is back in the store.