Repository navigation
fix(web): Merge back is disabled where the server would refuse it - #861
Merged
Merged
Conversation
A Viewer, or a Collaborator on the fork or on both threads but not the project, was offered Merge back, which the server admits only by the fork's project. The button now asks the same J5 rule as Fork. Closes #730 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Jacksondr5
added a commit
that referenced
this pull request
Nov 1, 2026
Jacksondr5
marked this pull request as ready for review
November 1, 2026 02:34
|
Warning Review limit reached
This review includes 4 billable files and costs up to $1.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 26 minutes for your next included review. View limit details
|
…needs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 1, 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
Upstream offers "Merge back to" on a fork whenever there is a run to merge, but J5's server admits
thread.merge_backonly to someone who holds Collaborator or Owner over the fork's project. So a Viewer, a Collaborator on the fork only, or a Collaborator on both threads but not the project was offered a button the server refuses. Closes #730.What changed
canMergein upstream'sThreadRelationshipsControl.tsxalso asks a new J5 hook,useCanMergeBack(apps/web/src/j5/sharing/access.ts), for the open fork. It is #729's Fork rule,useCanForkThread, which reads the fork's project, exactly what the server's admission checks (projectOfThread(sourceThreadId), wheresourceThreadIdis the fork), plus upstream's "Operate tasks" permission, which the merge'sdispatchCommandneeds and upstream's button never asked. Upstream's merge command has nopermissionAtom, so the hook reads the permission asuseCanOperateThreadanduseCanAddProjectdo. The button is disabled, not hidden, because its row also shows where the fork came from. Until the server says who the connection is, nothing is withheld, as #729 does.No new test: the decision is
sharingAllowsStart, already covered inpackages/client-runtime/src/j5/sharing.test.ts; this PR only calls it from one more control.The agent-facing
t3_thread_merge_backpath needs nothing: agents' MCP sessions are not a person's and are not narrowed (D33), and a person's own command is refused by the server's admission either way. Mobile is out of scope, with the rest of sharing on mobile (#609). Desktop wraps web and gets the change.UI changes
Before is
j5/main(f5822cde4d), after is this PR, each on its own test server with the same steps. Each person views the fork's Lineage section, whose first row is the source conversation, and the merge icon to the right of that row. A disabled icon is fainter (opacity 0.64). The thread titles are model-generated, so they differ between the two servers.After only:
Not captured: a Collaborator on both threads but not the project. The test script's
guestgives a new person one scope, and the People dialog changes only the level within a scope. That person is held by the same project rule as the thread-only Collaborator. A one-thread person's source row reads as an id and "Unknown" on both sides, because the source isn't shared with them. The project Viewer pair shows the change most clearly.Live testing
Pass, by a Claude Sonnet 5.5 tester on live-test servers for base and head (report:
artifacts/test-reports/fix/merge-back-follows-level/5762bd5d0f.md). Tested commit5762bd5d0f. The head,2407d4eb43, adds the "Operate tasks" check from review. It was not re-tested live: every person captured holds that permission, or lacks it and was already disabled by the level rule, so nothing they see changes. A device paired with a ceiling that leaves the permission out was not reproduced on the test server. Basef5822cde4d, the head's parent:origin/j5/mainmoved to68a9f69229during setup and doesn't touch this control. On each server one real Claude Haiku 5.5 turn ran in a source thread and one in its fork, through the UI. Enabled and disabled were read from the DOM in every tab, not only from the images.Found on base too, so not caused by this PR:
Not exercised: a Collaborator on both threads but not the project (see UI changes); desktop (wraps web); mobile (out of scope, #609); relay and tunnel (client-side presentation only, no new requests). Rows of the skill's "What to cover" judged not to apply: turn path, adapters and MCP tools (untouched); stored state, migrations, startup and peering (untouched).
Upstream impact
Upstream-owned file edited:
apps/web/src/components/chat/ThreadRelationshipsControl.tsx(one import, one hook call, one condition), recorded in FORK.md case 90 (the #729 case; a bullet and a file-table row). This changes what upstream's product does; Jackson approved it on 2026-10-31. Register: divergence D33 indocs/j5/product/upstream.mdgains "a merge back" in its bullet and a history entry.Checklist
sharingAllowsStart, covered bysharing.test.ts; this adds one call siteFORK.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