Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
5807d2e
feat(web): a member can give a guest Collaborate
Jacksondr5 Oct 13, 2026
89e3a1d
feat(web): what a guest's composer leaves out, as J5's own answers
Jacksondr5 Oct 13, 2026
b8131fa
feat(web): a guest is not offered Stop
Jacksondr5 Oct 13, 2026
fae1598
feat(web): a guest changes their own queued message
Jacksondr5 Oct 13, 2026
0918b3e
feat(web): a guest's composer offers no attachments
Jacksondr5 Oct 13, 2026
07559de
feat(web): a guest's composer offers no mention, skill or command menu
Jacksondr5 Oct 13, 2026
2cd8ea6
feat(web): a guest's send button never reads as steering
Jacksondr5 Oct 13, 2026
78b0487
feat(web): a guest approves or declines one request, and no more
Jacksondr5 Oct 13, 2026
cb0f870
fix(web): a question's Dismiss is disabled for a connection that cann…
Jacksondr5 Oct 13, 2026
d5fad91
feat(web): who wrote each message of a shared conversation, from the …
Jacksondr5 Oct 13, 2026
acbd8ae
feat(web): a shared conversation's queue shows who wrote what, and a …
Jacksondr5 Oct 13, 2026
840dc1a
docs: record the collaborate client's upstream edits (FORK case 75)
Jacksondr5 Oct 13, 2026
2ddcc93
feat(web): a guest is not offered "Edit from here"
Jacksondr5 Oct 13, 2026
c8d1c0e
test(web): the author fixtures carry the record's note field
Jacksondr5 Oct 13, 2026
ea5a427
docs: record the collaborate client's upstream edits as FORK case 76
Jacksondr5 Oct 13, 2026
cdc37e1
feat(web): a guest's composer offers mentions and context again, and …
Jacksondr5 Oct 14, 2026
f3b5cf5
docs: FORK case 76 as approved, without the menu and queued-edit edits
Jacksondr5 Oct 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions FORK.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion apps/web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { feedbackBannerItem } from "./chat/ComposerFeedback";
import { usageLimitsBannerItem } from "./chat/ComposerUsageLimits";
import { CrewRosterGate } from "../j5/crew/CrewRosterGate";
import { useCanOperateThread } from "../j5/sharing/guestAccess";
import { useMayInterruptThread } from "../j5/sharing/guestComposer";
import { expandPlaybookPrompt } from "@t3tools/client-runtime/j5/playbooks";
import { PlaybookBoard } from "../j5/playbooks/PlaybookBoard";
import { getTerminalLabel } from "@t3tools/shared/terminalLabels";
Expand Down Expand Up @@ -4580,8 +4581,10 @@ export default function ChatView(props: ChatViewProps) {
const focusComposer = useCallback(() => {
composerRef.current?.focusAtEnd();
}, [composerRef]);
// J5: a guest who may write to a shared thread still never stops a run.
const canInterruptRunningThread =
canOperateThread && deriveCanInterruptRunningThread(activeThread !== undefined, activeRuntime);
useMayInterruptThread(environmentId, canOperateThread) &&
deriveCanInterruptRunningThread(activeThread !== undefined, activeRuntime);
const onInterrupt = useCallback(async () => {
if (
!activeThread ||
Expand Down
7 changes: 5 additions & 2 deletions apps/web/src/components/chat/ChatComposer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useGuestComposer } from "../../j5/sharing/guestComposer";
import { useViewOnlyComposerProps } from "../../j5/sharing/viewOnlyComposer";
import { formatProviderSkillDisplayName } from "@t3tools/shared/inlineSkills";
import { useAgentMentionPicker } from "../../j5/agents/useAgentMentionPicker";
Expand Down Expand Up @@ -1827,6 +1828,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
onRemoveEditingQueuedAttachment,
} = props;
const viewOnlyComposerProps = useViewOnlyComposerProps(environmentId, canOperateThread);
const guestComposer = useGuestComposer(environmentId);
const isLiteralPendingAnswer = activePendingProgress?.activeQuestion?.initialAnswer !== undefined;
const primaryEnvironmentId = usePrimaryEnvironmentId();
const composerDraftTargetKey = composerTargetKey(composerDraftTarget);
Expand Down Expand Up @@ -5878,6 +5880,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
},
): Promise<boolean> => {
if (!activeThreadId || files.length === 0 || isRevertingCheckpointRef.current) return false;
if (guestComposer.refusesFiles()) return false;
if (
pendingUserInputs.length > 0 &&
(!supportsQuestionAttachments ||
Expand Down Expand Up @@ -6863,7 +6866,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
isResponding={respondingRequestIds.includes(
activePendingApproval.requestId,
)}
options={activePendingApproval.options}
options={guestComposer.approvalOptions(activePendingApproval.options)}
canRespond={activePendingApproval.responseCapability === "live"}
onRespondToApproval={onRespondToApproval}
/>
Expand Down Expand Up @@ -7742,7 +7745,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
pendingAction={pendingPrimaryAction}
isRunning={phase === "running"}
canInterrupt={canInterrupt}
followUpBehavior={settings.followUpBehavior}
followUpBehavior={guestComposer.followUpBehavior(settings.followUpBehavior)}
alternateShortcutLabel={shortcutLabelForCommand(
keybindings,
"composer.sendAlternate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,18 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
render={<span role="button" tabIndex={0} />}
aria-label="Dismiss question without answering"
title="Dismiss question without answering"
disabled={isResponding}
disabled={isResponding || disabled}
data-pending-user-input-dismiss
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
onDismiss(prompt.requestId);
if (!disabled) onDismiss(prompt.requestId);
}}
onKeyDown={(event) => {
if (event.key !== "Enter" && event.key !== " ") return;
event.preventDefault();
event.stopPropagation();
onDismiss(prompt.requestId);
if (!disabled) onDismiss(prompt.requestId);
}}
/>
) : null}
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/components/chat/MessagesTimeline.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useIsGuest } from "../../j5/sharing/guestAccess";
import { ThreadFindTimelineContext } from "./ThreadFindProvider";
import { shouldPreserveAssistantLineBreaks } from "@t3tools/shared/markdownPipeline";
import { MarkdownFindContext, useFindRevealRef } from "./markdownFindContext";
Expand Down Expand Up @@ -2732,6 +2733,8 @@ function RevertUserMessageButton({
}) {
const ctx = use(TimelineRowCtx);
const activity = use(TimelineRowActivityCtx);
// J5: a guest cannot rewind a thread; the server refuses it, so it is not offered.
if (useIsGuest(ctx.threadRef?.environmentId ?? null)) return null;

return (
<Tooltip>
Expand Down
20 changes: 15 additions & 5 deletions apps/web/src/components/chat/QueuedRunsControl.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useSharedQueue } from "../../j5/sharing/sharedConversation";
import { scopeThreadRef } from "@t3tools/client-runtime/environment";
import { deriveThreadQueueWorkflowState } from "@t3tools/client-runtime/state/thread-workflows";
import { replaceComposerContextReferences } from "@t3tools/shared/composerContextReferences";
Expand Down Expand Up @@ -93,7 +94,7 @@ export function QueuedRunsControl({
);
const queued = workflow?.queuedRuns ?? [];
const activeRun = workflow?.activeRun ?? null;
const canReorder = workflow?.canReorder === true;
const canReorderAsBuilt = workflow?.canReorder === true;
const queuedImageAttachmentIds = useMemo(() => {
const ids: string[] = [];
for (const { attachments } of workflow?.queuedRuns ?? []) {
Expand Down Expand Up @@ -135,7 +136,7 @@ export function QueuedRunsControl({
const optimisticQueued = props.optimisticMessages.filter(
(message) => message.inputIntent === "queued_turn" && !acknowledgedMessageIds.has(message.id),
);
const items = [
const queuedItems = [
...queued.map(({ run, text, attachments }, serverIndex) => ({
key: run.id,
runId: run.id,
Expand Down Expand Up @@ -169,6 +170,10 @@ export function QueuedRunsControl({
pending: true,
})),
];
// J5: in a shared conversation each message shows who wrote it, and a guest changes only their own.
const sharedQueue = useSharedQueue(props.environmentId, props.threadId, queuedItems);
const items = sharedQueue.items;
const canReorder = canReorderAsBuilt && sharedQueue.mayReorder;
const participantLabels = useParticipantLabels(
props.environmentId,
items.flatMap((item) => participantIdsForThreadA2AEnvelope(item.text)),
Expand Down Expand Up @@ -281,7 +286,7 @@ export function QueuedRunsControl({
<ComposerBanner.Scroll className={cn("max-h-32", !expanded && "hidden")}>
<ComposerBanner.Children render={<ol />} id={queueListId}>
{items.map((item) => {
const previewText = replaceComposerContextReferences(item.text, (reference) =>
const previewText = replaceComposerContextReferences(item.preview, (reference) =>
reference.kind === "image" && item.thumbnails.length > 0 ? "" : reference.label,
).trim();
const delivery = formatThreadA2AQueuedDelivery(item.text, participantLabels);
Expand Down Expand Up @@ -434,7 +439,9 @@ export function QueuedRunsControl({
size="icon-xs"
variant="ghost-muted"
aria-label="Edit queued message"
disabled={item.runId === null || busyRunId !== null}
disabled={
item.runId === null || busyRunId !== null || !item.mayChange
}
onClick={() => {
if (item.runId !== null && item.messageId !== null) {
props.onEditQueuedRun({
Expand Down Expand Up @@ -462,6 +469,7 @@ export function QueuedRunsControl({
disabled={
item.runId === null ||
busyRunId !== null ||
!item.maySteer ||
!workflow?.canPromoteToSteer
}
onClick={() => {
Expand All @@ -485,7 +493,9 @@ export function QueuedRunsControl({
render={
<ComposerBanner.Dismiss
aria-label="Remove queued message"
disabled={item.runId === null || busyRunId !== null}
disabled={
item.runId === null || busyRunId !== null || !item.mayChange
}
onClick={() => {
if (item.runId !== null) void remove(item.runId);
}}
Expand Down
75 changes: 36 additions & 39 deletions apps/web/src/j5/sharing/LevelControl.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { EnvironmentId } from "@t3tools/contracts";
import type { SharingGrant, SharingGrantLevel, SharingPerson } from "@t3tools/contracts/j5";

import { Badge } from "../../components/ui/badge";
import {
Select,
SelectItem,
Expand All @@ -10,21 +9,16 @@ import {
SelectValue,
} from "../../components/ui/select";
import { toastManager } from "../../components/ui/toast";
import { Tooltip, TooltipPopup, TooltipTrigger } from "../../components/ui/tooltip";
import { useAtomCommand } from "../../state/use-atom-command";
import { levelLabel } from "./shareLink.logic";
import { openSharingDialog } from "./sharingDialogs";
import { refreshSharing, refusalMessage, sharingManage } from "./sharingManage";
import { showReturnedPerson } from "./returnedPeople";

/**
* Whether a guest can be raised to Collaborate yet. Nothing lets a guest send to an agent today,
* so the level is listed and cannot be chosen, as in the Share dialog.
*/
const COLLABORATE_IS_OFFERED = false;

/**
* The level one person holds on one project or thread. A person who typed their own name cannot
* be given Collaborate until a member confirms it (Shared server AC27), so their control says so.
* The level one person holds on one project or thread. Lowering to View happens at once. Raising
* to Collaborate opens the dialog that says what it allows and, for a person who typed their own
* name, confirms it first (Shared server AC27).
*/
export function LevelControl({
environmentId,
Expand All @@ -40,6 +34,19 @@ export function LevelControl({
const putGrant = useAtomCommand(sharingManage.putGrant, { reportFailure: false });
const change = async (level: SharingGrantLevel) => {
if (level === grant.level) return;
if (level === "collaborate") {
openSharingDialog({
kind: "promote",
environmentId,
person: {
personId: person.personId,
name: person.displayName ?? "this person",
nameSelfGiven: person.nameSelfGiven,
},
target: grant.target,
});
return;
}
const result = await putGrant({
environmentId,
input: { personId: person.personId, target: grant.target, level },
Expand All @@ -54,35 +61,25 @@ export function LevelControl({
refreshSharing(environmentId);
};

const control = (
<Select
value={grant.level}
disabled={!canManage || person.nameSelfGiven}
onValueChange={(value) => void change(value as SharingGrantLevel)}
>
<SelectTrigger size="xs" aria-label="Level">
<SelectValue>{levelLabel(grant.level)}</SelectValue>
</SelectTrigger>
<SelectPopup align="end" alignItemWithTrigger={false}>
<SelectItem hideIndicator value="view">
View
</SelectItem>
<SelectItem hideIndicator value="collaborate" disabled={!COLLABORATE_IS_OFFERED}>
Collaborate
{COLLABORATE_IS_OFFERED ? null : (
<Badge variant="outline" size="sm">
coming soon
</Badge>
)}
</SelectItem>
</SelectPopup>
</Select>
);
if (!person.nameSelfGiven || !canManage) return <div className="w-36 shrink-0">{control}</div>;
return (
<Tooltip>
<TooltipTrigger render={<div className="w-36 shrink-0" />}>{control}</TooltipTrigger>
<TooltipPopup side="top">Confirm their name first</TooltipPopup>
</Tooltip>
<div className="w-36 shrink-0">
<Select
value={grant.level}
disabled={!canManage}
onValueChange={(value) => void change(value as SharingGrantLevel)}
>
<SelectTrigger size="xs" aria-label="Level">
<SelectValue>{levelLabel(grant.level)}</SelectValue>
</SelectTrigger>
<SelectPopup align="end" alignItemWithTrigger={false}>
<SelectItem hideIndicator value="view">
View
</SelectItem>
<SelectItem hideIndicator value="collaborate">
Collaborate
</SelectItem>
</SelectPopup>
</Select>
</div>
);
}
Loading
Loading