Skip to content

Studio: Chat with files X hides the panel, app tooltips, and higher-contrast traces - #13989

Merged
shimmyshimmer merged 11 commits into
mainfrom
studio-rag-panel-header
Oct 16, 2026
Merged

shimmyshimmer merged 11 commits into
mainfrom
studio-rag-panel-header

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

What changed

Chat with files panel

  • The X hides the panel instead of turning RAG off. Retrieval stays on and the composer keeps its RAG tag, so the chat still searches its files. The control is now labelled "Hide files", and the knowledge base panel's X behaves the same way.

  • Show files brings it back. While the panel is hidden, the RAG tag's menu leads with Show files and the chat's file count. Choosing Chat with files in the + menu, picking a source, turning RAG back on, or opening another chat also shows the panel again.

  • Header controls use the app's tooltip (Add files, Collapse / Expand files, Hide files) instead of the browser's title popup.

  • Add files is centred in its pill. Centred by its line box, the cap-height label sat half a pixel high; it now measures within a third of a pixel (9.33px above, 9.67px below at 3x).

  • Header padding follows the smaller Add files pill. The panel's top padding drops 2px (expanded) so the 28px pill keeps its old distance from the top edge, and in the collapsed pill view Add files sits 12px from the top, the same as the file pills from the bottom.

The gaps between Add files, the chevron and the X were measured and are already equal (28px from the pill edge to the chevron glyph, and from the chevron glyph to the X glyph), so they are unchanged.

Thinking and tool traces

Trace ink sits one shade nearer the answer's ink: lighter in dark mode, darker in light mode. --trace-fade drops from 24% to 13% (dark) and 15% to 7% (light), and inside reasoning, tool and tool-group traces the muted text and the citation chip outlines move 15% toward the foreground. Measured on the "Worked for" trigger: OKLab L 0.626 to 0.686 in dark mode, 0.616 to 0.580 in light mode. Hover to the foreground still wins (the trace rule uses :where).

Verification

  • npm run typecheck, npm run build, full npm test (all pass). New tests/rag-panel-hide.test.ts; tests/rag-thread-initialization.test.ts stub gains the new store fields.
  • Isolated Studio: closing the panel leaves the RAG tag in the composer; Show files (with the file count) and the + menu item bring the panel back; padding measured in both panel states; tooltips render in the app style; trace colors measured in both themes with a GGUF model producing a reasoning trace.

Not tested here

Knowledge base retrieval end to end (the KB panel's X uses the same hide path).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T10:41:39.886130Z 6276fba Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: e28d55797b

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 71fb532d11

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

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: cfb9c1ff9a

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

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 16, 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: febab8151e

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

));
const fileCount = documents.length + projectDocuments.length;
useEffect(() => {
useChatRuntimeStore.getState().setRagPanelFileCount(fileCount);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Report the selected knowledge base's file count

When the active retrieval source is a knowledge base, both document hooks above receive a null scope and clear documents and projectDocuments, so this effect publishes zero regardless of how many documents the selected KB contains. After hiding the KB panel, the new Show files item therefore omits its count even though KnowledgeBase.documentCount is available; derive the hidden-panel count from the active KB when ragSource.type === "kb".

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not changing: with a knowledge base active the panel lists no files (it names the KB and links to Manage files), so Show files has no count to mirror; the item still works, it just shows no badge.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 16, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 16, 2026
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 16, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 6276fba0b2

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

@shimmyshimmer
shimmyshimmer merged commit b0e74e7 into main Oct 16, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-rag-panel-header branch October 16, 2026 11:12
shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 16, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 16, 2026
danielhanchen added a commit that referenced this pull request Oct 16, 2026
## Summary

`Frontend build + bundle sanity` is red on main again since #13989,
which merged with it red. Main at 1574001 measures 6,798,138 B raw /
2,044,579 B transfer, against 6,796,959 / 2,044,391 set in #13991.

#13989 is the only frontend change since #13991 (Chat with files closing
on its X, app tooltips, higher-contrast traces). It adds 1,339 B raw /
377 B transfer: 6,796,799 -> 6,798,138 B raw and 2,044,202 -> 2,044,579
B transfer, one machine and build, Node 24, `rm -rf dist` first, chunk
count unchanged at 95.

## Change

The budget is raised by that growth, so main keeps the margin it had
(160 B raw, 189 B transfer), and the measurement is recorded beside the
limits.

## Testing

- `npm run build && npm run bundle:check` on main with this change:
within budget (0.2 KB transfer, 0.2 KB raw to spare). Without it: over
by 1,179 B raw / 188 B transfer.
- `tests/bundle-budget-cli.test.ts` and
`tests/bundle-budget-closure.test.ts`: 43 passed.
- `prettier --check scripts/check-bundle-budget.ts`: clean.
shimmyshimmer added a commit that referenced this pull request Oct 16, 2026
…essage (#13999)

## What changed

Follow-up to #13989, whose last commit landed on its
branch a moment after it was merged.

When you hide the Chat with files panel in a new chat and then send the
first message, the panel now stays hidden. Sending the first message
moves the composer from the welcome screen to the chat dock, which
remounts the files bar; the reset that shows a hidden panel again ran on
every mount, so the panel reappeared in the same chat. The reset now
keys on the last chat id kept outside the component, so only a real
switch to another chat shows the panel again.

## Verification

- `npm run typecheck`, `npm run build`, full `npm test` (all pass);
`tests/rag-panel-hide.test.ts` covers the keyed reset.
- Isolated Studio with a GGUF model: open Chat with files, hide it, send
the first message; after the reply the panel is still hidden and the RAG
tag is still in the composer.
danielhanchen added a commit to LeoBorcherding/unsloth that referenced this pull request Oct 18, 2026
…slothai#14125)

Fixes unslothai#13876

## What changed

In a project chat with Chat with files (RAG) off, the **Project
sources** panel above the composer had a collapse chevron but no way to
close it, so it kept a header and a row of file pills over every project
chat. unslothai#13989 gave the Chat with files and knowledge base panels an X
that hides the panel; this gives the Project sources panel the same X,
labelled **Hide sources**.

- Hiding only hides the panel. The chat still retrieves from the
project's sources, exactly as before.
- It uses the same per-chat hidden state as the other panels, so the
panel comes back when you open another chat, or when you turn on Chat
with files from the + menu (which shows the full files panel, project
sources included). Turning RAG off from the composer tag also shows it
again.
- Nothing else moves: collapse, Show all, the cards and the RAG-on
panels are unchanged.

## Verification

- `tests/rag-panel-hide.test.ts`: the X count goes from 2 to 3 panels,
plus a new test that the RAG-off project panel honours the hidden state
and carries the Hide sources X. Both fail with the component change
reverted and pass with it.
- `npm run typecheck`, full `npm test`, `vite build`.
- Isolated Studios built from the merge base and from this branch,
driven with Playwright (1440x900): a project with one source and a chat
in it, RAG off. Before: the panel has only Collapse files, and is still
there after the scene looks for a close button. After: Hide sources is
in the header, and clicking it removes the panel while the composer
stays.

## Screenshots

Opening the project chat: the same panel on both sides, with the new X
on the right.

![Project chat on
open](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/14125/pr14125_pair_00_q-59c48f5e532f.png)

After clicking Hide sources (no such button before): the panel is gone
and the chat has its space back.

![After Hide
sources](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/14125/pr14125_pair_01_q-d0cdb5ac8ee7.png)
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.

1 participant