Repository navigation
Studio: give a project one home in the sidebar, and fix the row menus around it - #11370
Conversation
… around it Pinned folders render in Pinned instead of sorting to the top of Projects, the Projects nav row steps aside while that section already lists the same folders, and a folder's menu opens one Edit dialog for its name, instructions and linked folders. Two fixes on the way there. A row whose menu was open laid out with a narrower gutter than hover, so a long title ran under the action buttons. And a chat on screen twice, a pinned project chat, mounted two rename inputs, the second stealing focus from the first, whose blur cancelled the rename before a key could be pressed.
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: 3afffee114
ℹ️ 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".
…ges intact Three things the Projects rework got wrong. A payload written before sidebarNavAuto existed already carries a Projects pin the user chose, so only a layout we shipped picks up the automatic rule now; an arranged one keeps what it has. The icon rail hides both folder sections in CSS without unmounting them, so the nav row stays on the rail rather than standing down behind More where nothing else lists projects. And a folder now range-selects within the list its row is in. Pinned folders are rows of Pinned, whose ids the Projects list does not hold, so a Shift-click between two of them found neither endpoint and cleared the selection.
|
All three were right, and are fixed in b2aa10b. Sidebar placement on upgrade. A payload written before The icon rail. Both folder sections carry Folder range selection. Confirmed: Covered by new tests in |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2aa10be13
ℹ️ 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".
… drawn order Three fixes to the sidebar project work, from the review on this PR. PersonalizationCustomization ignores unknown keys, so sidebarNavAuto was stripped from every save and rebuilt from the nav layout on the next load. A user who pinned Projects while the rule was hiding it had that undone on the next hydration, since the layout it was inferred from is still the shipped default. The backend now stores the field, defaulting to None so a record written before it exists stays distinguishable from a user who chose an empty list. A parity test fails on any future customization field the backend does not declare. Pinned folders fell back to pin order, dropping an order the user had already dragged them into while they were rows of Projects. They now read that order until Pinned records one of its own. Pinned draws its folders above its chats, but the published lists still put the standalone pinned chats first, so Next/Previous Chat walked a different sequence than the screen showed. The section publishes its rows as one block, and the Projects section publishes only its own.
|
All three are real, fixed in 29aa390. sidebarNavAuto was not persisted. Pinned folders lost their order. The new scope is empty on the first run, so folders fell back to pin order even though The walk disagreed with the screen. Pinned draws its folders above its chats, but Suite: 8020 frontend tests and the backend personalization tests pass. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
…tter wants (#11374) The sidebarNavAuto validator landed with its signature wrapped across three lines. It fits in one at the configured line length of 100, so the ruff-format-with-kwargs hook rewrites it on every run, reports "files were modified by this hook" and fails. That is why pre-commit.ci has been red on main since #11370, and why every open pull request inherits a red check it did nothing to cause. On a fork-hosted branch the bot cannot push its own fix either, so the failure just sits there. Running the hook after this change leaves the tree untouched.
…11372) * Format the validator unslothai#11370 added, so pre-commit.ci is green again `ruff-format-with-kwargs` runs over the whole tree, so one unformatted signature fails the hook on every open PR rather than only on the one that introduced it. `_validate_sidebar_nav_auto` fits on a single line under the pinned ruff 0.6.9, and this is exactly the output of `python scripts/run_ruff_format.py studio/backend/routes/settings.py`. * Give the desktop release tests an explicit utf-8 encoding The repo's own guard in tests/security fails any read of a checked-in file at the platform default encoding, because it breaks on Windows the moment that file gains a non-ASCII byte. Three reads added with the desktop release work were missing it, which fails `Repo tests (CPU, rest)` on every PR opened against current main, unslothai#11371 and unslothai#11372 included.
… around it (unslothai#11370) * Studio: give a project one home in the sidebar, and fix the row menus around it Pinned folders render in Pinned instead of sorting to the top of Projects, the Projects nav row steps aside while that section already lists the same folders, and a folder's menu opens one Edit dialog for its name, instructions and linked folders. Two fixes on the way there. A row whose menu was open laid out with a narrower gutter than hover, so a long title ran under the action buttons. And a chat on screen twice, a pinned project chat, mounted two rename inputs, the second stealing focus from the first, whose blur cancelled the rename before a key could be pressed. * Studio: pad the project name field's folder glyph off the left edge * Studio: keep an arranged sidebar, the icon rail and pinned folder ranges intact Three things the Projects rework got wrong. A payload written before sidebarNavAuto existed already carries a Projects pin the user chose, so only a layout we shipped picks up the automatic rule now; an arranged one keeps what it has. The icon rail hides both folder sections in CSS without unmounting them, so the nav row stays on the rail rather than standing down behind More where nothing else lists projects. And a folder now range-selects within the list its row is in. Pinned folders are rows of Pinned, whose ids the Projects list does not hold, so a Shift-click between two of them found neither endpoint and cleared the selection. * Studio: store the Projects nav rule, and keep pinned folders in their drawn order Three fixes to the sidebar project work, from the review on this PR. PersonalizationCustomization ignores unknown keys, so sidebarNavAuto was stripped from every save and rebuilt from the nav layout on the next load. A user who pinned Projects while the rule was hiding it had that undone on the next hydration, since the layout it was inferred from is still the shipped default. The backend now stores the field, defaulting to None so a record written before it exists stays distinguishable from a user who chose an empty list. A parity test fails on any future customization field the backend does not declare. Pinned folders fell back to pin order, dropping an order the user had already dragged them into while they were rows of Projects. They now read that order until Pinned records one of its own. Pinned draws its folders above its chats, but the published lists still put the standalone pinned chats first, so Next/Previous Chat walked a different sequence than the screen showed. The section publishes its rows as one block, and the Projects section publishes only its own.
…tter wants (unslothai#11374) The sidebarNavAuto validator landed with its signature wrapped across three lines. It fits in one at the configured line length of 100, so the ruff-format-with-kwargs hook rewrites it on every run, reports "files were modified by this hook" and fails. That is why pre-commit.ci has been red on main since unslothai#11370, and why every open pull request inherits a red check it did nothing to cause. On a fork-hosted branch the bot cannot push its own fix either, so the failure just sits there. Running the hook after this change leaves the tree untouched.
…11372) * Format the validator unslothai#11370 added, so pre-commit.ci is green again `ruff-format-with-kwargs` runs over the whole tree, so one unformatted signature fails the hook on every open PR rather than only on the one that introduced it. `_validate_sidebar_nav_auto` fits on a single line under the pinned ruff 0.6.9, and this is exactly the output of `python scripts/run_ruff_format.py studio/backend/routes/settings.py`. * Give the desktop release tests an explicit utf-8 encoding The repo's own guard in tests/security fails any read of a checked-in file at the platform default encoding, because it breaks on Windows the moment that file gains a non-ASCII byte. Three reads added with the desktop release work were missing it, which fails `Repo tests (CPU, rest)` on every PR opened against current main, unslothai#11371 and unslothai#11372 included.
The sidebar talks about a project in three places at once: the Projects nav row, the Projects section, and the folder row's own menu. This lines them up, and fixes two row bugs found on the way.
Pinned folders belong to Pinned
Pinning a project sorted its folder to the top of Projects, which reads as nothing having happened when the Pinned section right above it holds only chats. A pinned folder now renders in Pinned, chats nested under it as usual, and leaves the Projects list entirely, so it is never in both places.
PINNED_PROJECT_ORDER_SCOPE), so a drag in one section cannot renumber the other's rows.renderedProjectIds,renderedProjectChatItems, the selection guard, the chat walk and Select All all read.The folder row rendering moved into
renderProjectFolderRow(project, index, order)so both sections render the same row.The Projects nav row steps aside while the section is there
The nav row and the section list the same folders one click apart. Both now read one flag:
While the section is showing, the Projects row drops into "More" on its own. It comes back when the section is not there: no projects left, the sidebar organised as one list, or a route the section does not render on. It goes to "More" rather than disappearing, so nothing becomes unreachable.
A toggle in Customize sidebar still wins. The customization now carries
sidebarNavAuto, the rows still following their automatic rule. Flipping the Projects switch writes an explicitpinnedand drops the id from that list, so pinned stays pinned beside the section and off stays off after the last project is deleted. The switch shows the effective placement, so Settings and the sidebar never disagree.A payload written before this field has no entry, so it is read as "never chose" and picks up the rule once. One toggle makes it permanent either way.
One Edit dialog per project
"Rename project" is now "Edit", opening a dialog that holds everything a project is:
updateChatProjectInstructions, which had no caller.Name and instructions write separately so a failed rename cannot discard instructions typed in the same visit, and the drafts reseed per project so one project's text is never saved over another's. The rename dialog's
kind: "project"branch is removed with it, since nothing could reach it any more.The folder menu is now Project home, Pin project, Edit, Move up, Move down, Delete project. "New chat" is gone from it: the row's own pencil is right there and does exactly that.
Folder rows say what they are doing
Folder02Iconwhile the chats are showing,Folder01Iconwhile they are not.shell.navigation.noChatskey, translated across all twelve locales; the existingnoChatsYetstill serves the "no history at all" state in Recents.The chat row's Project submenu
"Move to project" is now "Project", and "Save to project sources" is "Project sources", nested under it directly below "New project":
The rule now means something. Above it are the two rows that act on the chat, below it every row moves it. Project sources previously sat at the bottom, under the destinations it is not one of.
Icons: project sources use
folder-attachmenteverywhere they appear (row menu, project page menu, the reply action, the composer pill), and Link folder uses hugeicons'folder-syncinstead of lucide's, along with the two other places the same icon appears in that panel so they do not read as two different glyphs side by side.Fixes
A row's title ran under its action buttons
group-has-[.sidebar-row-action[data-state=open]]/x:pr-Nis more specific thangroup-hover/x:pr-M, since the:has()argument carries a class and an attribute, so it wins outright when both match. A row hovered with its menu open therefore laid out with the open-state gutter while hover had revealed every action, and that gutter was narrower.Measured in a browser before changing anything: hovered with the menu open, the old
pr-8put the title's right edge 36px past the secondary action's left edge. Both states now reserve the same width, which leaves it 4px clear, and the quick-action beside the kebab is revealed with the open menu so the row stops changing shape depending on where the pointer is.Renaming a project chat did nothing
Not a rename bug. A pinned project chat is two rows at once, one under Pinned and one under its folder, and
isRenamingThismatched on the chat id alone, so both rows mounted anautoFocusinput. The second stole focus, the first firedonBlur, and the blur handler cancelled a rename that was not dirty yet. Reproduced with the real menu component:Both pills gone before a key could be pressed. The rename target now carries the row's list scope, so the row the menu was opened from owns the pill. The keyboard chord still opens the dialog, unchanged.
Tests
tsc -bclean, full suite 8015 pass / 0 fail, eslint unchanged against the pre-existing errors in the touched files.Two new files:
tests/sidebar-row-menu-and-pinned-folders.test.ts, which pins the gutter invariant across every row that carries both variants, the open-menu reveal, the rename scoping, the folder icon and empty row, the submenu order and the Pinned placement. All of these fail against the unfixed source.tests/sidebar-projects-nav-auto.test.ts, covering the nav rule: the row stands down only while the section shows, a choice outlives the rule in both directions, no other id can join the rule (a hand-edited list sanitizes back), and the sidebar and the customizer resolve through the same helper.Four assertions in
keyboard-shortcuts.test.tswere pinned to the old structure and now assert the new one.