Skip to content

Commit 4cced07

Browse files
committed
Add landscape layout support across views and components
- inspired by landscape handling on Main page, implement landscape in Home - one 'landscape' is activated once, upon return compacting stops working - compacting hook should accept optional object with optional key: is disabled - 'discord', 'buy me coffee' should be compacted in landscape at all times - rename header 'left' 'right' to header__home, header__links - give better, descriptible names to columns - [Fragment] should be '4' in landscape - pinned and nonpinned should be held together in a container ├── README.md ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ ├── Home │ │ ├── Home.module.scss │ │ └── Home.tsx │ ├── Main │ │ └── MainView │ │ ├── MainView.module.scss │ │ ├── MainView.tsx │ │ ├── components │ │ │ └── Header │ │ │ ├── Header.module.scss │ │ │ ├── Header.tsx │ │ │ └── index.ts │ │ ├── index.ts │ │ └── prompt-type-labels.ts │ └── components │ ├── Layout │ │ └── Footer │ │ └── Footer.tsx │ └── recent-donations │ └── RecentDonationsFooter │ └── RecentDonationsFooter.tsx └── packages ├── shared │ └── src │ └── hooks │ └── use-compacting.ts └── ui └── src └── components └── editor └── prompt ├── BrowserExtensionMessage │ └── BrowserExtensionMessage.tsx ├── Configurations │ ├── Configurations.module.scss │ └── Configurations.tsx └── ResponsePreviewFooter └── ResponsePreviewFooter.tsx
1 parent 8c8cf90 commit 4cced07

8 files changed

Lines changed: 353 additions & 230 deletions

File tree

‎apps/editor/src/views/prompt/frontend/Home/Home.module.scss‎

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
width: 100%;
55
height: var(--height);
66

7+
@include landscape {
8+
height: unset;
9+
width: unset;
10+
margin: 6px 0 0 12px;
11+
12+
@include modern-ui {
13+
margin: 6px 0 0 10px;
14+
}
15+
}
16+
717
&__normal {
818
position: absolute;
919
inset: 0;
@@ -27,9 +37,22 @@
2737
transform: translateY(-15px);
2838
pointer-events: none;
2939
}
40+
41+
@include landscape {
42+
position: static;
43+
flex-direction: column;
44+
align-items: flex-start;
45+
gap: 4px;
46+
padding: 0;
47+
transition: none;
48+
49+
@include modern-ui {
50+
padding: 0;
51+
}
52+
}
3053
}
3154

32-
&__left {
55+
&__icon {
3356
display: flex;
3457
align-items: center;
3558
justify-content: center;
@@ -40,10 +63,16 @@
4063
color: var(--vscode-icon-foreground);
4164
}
4265

43-
&__right {
66+
&__links {
4467
display: flex;
4568
align-items: center;
4669
gap: 4px;
70+
71+
@include landscape {
72+
flex-direction: column;
73+
align-items: flex-start;
74+
margin-left: -2px;
75+
}
4776
}
4877

4978
&__targets {
@@ -179,3 +208,44 @@
179208
.bottom-spacer {
180209
flex-shrink: 0;
181210
}
211+
212+
.landscape {
213+
display: flex;
214+
height: 100%;
215+
width: 100%;
216+
217+
&__column {
218+
flex: 1;
219+
display: flex;
220+
flex-direction: column;
221+
height: 100%;
222+
min-width: 0;
223+
224+
&--header {
225+
flex: 0 0 max-content;
226+
}
227+
228+
&--targets {
229+
flex: 0.7;
230+
@include modern-ui {
231+
margin-right: -10px;
232+
}
233+
234+
.content {
235+
padding-bottom: 8px;
236+
237+
@include modern-ui {
238+
padding-bottom: 6px;
239+
}
240+
}
241+
}
242+
243+
&--tasks {
244+
border-left: 1px solid var(--cwc-border-color-dimmed);
245+
246+
@include modern-ui {
247+
border-left: none;
248+
}
249+
}
250+
}
251+
}

0 commit comments

Comments
 (0)