Skip to content

Commit 93d913d

Browse files
committed
Implement multi-column landscape layout support for the main view
- create a mixin 'is-landscape' - in landscape, should display header, prompt field and configurations in separate scrollable columns. You should a new hook 'use is landscape' in `apps/editor/src/views/prompt/frontend/hooks` - is landscape should also check if minimum 400px width - the column with configurations should have left dimmed border but only in landscape and not modern. - use BEM convention - in landscape, header elements should be stacked vertically - in landscape, left column should be only 80px wide - in landscape, header should have only top and left paddings - in landscape, left column should take as little space as its content requires - middle column should have flex: 1.5 - [Fragment] these should apply inside scollable - main view content seem unnecessary in landscape - for some reason 'auto' in [Fragment] causes jank on initial load. It has something to do with compacting. - [Pasted text] should not compact in landscape ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ ├── Home │ │ ├── Home.module.scss │ │ ├── Home.tsx │ │ ├── hooks │ │ │ ├── use-has-scrolled-past-mode-button.ts │ │ │ ├── use-keyboard-shortcuts.ts │ │ │ └── use-tasks.ts │ │ └── index.ts │ ├── Main │ │ └── MainView │ │ ├── MainView.module.scss │ │ ├── MainView.tsx │ │ ├── components │ │ │ └── Header │ │ │ ├── Header.module.scss │ │ │ ├── Header.tsx │ │ │ └── index.ts │ │ └── hooks │ │ ├── use-invocation-counts.ts │ │ ├── use-keyboard-shortcuts.ts │ │ ├── use-last-choice-tooltip.ts │ │ └── use-re-render-on-interval.ts │ └── hooks │ ├── use-editor-sync.ts │ └── use-is-landscape.ts └── packages └── ui └── src ├── components │ └── editor │ └── prompt │ └── CompactableActionButton │ ├── CompactableActionButton.module.scss │ └── CompactableActionButton.tsx └── styles └── foundation ├── _colors.scss ├── _index.scss ├── _mixins.scss └── _variables.scss
1 parent 69b3c26 commit 93d913d

6 files changed

Lines changed: 429 additions & 286 deletions

File tree

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,46 @@
1717
> * {
1818
flex-shrink: 0;
1919
}
20+
21+
@include is-landscape {
22+
height: auto;
23+
}
24+
}
25+
26+
.landscape {
27+
display: flex;
28+
height: 100%;
29+
width: 100%;
30+
31+
&__column {
32+
flex: 1;
33+
display: flex;
34+
flex-direction: column;
35+
height: 100%;
36+
min-width: 0;
37+
38+
&--header {
39+
flex: 0 0 max-content;
40+
}
41+
42+
&--prompt {
43+
flex: 1.5;
44+
45+
.content {
46+
padding-bottom: 8px;
47+
48+
@include modern-ui {
49+
padding-bottom: 6px;
50+
}
51+
}
52+
}
53+
54+
&--configurations {
55+
border-left: 1px solid var(--cwc-border-color-dimmed);
56+
57+
@include modern-ui {
58+
border-left: none;
59+
}
60+
}
61+
}
2062
}

0 commit comments

Comments
 (0)