Skip to content

Commit 1030d44

Browse files
aorwallclaude
andcommitted
fix(web): gate the add-project intent on projectManagement
Upstream pingdotgg#26238 stopped checking `projectCloneTracking`, so adding a project by URL now calls `startProjectClone`, which Moatless does not dispatch. The palette action was already filtered, but `openCommandPalette({ open: "add-project" })` and the pull request list's empty-state button still opened the flow. The gaps entry now records that Moatless folds `context` itself (soaplabs/moatless#1326). Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e82cfb3 commit 1030d44

4 files changed

Lines changed: 32 additions & 27 deletions

File tree

‎apps/web/src/commandPaletteBus.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { EnvironmentId, PullRequestLinkedThreadsResult } from "@t3tools/contracts";
22

33
import { dispatchCommandPalette, isCommandPaletteMounted } from "./commandPaletteStore";
4+
// Fork: gates the add-project intent.
5+
import { FEATURES } from "./fork/features";
46

57
export interface CommandPaletteLinkedThreads {
68
readonly environmentId: EnvironmentId;
@@ -17,6 +19,8 @@ export function openCommandPalette(detail: CommandPaletteOpenDetail = {}): void
1719
// With no palette on screen (e.g. /pair) the request is dropped; kept in the
1820
// store, it would pop a stale palette once the app shell mounts.
1921
if (!isCommandPaletteMounted()) return;
22+
// Fork: every add-project path ends in a method a server without `projectManagement` refuses.
23+
if (detail.open === "add-project" && !FEATURES.projectManagement) return;
2024
if (detail.open === "new-thread-in") {
2125
dispatchCommandPalette({ _tag: "OpenNewThreadIn" });
2226
} else if (detail.open === "add-project") {

‎apps/web/src/components/pullRequest/PullRequestListEmptyState.tsx‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { RefreshIcon } from "~/components/ui/refresh-icon";
22
import { PlusIcon, SearchIcon } from "lucide-react";
33

44
import { openCommandPalette } from "../../commandPaletteBus";
5+
// Fork: gates the Add project button.
6+
import { FEATURES } from "../../fork/features";
57
import { Button } from "../ui/button";
68
import { PullRequestListGhost } from "./PullRequestGhosts";
79
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyTitle } from "../ui/empty";
@@ -78,12 +80,15 @@ export function PullRequestListEmptyState({
7880
Add a project, and the pull requests from its repository appear here.
7981
</EmptyDescription>
8082
</EmptyHeader>
81-
<EmptyContent>
82-
<Button size="sm" onClick={() => openCommandPalette({ open: "add-project" })}>
83-
<PlusIcon className="size-3.5" />
84-
Add project
85-
</Button>
86-
</EmptyContent>
83+
{/* Fork: a server without `projectManagement` cannot add a project. */}
84+
{FEATURES.projectManagement ? (
85+
<EmptyContent>
86+
<Button size="sm" onClick={() => openCommandPalette({ open: "add-project" })}>
87+
<PlusIcon className="size-3.5" />
88+
Add project
89+
</Button>
90+
</EmptyContent>
91+
) : null}
8792
</Empty>
8893
);
8994
}

‎docs/fork/gaps.md‎

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -166,34 +166,28 @@ most `capabilities.X === true` checks in the clients with `serverConfig !==
166166
null`: every protocol-2 server is assumed to support them. Moatless advertises
167167
most (`threadSettlement`, `threadSnooze`, `threadPinning`, `pullRequests`,
168168
`threadPullRequests`, title regeneration), so those surfaces are unchanged.
169-
Three it does not advertise now run unconditionally:
169+
Three it did not advertise now run unconditionally:
170170

171171
- **`inlineMessageContext`** — the composer always sends a turn's context
172172
(terminal, review comment, thread, environment chips) as a separate field;
173-
the legacy path that serialized it into the text is gone
174-
(`useComposerSend.ts`, `useMultipleModelSend.ts`, mobile
175-
`threadOutboxDelivery.ts`). Moatless's `message.dispatch` reads no `context`
176-
field, so a chip a person attaches is dropped with no error.
173+
the client's legacy path that serialized it into the text is gone. Moatless
174+
now folds `context` into the text itself, in the same legacy form
175+
(`crates/t3code/src/message_context.rs`), and advertises the capability.
176+
Against a Moatless older than that change a chip is dropped with no error.
177177
- **`projectCloneTracking`** — adding a project by URL calls
178-
`startProjectClone` / `projectClones` (`CommandPalette.tsx`,
179-
`NewThreadLinkView.tsx`, `state/projectClones.ts`), which Moatless does not
180-
dispatch. `FEATURES.projectManagement` hides the add-project button, but not
181-
every entry point.
178+
`startProjectClone` / `projectClones`, which Moatless does not dispatch.
179+
Moatless lists `projectManagement` unsupported, which removes the palette's
180+
Add project action and, through `commandPaletteBus.ts`, every
181+
`open: "add-project"` intent. The `projectClones` subscription still fails
182+
quietly to an empty list on each connect.
182183
- **`attachmentUploads`** — the composer always takes the signed-upload path.
183-
Moatless reports it only when `session_jwt_secret` is set; a deployment
184+
Moatless reports it only when `SESSION_JWT_SECRET` is set; a deployment
184185
without one has no inline fallback left. `ChatView.tsx` keeps the fork's
185186
capability checks for uploads, file attachments and `questionAttachments`,
186187
but the send path no longer consults them.
187188

188-
This merge kept the fork's checks where a conflict landed on them and did not
189-
restore the deleted ones, which would re-grow code upstream removed across
190-
many files.
191-
192-
- **Closes when:** Moatless reads `context` on `message.dispatch` and advertises
193-
`inlineMessageContext`, dispatches the project-clone methods or hides every
194-
add-by-URL entry, and every deployment sets `session_jwt_secret`. Check with
195-
`grep -n '"context"' crates/t3code/src/v2_commands.rs` in the
196-
backend and `git grep -n 'startProjectClone' apps/web/src`.
189+
- **Closes when:** every deployment sets `SESSION_JWT_SECRET`, and Moatless
190+
answers `projectClones` with an empty list.
197191
- **Then here:** delete this entry, and the capability checks `ChatView.tsx`
198192
still carries for `attachmentUploads` and `questionAttachments`.
199193

‎docs/fork/inventory.json‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,9 +1513,11 @@
15131513
"apps/web/src/components/CommandPalette.tsx",
15141514
"apps/web/src/components/Sidebar.tsx",
15151515
"apps/web/src/components/LegacySidebar.tsx",
1516-
"apps/web/src/components/chat/DraftHeroHeadline.tsx"
1516+
"apps/web/src/components/chat/DraftHeroHeadline.tsx",
1517+
"apps/web/src/commandPaletteBus.ts",
1518+
"apps/web/src/components/pullRequest/PullRequestListEmptyState.tsx"
15171519
],
1518-
"mustSurvive": "Re-apply list filtering gates. FEATURES.projectManagement also hides the New project affordance wherever it is offered: both sidebars and the draft hero's project picker, which upstream grew a New project menu item on 2026-09-05. A Moatless deployment creates projects from its own admin surfaces, so an enabled New project entry here leads nowhere."
1520+
"mustSurvive": "Re-apply list filtering gates. FEATURES.projectManagement also hides the New project affordance wherever it is offered: both sidebars and the draft hero's project picker, which upstream grew a New project menu item on 2026-09-05. A Moatless deployment creates projects from its own admin surfaces, so an enabled New project entry here leads nowhere. The same flag drops `openCommandPalette({ open: \"add-project\" })` in commandPaletteBus.ts, the backstop for every caller of that intent, and hides the pull request list's empty-state Add project button."
15191521
},
15201522
{
15211523
"id": "checkpoint-file-restore-gate",

0 commit comments

Comments
 (0)