Skip to content

Commit cd08b4a

Browse files
committed
Replace Separator component with Spacer across prompt views
- rename 'separator' component to 'spacer'
1 parent c6ab40a commit cd08b4a

8 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎apps/editor/src/views/prompt/frontend/Home/Home.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { KeycapWrapper as UiKeycapWrapper } from '@ui/components/editor/prompt/K
77
import cn from 'classnames'
88
import { post_message } from '../utils/post-message'
99
import { BackendMessage } from '@/views/prompt/types/messages'
10-
import { Separator as UiSeparator } from '@ui/components/editor/prompt/Separator'
10+
import { Spacer as UiSpacer } from '@ui/components/editor/prompt/Spacer'
1111
import { Translation, use_translation } from '../i18n/use-translation'
1212
import { CompactableActionButton } from '@ui/components/editor/prompt/CompactableActionButton'
1313
import { Tasks as UiTasks } from '@ui/components/editor/prompt/Tasks'
@@ -276,7 +276,7 @@ export const Home: React.FC<Props> = (props) => {
276276
}
277277
/>
278278

279-
<UiSeparator height={4} />
279+
<UiSpacer height={4} />
280280

281281
<div className={styles.inner__tasks}>
282282
<UiTasks
@@ -347,9 +347,9 @@ export const Home: React.FC<Props> = (props) => {
347347
<UiScrollable on_scroll={handle_scroll} top_shadow>
348348
<div className={styles.content}>
349349
<div className={styles.inner}>
350-
<UiSeparator height={6} />
350+
<UiSpacer height={6} />
351351
{targets_section}
352-
<UiSeparator height={6} />
352+
<UiSpacer height={6} />
353353
</div>
354354
</div>
355355
</UiScrollable>
@@ -360,7 +360,7 @@ export const Home: React.FC<Props> = (props) => {
360360
<UiScrollable top_shadow>
361361
<div className={styles.content}>
362362
<div className={styles.inner}>
363-
<UiSeparator height={6} />
363+
<UiSpacer height={6} />
364364
{tasks_section}
365365
</div>
366366
{footer}
@@ -377,9 +377,9 @@ export const Home: React.FC<Props> = (props) => {
377377
<UiScrollable on_scroll={handle_scroll} top_shadow>
378378
<div className={styles.content}>
379379
<div className={styles.inner}>
380-
<UiSeparator height={4} />
380+
<UiSpacer height={2} />
381381
{targets_section}
382-
<UiSeparator height={10} />
382+
<UiSpacer height={10} />
383383
{tasks_section}
384384
</div>
385385
{footer}

‎apps/editor/src/views/prompt/frontend/Main/MainView/MainView.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styles from './MainView.module.scss'
33
import { Configurations as UiConfigurations } from '@ui/components/editor/prompt/Configurations'
44
import { PromptField as UiPromptField } from '@ui/components/editor/common/prompts/PromptField'
55
import { PromptAttachments } from './components/PromptAttachments'
6-
import { Separator as UiSeparator } from '@ui/components/editor/prompt/Separator'
6+
import { Spacer as UiSpacer } from '@ui/components/editor/prompt/Spacer'
77
import { WebConfiguration } from '@shared/types/web-configuration'
88
import { Responses as UiResponses } from '@ui/components/editor/prompt/Responses'
99
import { StatusBar as UiStatusBar } from '@ui/components/editor/prompt/StatusBar'
@@ -281,7 +281,7 @@ export const MainView: React.FC<Props> = (props) => {
281281

282282
const prompt_section = (
283283
<>
284-
<UiSeparator height={is_landscape ? 6 : 4} />
284+
<UiSpacer height={is_landscape ? 6 : 2} />
285285

286286
<BrowserConnectionStatus
287287
is_visible={props.target == TARGET.WEB}
@@ -318,7 +318,7 @@ export const MainView: React.FC<Props> = (props) => {
318318
}
319319
]}
320320
/>
321-
<UiSeparator height={6} />
321+
<UiSpacer height={6} />
322322
</>
323323
)}
324324

@@ -492,7 +492,7 @@ export const MainView: React.FC<Props> = (props) => {
492492
/>
493493
)}
494494

