Skip to content

Commit 705992a

Browse files
committed
Refine UI layout spacing across views and optimize compacting hook behavior
- while being in landscape, the cpu is highly occupied - move [Fragment] to main view - in landscape, the back button should be placed below ask/edit buttons ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ ├── Home │ │ ├── Home.module.scss │ │ ├── hooks │ │ │ ├── use-has-scrolled-past-mode-button.ts │ │ │ ├── use-keyboard-shortcuts.ts │ │ │ └── use-tasks.ts │ │ └── index.ts │ ├── Main │ │ ├── Main.tsx │ │ ├── MainView │ │ │ ├── MainView.module.scss │ │ │ ├── MainView.tsx │ │ │ ├── components │ │ │ │ ├── BrowserConnectionStatus │ │ │ │ │ └── index.ts │ │ │ │ ├── Header │ │ │ │ │ ├── Header.module.scss │ │ │ │ │ ├── Header.tsx │ │ │ │ │ └── index.ts │ │ │ │ └── PromptAttachments │ │ │ │ ├── PromptAttachments.tsx │ │ │ │ └── index.ts │ │ │ ├── hooks │ │ │ │ ├── use-invocation-counts.ts │ │ │ │ ├── use-keyboard-shortcuts.ts │ │ │ │ ├── use-last-choice-tooltip.ts │ │ │ │ └── use-re-render-on-interval.ts │ │ │ ├── index.ts │ │ │ └── prompt-type-labels.ts │ │ └── index.ts │ ├── components │ │ ├── Layout │ │ │ └── Footer │ │ │ └── Footer.tsx │ │ └── recent-donations │ │ └── RecentDonationsFooter │ │ └── RecentDonationsFooter.tsx │ └── hooks │ └── use-is-landscape.ts └── packages ├── shared │ └── src │ └── hooks │ └── use-compacting.ts └── ui └── src └── components └── editor └── prompt ├── BrowserExtensionMessage │ └── BrowserExtensionMessage.tsx └── ResponsePreviewFooter └── ResponsePreviewFooter.tsx
1 parent 4094fc1 commit 705992a

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ export const Home: React.FC<Props> = (props) => {
335335
<UiScrollable on_scroll={handle_scroll} top_shadow>
336336
<div className={styles.content}>
337337
<div className={styles.inner}>
338-
<UiSeparator height={4} />
338+
<UiSeparator height={6} />
339339
{targets_section}
340340
</div>
341341
</div>
@@ -347,7 +347,7 @@ export const Home: React.FC<Props> = (props) => {
347347
<UiScrollable top_shadow>
348348
<div className={styles.content}>
349349
<div className={styles.inner}>
350-
<UiSeparator height={4} />
350+
<UiSeparator height={6} />
351351
{tasks_section}
352352
</div>
353353
{footer}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export const MainView: React.FC<Props> = (props) => {
274274

275275
const prompt_section = (
276276
<>
277-
<UiSeparator height={is_landscape ? 4 : 2} />
277+
<UiSeparator height={is_landscape ? 6 : 4} />
278278

279279
<BrowserConnectionStatus
280280
is_visible={props.target == TARGET.WEB}
@@ -309,12 +309,10 @@ export const MainView: React.FC<Props> = (props) => {
309309
}
310310
]}
311311
/>
312-
<UiSeparator height={4} />
312+
<UiSeparator height={6} />
313313
</>
314314
)}
315315

316-
<UiSeparator height={2} />
317-
318316
{props.response_history.length > 0 &&
319317
(props.target == TARGET.WEB
320318
? props.web_prompt_type

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const BrowserConnectionStatus: React.FC<Props> = (props) => {
7575
}
7676
actions={actions}
7777
/>
78-
<UiSeparator height={4} />
78+
<UiSeparator height={6} />
7979
</>
8080
)
8181
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
flex-direction: column;
3434
align-items: flex-start;
3535
padding: 0;
36+
37+
> :first-child {
38+
order: 1;
39+
}
3640
}
3741
}
3842
}

‎packages/shared/src/hooks/use-compacting.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const use_compacting = (options?: { is_disabled?: boolean }) => {
4141
useEffect(() => {
4242
if (is_disabled) {
4343
set_compact_step(0)
44-
set_thresholds({})
44+
set_thresholds((prev) => (Object.keys(prev).length == 0 ? prev : {}))
4545
return
4646
}
4747

0 commit comments

Comments
 (0)