Repository navigation
Fix Gallery save toast to use the chosen filename - #15725
Conversation
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. |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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". |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ 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". |
…ency pass (#15747) ## Summary `Shell installer tests` fails on main, so every PR's staging CI run of that lane is red (e.g. #15725, a frontend-only change): ``` FAIL: the rerun check directly follows that dependency pass (expected ' _setup_rerun_if_replaced', got ' _SETUP_VENV_CHANGED=true') Results: 31 passed, 1 failed tests/sh/test_setup_rerun_after_replace.sh exited 1 ``` #15646 (precompile bytecode after setup) added `_SETUP_VENV_CHANGED=true` between `install_python_stack` and `_setup_rerun_if_replaced`, and pinned that order in its own `tests/python/test_installer_compile_bytecode.py`. `tests/sh/test_setup_rerun_after_replace.sh` pins the opposite: the handoff to a replaced `setup.sh` must sit directly behind the dependency pass, so no line of the old copy runs after the update has swapped the file. The two tests now contradict each other on main. Both intents can hold at once: - The flag is a plain local assignment that only feeds the precompile gate near the end of the script. - That gate already fires on `UNSLOTH_SETUP_RERUN=1` too: `if { [ "${_SETUP_VENV_CHANGED:-false}" = true ] || [ "${UNSLOTH_SETUP_RERUN:-}" = 1 ]; }`. So setting it after the handoff changes nothing: - **No replacement:** the flag is set before anything reads it. - **Replacement:** the exec'd new copy precompiles because of `UNSLOTH_SETUP_RERUN` (an unexported shell variable would not have survived the `exec` anyway). ## Change - **`studio/setup.sh`:** `_setup_rerun_if_replaced` moves back directly behind `install_python_stack`. `_SETUP_VENV_CHANGED=true` follows it, still inside the dependency-pass branch, with a one-line comment on why the order is safe. - **`tests/python/test_installer_compile_bytecode.py`:** asserts the handoff is the line right after the dependency pass, and that the flag is set right behind it in the same branch. It keeps the existing checks on the gate and the `UNSLOTH_SETUP_RERUN` fallback. ## Testing - `tests/sh/test_setup_rerun_after_replace.sh`: 31 passed, 1 failed on main; 32 passed with this change. - `tests/python/test_installer_compile_bytecode.py`: 30 passed, on both main and this change. - Every other test that pins this block passes: 12 shell suites and 4 studio pytest files, including `test_setup_full_deps_override.sh`, `test_node_pin_update.sh`, the CUDA / XPU / AMD fast-path escapes and `test_ci_shell_suite_coverage.py`. - `bash -n studio/setup.sh` is clean.
|
@codex review |
1 similar comment
|
@codex review |
Renaming an image in Unsloth Desktop's Save As dialog still showed the suggested filename in the Gallery success toast. The native save command already returns the chosen basename; this change preserves that result through
downloadFile()and uses it in the toast.Existing export wrappers retain their
Promise<void>contracts. Cancellation and errors keep their existing behavior, and browser downloads do not claim a final filename that the browser cannot report.Fixes #15621.
Playwright A/B evidence
Compared merge base
d128b72f72f17bffba7df4d9a0fa748a20680c54with PR head2d09e99cd6fdff56299c1e7be49ed3b36860fdea.Both sides received the simulated native result
renamed-gallery-15621.png:Unsloth_20261028-120000_15621.pngrenamed-gallery-15621.pngAll 10 Playwright cases passed: renamed file, unchanged name, cancellation, save failure, and browser download on each revision. Browser downloads produced the expected 24,798 bytes with matching SHA-256.
The comparison runs the real Gallery, download helper, and backend with a seeded image. Official Tauri mocks provide the native save responses; the startup wrapper is bypassed and unrelated shell commands are stubbed. This A/B does not exercise an OS Save As dialog or a native filesystem write. Browser downloads are exercised directly.
Validation
8222149ee32c1b4706f08c0169a4d1769d7f93ae.Same fix for the Video and audio save toasts
The Video gallery ("Video saved") and audio ("Audio saved") toasts had the same problem: the chunked save (
finish_native_file_save) and the streamed URL save (save_native_file_from_url) already return the chosen basename, butdownloadBlobStreaming,downloadUrlStreaminganddownloadUrldropped it. They now return it likedownloadFile, and both toasts show it. Browser downloads still resolveundefined, so those toasts still only appear in the desktop app. Three new tests cover the helpers; they fail without the change.Desktop toast before / after
Merge base
d128b72f7vs head194c6875e. The Images gallery runs in desktop mode with a stand-in for the native bridge whose Save As answersrenamed-by-user-15621.png, then Download > PNG (lossless). Before:Unsloth_20261028-030000_15621.png. After:renamed-by-user-15621.png.Video and audio, same setup (Video gallery Download > MP4, which streams through the URL save; Audio clip menu > Download, which saves in chunks). Before:
Unsloth_video_20261028-050000_15621.mp4anduidiff audio save toast seed - Text to Speech.wav. After:renamed-by-user-15621.mp4andrenamed-by-user-15621.wav.