fix: bootstrap embedded chat prompting state and review read-only handling

Pass initial subagent prompting settings into embedded chat URLs and views
Prevent inactive embedded chats from stealing focus on load
Treat review sessions as independent conversations when resolving prompt read-only state
This commit is contained in:
Bohdan Triapitsyn
2026-08-13 22:01:11 +03:00
parent e99f6560be
commit a9edc71e06
9 changed files with 80 additions and 17 deletions
@@ -221,6 +221,7 @@ const MemoStatusRow = React.memo(StatusRow);
interface ChatInputProps {
onOpenSettings?: () => void;
scrollToBottom?: () => void;
active?: boolean;
}
const resolveChatDraftIdentity = (sessionId: string | null): ChatDraftIdentity | null => {
@@ -234,7 +235,7 @@ const resolveChatDraftIdentity = (sessionId: string | null): ChatDraftIdentity |
return createChatDraftIdentity(getRuntimeKey(), directory, sessionId);
};
const ChatInputComponent: React.FC<ChatInputProps> = ({ onOpenSettings, scrollToBottom }) => {
const ChatInputComponent: React.FC<ChatInputProps> = ({ onOpenSettings, scrollToBottom, active = true }) => {
const { t } = useI18n();
// Track if we restored a draft on mount (for text selection)
const initialDraftRef = React.useRef<string | null>(null);
@@ -2039,10 +2040,10 @@ const ChatInputComponent: React.FC<ChatInputProps> = ({ onOpenSettings, scrollTo
React.useEffect(() => {
if (currentSessionId && composerRef.current && !isMobile) {
if (active && currentSessionId && composerRef.current && !isMobile) {
composerRef.current.focus();
}
}, [currentSessionId, isMobile]);
}, [active, currentSessionId, isMobile]);
React.useEffect(() => {
if (!isMobile) {