Skip to content

Studio: make tab navigation feel immediate - #7271

Merged
danielhanchen merged 6 commits into
unslothai:mainfrom
oobabooga:perf/studio-remote-navigation
Jul 21, 2026
Merged

danielhanchen merged 6 commits into
unslothai:mainfrom
oobabooga:perf/studio-remote-navigation

Conversation

@oobabooga

@oobabooga oobabooga commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

Switching tabs in Unsloth Studio can feel slow, especially when Studio runs on one computer and the browser is on another. Opening Projects from Hub or Chat can take a couple of seconds before the cards appear. Hub, Recipes, and Export can also look like they reload or resize whenever they are reopened.

What changed

First visits now start sooner:

  • Hovering or focusing a sidebar destination preloads its page code and authentication check before the click.
  • Export and Recipes also begin loading their initial data on sidebar intent.
  • Frontend assets are compressed and content-hashed files are cached by the browser. The main JavaScript transfer drops from about 4.48 MB to 1.28 MB with gzip, while the Hub page drops from about 234 KB to 64 KB.
  • The page fade was shortened from 150 ms to 60 ms.

Returning to a page is also faster:

  • Projects, Recipes, and Export keep their latest data instead of returning to an empty loading state.
  • Hub reuses its persisted Latest feed while refreshing it.
  • Refreshes happen in the background, so existing cards and controls remain visible.
  • Ordinary chat activity no longer reloads the project list.

Authentication is still reconciled periodically, protected API requests remain authenticated, and cached Hub results stay scoped to the channel and token that produced them.

Verification

  • TypeScript typecheck passed.
  • Targeted ESLint passed.
  • Production frontend build passed.
  • Focused authentication and chat-history suites passed: 46 tests.
  • Backend middleware suite passed: 26 tests.
  • Live HTTP checks confirmed gzip asset delivery, immutable asset caching, uncached index.html, and a healthy backend.

@oobabooga oobabooga changed the title Studio: make repeated tab switches feel immediate Studio: make tab navigation feel immediate Jul 20, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d4c9fd5d3

ℹ️ 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".

Comment thread studio/frontend/src/features/chat/hooks/use-chat-projects.ts Outdated
Comment thread studio/frontend/src/app/auth-guards.ts Outdated
Comment thread studio/frontend/src/features/hub/hub-page.tsx

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces performance optimizations and caching mechanisms across several frontend features, including auth guards, sidebar navigation preloading, chat projects, data recipes, export checkpoints, and hub feed results. Specifically, it implements request deduplication and in-memory caching to reduce redundant API and database calls. The review feedback suggests guarding the sidebar's route preloading (onIntent) so it does not trigger when a navigation item is disabled, and avoiding setting the loading state during background refreshes in useChatProjects to prevent UI flickering.

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.

Comment thread studio/frontend/src/components/app-sidebar.tsx Outdated
Comment thread studio/frontend/src/features/chat/hooks/use-chat-projects.ts Outdated
@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 6d86c7e09e

ℹ️ 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".

@oobabooga
oobabooga marked this pull request as draft July 20, 2026 20:30
@oobabooga

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 73711ab6be

ℹ️ 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".

@oobabooga
oobabooga marked this pull request as ready for review July 20, 2026 21:57
@oobabooga
oobabooga requested a review from danielhanchen as a code owner July 20, 2026 21:57
@danielhanchen

Copy link
Copy Markdown
Member

Pushed a small follow-up to the assets mount.

GZipMiddleware was also compressing Range requests, so a 206 came back gzip encoded while its Content-Range still described the uncompressed file (for example content-range: bytes 0-1999/4478752 on a 913 byte gzip body). That pairing is inconsistent per RFC 9110.

_AssetGZipMiddleware now serves range requests uncompressed and keeps full gzip for normal whole file fetches, so the perceived speed win is unchanged. Verified against the production build: a normal request is still 200 gzip, and Range: bytes=0-1999 now returns a plain 206 with content-range: bytes 0-1999/4478752 and no content-encoding. Added test_range_request_is_not_compressed; the middleware suite stays green (27 passed).

In practice browsers do not range request the hashed JS and CSS assets, so this is hardening rather than a user facing bug, but it keeps the mount spec correct.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: eb56492ecd

ℹ️ 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".

@danielhanchen
danielhanchen merged commit 27f3473 into unslothai:main Jul 21, 2026
57 of 58 checks passed
danielhanchen added a commit to Sneakr/unsloth that referenced this pull request Jul 21, 2026
Resolves the hub-page.tsx import conflict from unslothai#7271 (immediate tab
navigation). Keeps the PR's chat + hf-token-store imports and adds main's new
hub-feed-store import (isChannelEntryFresh, useHubFeedStore, used by the
merged tab-navigation body); drops main's duplicate hf-token-store import
since the PR already imports hfApiToken/useHfTokenStore from ./stores.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants