feat: make subagent chats read-only

Replaces the composer with a read-only banner for subagent sessions
Keeps permission and question prompts interactive
This commit is contained in:
Bohdan Triapitsyn
2026-05-15 22:24:27 +03:00
parent 9828ddb4b1
commit 1534ad05a9
@@ -538,6 +538,7 @@ export const ChatContainer: React.FC<ChatContainerProps> = ({ autoOpenDraft = tr
{t('chat.container.returnToParent.label')} {t('chat.container.returnToParent.label')}
</Button> </Button>
) : null; ) : null;
const promptReadOnly = readOnly || Boolean(parentSession);
React.useEffect(() => { React.useEffect(() => {
if (autoOpenDraft && !currentSessionId && !draftOpen) { if (autoOpenDraft && !currentSessionId && !draftOpen) {
@@ -764,7 +765,7 @@ export const ChatContainer: React.FC<ChatContainerProps> = ({ autoOpenDraft = tr
: 'bg-background' : 'bg-background'
)} )}
> >
{readOnly ? <ReadOnlyPromptBanner /> : <ChatInput scrollToBottom={resumeToLatestInstant} />} {promptReadOnly ? <ReadOnlyPromptBanner /> : <ChatInput scrollToBottom={resumeToLatestInstant} />}
</div> </div>
</div> </div>
); );
@@ -824,7 +825,7 @@ export const ChatContainer: React.FC<ChatContainerProps> = ({ autoOpenDraft = tr
: 'bg-background' : 'bg-background'
)} )}
> >
{readOnly ? <ReadOnlyPromptBanner /> : <ChatInput scrollToBottom={resumeToLatestInstant} />} {promptReadOnly ? <ReadOnlyPromptBanner /> : <ChatInput scrollToBottom={resumeToLatestInstant} />}
</div> </div>
</div> </div>
); );
@@ -857,7 +858,7 @@ export const ChatContainer: React.FC<ChatContainerProps> = ({ autoOpenDraft = tr
: 'bg-background' : 'bg-background'
)} )}
> >
{readOnly ? <ReadOnlyPromptBanner /> : <ChatInput scrollToBottom={resumeToLatestInstant} />} {promptReadOnly ? <ReadOnlyPromptBanner /> : <ChatInput scrollToBottom={resumeToLatestInstant} />}
</div> </div>
</div> </div>
); );
@@ -905,7 +906,7 @@ export const ChatContainer: React.FC<ChatContainerProps> = ({ autoOpenDraft = tr
onClick={navigation.resumeToLatest} onClick={navigation.resumeToLatest}
/> />
)} )}
{readOnly ? <ReadOnlyPromptBanner /> : <ChatInput scrollToBottom={resumeToLatestInstant} />} {promptReadOnly ? <ReadOnlyPromptBanner /> : <ChatInput scrollToBottom={resumeToLatestInstant} />}
</div> </div>
<TimelineDialog <TimelineDialog