Skip to content

Commit f40c7af

Browse files
Fix input size on Studio Code Agent and hide articaft panel on landing (#485)
Signed-off-by: Henrique Tolentino <htolentino@nvidia.com>
1 parent 86df58d commit f40c7af

8 files changed

Lines changed: 43 additions & 10 deletions

File tree

web/packages/common/src/components/AssistantChat/AssistantChatThread.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const AssistantChatThread = ({
4545
composerOverride,
4646
messageContentProps,
4747
enableImageAttachments,
48+
minInputRows,
4849
}: AssistantChatThreadProps) => {
4950
const { className: threadViewportClassName, ...threadViewportAttributes } =
5051
attributes?.ThreadViewport ?? {};
@@ -122,6 +123,7 @@ export const AssistantChatThread = ({
122123
onReset={onReset}
123124
slotComposerStart={slotComposerStart}
124125
enableImageAttachments={enableImageAttachments}
126+
minInputRows={minInputRows}
125127
/>
126128
)}
127129
</Flex>

web/packages/common/src/components/AssistantChat/AssistantComposer.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ import { ArrowUp, ImagePlus, RotateCcw, Square } from 'lucide-react';
1010

1111
type AssistantComposerProps = Pick<
1212
AssistantChatThreadProps,
13-
'disabled' | 'placeholder' | 'onReset' | 'slotComposerStart' | 'enableImageAttachments'
13+
| 'disabled'
14+
| 'placeholder'
15+
| 'onReset'
16+
| 'slotComposerStart'
17+
| 'enableImageAttachments'
18+
| 'minInputRows'
1419
> & {
1520
className?: string;
1621
};
@@ -22,6 +27,7 @@ export const AssistantComposer = ({
2227
slotComposerStart,
2328
className,
2429
enableImageAttachments = true,
30+
minInputRows,
2531
}: AssistantComposerProps) => (
2632
<div className="flex w-full flex-col gap-2">
2733
{slotComposerStart && <div className="shrink-0">{slotComposerStart}</div>}
@@ -40,6 +46,7 @@ export const AssistantComposer = ({
4046
disabled={disabled}
4147
placeholder={placeholder}
4248
submitMode="enter"
49+
minRows={minInputRows}
4350
className="max-h-32 min-h-[24px] flex-1 resize-none border-0 bg-transparent px-density-md py-density-md text-sm leading-6 outline-none disabled:cursor-not-allowed disabled:text-fg-disabled"
4451
/>
4552
{enableImageAttachments && (

web/packages/common/src/components/AssistantChat/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export interface AssistantChatThreadProps {
4848
composerOverride?: ReactNode;
4949
messageContentProps?: AssistantChatMessageContentProps;
5050
enableImageAttachments?: boolean;
51+
minInputRows?: number;
5152
}
5253

5354
export interface AssistantChatProps {

web/packages/studio/src/routes/DashboardLandingRoute/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export const DashboardLandingRoute: FC = () => {
162162
);
163163

164164
return (
165-
<ClaudeCodeLayout>
165+
<ClaudeCodeLayout hideArtifacts>
166166
<AccessibleTitle title="Dashboard">
167167
<GradientBackground className="h-full w-full">
168168
<main className="relative flex h-full w-full items-center justify-center px-4 py-10 text-primary">

web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeChatThread.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export const ClaudeCodeChatThread: FC<ClaudeCodeChatThreadProps> = ({
163163
},
164164
}}
165165
placeholder="Ask Claude Code to work in this workspace"
166+
minInputRows={3}
166167
onReset={handleChatReset}
167168
showRunningIndicator={!studioNavigationRequest && !decisionRequest && !inputRequest}
168169
messageContentProps={MESSAGE_CONTENT_PROPS}

web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeHistoryPanel.tsx

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ import { SkillsPanelContents } from '@studio/routes/agents/ClaudeCodeChatRoute/h
1010
import type { ClaudeCodeHistoryPanelProps } from '@studio/routes/agents/ClaudeCodeChatRoute/historyPanel/types';
1111
import { useLocalStorage } from '@studio/util/hooks/useLocalStorage';
1212
import { CLAUDE_CODE_HISTORY_OPEN_KEY, CLAUDE_CODE_PANEL_TAB_KEY } from '@studio/util/localStorage';
13-
import { PanelRightOpen } from 'lucide-react';
13+
import { PanelRightClose, PanelRightOpen } from 'lucide-react';
1414
import { type FC } from 'react';
1515

16-
export const ClaudeCodeHistoryPanel: FC<ClaudeCodeHistoryPanelProps> = (props) => {
16+
export const ClaudeCodeHistoryPanel: FC<ClaudeCodeHistoryPanelProps> = ({
17+
hideArtifacts,
18+
...props
19+
}) => {
1720
const [historyOpen, setHistoryOpen] = useLocalStorage(CLAUDE_CODE_HISTORY_OPEN_KEY, 'true');
1821
const [panelTab, setPanelTab] = useLocalStorage(CLAUDE_CODE_PANEL_TAB_KEY, 'history');
1922
const isOpen = historyOpen !== 'false';
@@ -44,12 +47,14 @@ export const ClaudeCodeHistoryPanel: FC<ClaudeCodeHistoryPanelProps> = (props) =
4447

4548
return (
4649
<aside className="flex min-h-80 w-full shrink-0 flex-col border-t border-base bg-surface-base lg:w-[30rem] lg:border-l lg:border-t-0 xl:w-[32rem]">
47-
<ClaudeCodeArtifactsPane
48-
artifacts={props.artifacts}
49-
collapseLabel={toggleLabel}
50-
onCollapse={() => setHistoryOpen('false')}
51-
/>
52-
<section className="flex min-h-0 basis-1/2 flex-col">
50+
{!hideArtifacts && (
51+
<ClaudeCodeArtifactsPane
52+
artifacts={props.artifacts}
53+
collapseLabel={toggleLabel}
54+
onCollapse={() => setHistoryOpen('false')}
55+
/>
56+
)}
57+
<section className={`flex min-h-0 flex-col ${hideArtifacts ? 'flex-1' : 'basis-1/2'}`}>
5358
<Flex
5459
align="center"
5560
justify="between"
@@ -63,6 +68,19 @@ export const ClaudeCodeHistoryPanel: FC<ClaudeCodeHistoryPanelProps> = (props) =
6368
items={PANEL_TAB_ITEMS}
6469
className="min-w-0 flex-1"
6570
/>
71+
{hideArtifacts && (
72+
<Tooltip slotContent={toggleLabel} side="left">
73+
<Button
74+
aria-label={toggleLabel}
75+
kind="tertiary"
76+
size="small"
77+
type="button"
78+
onClick={() => setHistoryOpen('false')}
79+
>
80+
<PanelRightClose size={18} />
81+
</Button>
82+
</Tooltip>
83+
)}
6684
</Flex>
6785
<div className="flex min-h-0 flex-1 flex-col">
6886
{selectedTab === 'history' ? (

web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/ClaudeCodeLayout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ interface ClaudeCodeLayoutProps {
1414
activeSessionId?: string;
1515
artifacts?: ClaudeCodeChatArtifacts;
1616
children: ReactNode;
17+
hideArtifacts?: boolean;
1718
onNewChat?: () => void;
1819
}
1920

2021
export const ClaudeCodeLayout: FC<ClaudeCodeLayoutProps> = ({
2122
activeSessionId,
2223
artifacts,
2324
children,
25+
hideArtifacts,
2426
onNewChat,
2527
}) => {
2628
const workspace = useWorkspaceFromPath();
@@ -46,6 +48,7 @@ export const ClaudeCodeLayout: FC<ClaudeCodeLayoutProps> = ({
4648
<ClaudeCodeHistoryPanel
4749
activeSessionId={activeSessionId}
4850
artifacts={artifacts}
51+
hideArtifacts={hideArtifacts}
4952
onNewChat={handleNewChat}
5053
onSelectSession={handleSelectSession}
5154
/>

web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/historyPanel/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { ClaudeCodeChatArtifacts } from '@studio/routes/agents/ClaudeCodeCh
66
export interface ClaudeCodeHistoryPanelProps {
77
activeSessionId?: string;
88
artifacts?: ClaudeCodeChatArtifacts;
9+
hideArtifacts?: boolean;
910
onNewChat: () => void;
1011
onSelectSession: (sessionId: string) => void;
1112
}

0 commit comments

Comments
 (0)