Skip to content

Commit 74f97ef

Browse files
committed
Better visualizations, lat/long protections
1 parent bdb9cb4 commit 74f97ef

File tree

4 files changed

+225
-124
lines changed

4 files changed

+225
-124
lines changed

ai/ai-react-app/src/components/Common/PromptInput.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ interface PromptInputProps {
2525
currentParams?: ModelParams;
2626
currentImagenParams?: ImagenModelParams;
2727
selectedFile: File | null;
28+
disabled?: boolean;
2829
}
2930

3031
const PromptInput: React.FC<PromptInputProps> = ({
@@ -39,6 +40,7 @@ const PromptInput: React.FC<PromptInputProps> = ({
3940
aiInstance,
4041
currentParams,
4142
selectedFile,
43+
disabled = false,
4244
}) => {
4345
const [tokenCount, setTokenCount] = useState<CountTokensResponse | null>(
4446
null,
@@ -142,14 +144,14 @@ const PromptInput: React.FC<PromptInputProps> = ({
142144
value={prompt}
143145
onChange={(e) => onPromptChange(e.target.value)}
144146
placeholder={placeholder}
145-
disabled={isLoading || isCountingTokens} // Disable if main loading OR counting
147+
disabled={disabled || isLoading || isCountingTokens} // Disable if main loading OR counting
146148
rows={3}
147149
aria-label="Prompt input"
148150
/>
149151
<button
150152
className={styles.runButton}
151153
onClick={onSubmit}
152-
disabled={isLoading || isCountingTokens || !prompt.trim()} // Disable if loading, counting, or empty
154+
disabled={disabled || isLoading || isCountingTokens || !prompt.trim()} // Disable if loading, counting, or empty
153155
aria-label="Submit prompt"
154156
>
155157
{isLoading ? "Running..." : "Run ➤"}

ai/ai-react-app/src/components/Layout/RightSidebar.module.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,24 @@ input:checked + .slider:before {
252252
.advancedSettings .controlGroup label {
253253
font-weight: 400;
254254
color: var(--color-text-secondary);
255+
}
256+
.groupContainer {
257+
border: 1px solid var(--color-border-primary);
258+
border-radius: 8px;
259+
padding: 12px;
260+
margin-bottom: 16px;
261+
background-color: rgba(255, 255, 255, 0.02);
262+
}
263+
264+
.errorBanner {
265+
background-color: rgba(255, 0, 0, 0.1);
266+
border: 1px solid var(--brand-red);
267+
color: var(--brand-red);
268+
padding: 8px 12px;
269+
border-radius: 4px;
270+
font-size: 0.8125rem;
271+
margin-top: 12px;
272+
display: flex;
273+
align-items: center;
274+
gap: 8px;
255275
}

0 commit comments

Comments
 (0)