Repository navigation
fix(web): a Viewer or one-thread Collaborator isn't offered New thread, Fork or Add project - #729
Merged
Merged
Conversation
…d, Fork or Add project A device holds its person's highest level's permissions anywhere on the server, and upstream offers a new thread to every connection, so a Viewer, a Viewer of one thread who writes to another, and a Collaborator on one thread were offered New thread, Fork from this response, Add project and a thread's branch changes, which the server then refused. One J5 rule, sharingAllowsStart in client-runtime, says where a person may start something: a thread or a fork takes the project's level, a project of its own a level at server scope. The web reads it through useCanStartIn, useCanAddProject and useCanForkThread (and readCanStartThreadIn outside a render), called beside each upstream check: the sidebars' New thread buttons and menus, the command palette, the New thread keybindings, the scratch doors, the fork button, and the Add project flow's submit. The git controls' thread-branch changes read useCanOperateThread. Each control is hidden or disabled as that surface already does. FORK.md case 85. Closes #640, closes #641. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…w the person's level Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… start rule - GitActionsControl keeps upstream's permission for the commit dialog's Open in editor buttons; only branch changes read the thread's level. - The New project flow's Create is disabled where the person cannot add a project, with upstream's "This connection cannot add projects." - A grouped project offers a new thread by a checkout that can take one: the palette narrows each group before upstream picks its checkout (startableProjectPicker), and the legacy sidebar's checkout chooser disables checkouts that cannot. - Rows and buttons read one boolean (useCanStartInAny, useCanAddProject, useCanForkThread by the one server's access), so an unrelated access refresh no longer re-renders every project row and fork button. - The legacy row hides its New thread button with `hidden` on upstream's positioning div instead of wrapping the block. - D33 states upstream's baseline accurately; FORK.md case 85 lists each file's actual edits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plain New thread click whose open project refuses a thread starts it in a checkout of the group the person can start in. A project picked from search with no thread creates its draft in a startable checkout, and is listed disabled when it has none. The start read moves to an import-free module so upstream's new-thread helpers no longer load the connection runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jacksondr5
added a commit
that referenced
this pull request
Oct 26, 2026
…re the person can't Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jacksondr5
added a commit
that referenced
this pull request
Oct 26, 2026
Jacksondr5
marked this pull request as ready for review
October 26, 2026 05:00
7 of 8 tasks
Jacksondr5
added a commit
that referenced
this pull request
Nov 23, 2026
Jacksondr5
added a commit
that referenced
this pull request
Nov 23, 2026
This branch was successfully deployed
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.
Problem
A device holds the permissions of its person's highest level anywhere on the server, and upstream hides a control only when a device lacks a permission everywhere. So a Viewer on one thread who is a Collaborator elsewhere, or a Collaborator on a single thread, is still offered New thread, Fork and Add project, and a Viewer is offered changes to a thread's branch. The server refuses each one. Closes #640, closes #641.
What changed
One J5 rule,
sharingAllowsStart(packages/client-runtime/src/j5/sharing.ts): a new thread or a fork in a project is decided by the person's level over that project (projectLevelFor, from #638); a project of their own (Add project, threads without a project) needs a level at server scope. The web reads it through hooks besideuseCanOperateThread(apps/web/src/j5/sharing/access.ts) and, outside a render,readCanStartThreadIn(threadOperability.ts). Until the server says who the connection is, nothing is withheld, as #638 does.Each upstream control calls the rule beside the permission check it already makes, and hides or disables the way upstream does for that control when a permission is missing:
sharingMenu.ts; one line in the legacy sidebar)chat.new/chat.newLocalkeybindings, Shift+click New threaduseCanAddProjectuseCanOperateThread); the commit dialog's "Open file in editor" keeps upstream's permissionLeft as they are, on purpose:
UI changes
Before is
j5/main, after is this PR, on the same test server data. People: Alice is a Viewer of the whole server; Bob is a Viewer on a thread of project P1 and a Collaborator in project P2; Carol is a Collaborator on one thread only; Gus is a Viewer of an empty project; the Owner is the control.After only (states that didn't exist before):
Not captured: the legacy sidebar's checkout chooser for a grouped row (the tester covered grouped checkouts through the palette and the header button instead); "Check out feature branch & continue", which needs a dirty tree on the default branch; the "This connection cannot add projects." tooltip on the disabled Create button, which did not show on hover in the browser panel.
Live testing
Pass, by a Sonnet 5.5 tester on a live-test server (report:
artifacts/test-reports/fix-hide-controls-without-write/68ed60ecdb.md). Befores onj5/main3e67f6bab0. Afters were taken across the review rounds: one7029d0b47(thread menu, Owner menu, Bob's "New thread in…"), on65a78ffc7f(Carol's thread view, palette search, branch picker, commit dialog, Add project, grouped checkouts, Bob in P2), and on68ed60ecdb(thread views, legacy sidebar row, empty-project search rows). Each later commit was checked against the states it changed, and the rest were left because those commits did not touch them.The tester found one door the PR had missed: the thread header's project name, which opens a new draft. It is fixed in
3a73c3f120and re-tested on that head: disabled for Alice and for Bob on a P1 thread, still working for Bob in P2 and for the Owner.Checked per person: sidebar header New thread; legacy sidebar row (Alice); thread menu "New thread on " (Alice, Owner); palette "New thread in…" and search;
chat.new,chat.newLocaland "New thread without a project" keybindings (Alice, Bob, Carol); "Fork from this response"; New project Create (Carol: disabled, Enter and Mod+Enter do nothing); branch picker and commit dialog (Bob); and that each still works where the person may write. The Owner's views are identical before and after.By design: until the server has said who the connection is, just after a page load, nothing is withheld, as #638 does. Not exercised: desktop (it wraps web), mobile (out of scope, #609), relay and tunnel (client-side presentation only, no new requests).
Review: GPT-6-Astra, three rounds. Round 1 found the commit dialog's editor buttons disabled, New project's Create ungated and grouped checkouts mishandled. Round 2 found the header New thread doing nothing for a mixed group and the empty-project search fallback. All were fixed. One round-2 finding was declined: an already-open "New thread in…" submenu keeps its items if access changes while it is open. Access is answered when the client connects, and the server refuses the write anyway. Round 3: nothing blocking.
Upstream impact
Upstream-owned files edited, all under new FORK.md case 85:
Sidebar.tsx,LegacySidebar.tsx,CommandPalette.tsx,lib/chatThreadActions.ts,hooks/useScratchProject.ts,chat/MessagesTimeline.tsx,chat/ChatHeader.tsx,GitActionsControl.tsx,BranchToolbarBranchSelector.tsx, and onevi.mockeach inGitActionsControl.test.tsandGitActionsControl.lifecycle.test.ts.This changes what upstream's product does: upstream offers a new draft to every connection, a read-only one included. Jackson approved this shape on 2026-10-25 (one J5 check beside each upstream check). Register: divergence D33 in
docs/j5/product/upstream.mdgains a line and a history entry.Checklist
sharing.test.ts,sharingMenu.test.ts,startableProjects.test.ts)FORK.md(case text and file-table row) in this PRdocs/j5/product/upstream.mdBuilt by Claude Opus 5.5 in J5 Code (Claude Code harness).
🤖 Generated with Claude Code