495-
{is_landscape && <UiSeparator height={6} />}
495+
{is_landscape && <UiSpacer height={6} />}
496496
</>
497497
)
498498

@@ -602,7 +602,7 @@ export const MainView: React.FC<Props> = (props) => {
602602
}}
603603
/>
604604
)}
605-
<UiSeparator height={12} />
605+
<UiSpacer height={12} />
606606
</div>
607607
</UiScrollable>
608608
</div>
@@ -621,7 +621,7 @@ export const MainView: React.FC<Props> = (props) => {
621621
<div className={styles.content}>
622622
{prompt_section}
623623

624-
<UiSeparator height={6} />
624+
<UiSpacer height={6} />
625625

626626
{configurations_section}
627627
{props.bottom_spacer_height !== undefined &&
@@ -630,7 +630,7 @@ export const MainView: React.FC<Props> = (props) => {
630630
style={{ height: props.bottom_spacer_height, flexShrink: 0 }}
631631
/>
632632
)}
633-
<UiSeparator height={12} />
633+
<UiSpacer height={12} />
634634
</div>
635635
</UiScrollable>
636636
</>

‎apps/editor/src/views/prompt/frontend/Main/MainView/components/BrowserConnectionStatus/BrowserConnectionStatus.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { StatusBar } from '@ui/components/editor/prompt/StatusBar'
3-
import { Separator as UiSeparator } from '@ui/components/editor/prompt/Separator'
3+
import { Spacer as UiSpacer } from '@ui/components/editor/prompt/Spacer'
44

55
type Props = {
66
is_connected: boolean
@@ -56,7 +56,7 @@ export const BrowserConnectionStatus: React.FC<Props> = (props) => {
5656
}
5757
actions={actions}
5858
/>
59-
<UiSeparator height={6} />
59+
<UiSpacer height={6} />
6060
</>
6161
)
6262
}

‎apps/editor/src/views/prompt/frontend/Main/MainView/components/Header/Header.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '../../prompt-type-labels'
1212
import { use_translation } from '@/views/prompt/frontend/i18n/use-translation'
1313
import { StatusBar as UiStatusBar } from '@ui/components/editor/prompt/StatusBar'
14-
import { Separator as UiSeparator } from '@ui/components/editor/prompt/Separator'
14+
import { Spacer as UiSpacer } from '@ui/components/editor/prompt/Spacer'
1515

1616
type Props = {
1717
target: Target
@@ -72,7 +72,7 @@ export const Header: React.FC<Props> = (props) => {
7272
}
7373
]}
7474
/>
75-
<UiSeparator height={6} />
75+
<UiSpacer height={6} />
7676
</div>
7777
</>
7878
)}

‎packages/ui/src/components/editor/prompt/Configurations/Configurations.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114

115115
.separator {
116116
height: 1px;
117-
background-color: var(--vscode-menu-separatorBackground);
117+
background-color: (--cwc-original-border-color);
118118
margin: 4px 0;
119119

120120
@include modern-ui {

‎packages/ui/src/components/editor/prompt/Separator/index.ts‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/ui/src/components/editor/prompt/Separator/Separator.tsx renamed to packages/ui/src/components/editor/prompt/Spacer/Spacer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export namespace Separator {
1+
export namespace Spacer {
22
export type Props = {
33
height: number
44
}
55
}
66

7-
export const Separator: React.FC<Separator.Props> = (props) => {
7+
export const Spacer: React.FC<Spacer.Props> = (props) => {
88
return <div style={{ height: `${props.height}px` }} />
99
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './Spacer'

0 commit comments

Comments
 (0)