Skip to content

Commit 7690de0

Browse files
committed
fix(web): keep the page on the window's midline beside the plugin space
The plugin space's column pulled the conversation, the document and the prompt box off the middle of the window, and the sidebar did the same from the other side. The page now balances what stands beside it: the side with less beside it takes the difference as ground, moving in step with the sidebar. The column takes what a 46rem measure in the middle leaves it, between 20rem and 28rem.
1 parent 163e788 commit 7690de0

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

‎apps/web/src/pages/workspace/index.module.css‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
.room {
2+
/* The plugin space's column: what a reading measure in the middle of the window leaves it, within
3+
bounds a screen can be used in. */
4+
--plugin-column: clamp(20rem, (100% - 46rem) / 2 - var(--space-2), 28rem);
5+
/* How wide the sidebar and the plugin space's column stand on either side of the page. */
6+
--beside-start: 0px;
7+
--beside-end: 0px;
8+
29
position: relative;
310
display: flex;
411
flex-direction: row;
@@ -10,6 +17,14 @@
1017
background: var(--card);
1118
}
1219

20+
.room:has(> [data-slot="project-sidebar"][data-open]:not([data-drawer])) {
21+
--beside-start: var(--rail-width);
22+
}
23+
24+
.room:has(> [data-slot="plugin-space"][data-as="column"]) {
25+
--beside-end: var(--plugin-column);
26+
}
27+
1328
/* The page beside the sidebar: the conversation, the project view over it and the plugin sheet
1429
over both; the plugin space's column stands beside it. Its own stacking context, so what covers
1530
it stays under the sidebar's drawer. */
@@ -20,11 +35,30 @@
2035
flex: 1;
2136
min-width: 0;
2237
min-height: 0;
38+
/* The page keeps its middle on the window's, so the conversation, the document and the prompt box
39+
stay put whatever opens beside them: the side with less beside it takes the difference as
40+
ground. */
2341
margin: var(--space-2);
42+
margin-inline-start: calc(
43+
var(--space-2) + max(0px, var(--beside-end) - var(--beside-start))
44+
);
45+
margin-inline-end: calc(
46+
var(--space-2) + max(0px, var(--beside-start) - var(--beside-end))
47+
);
2448
overflow: hidden;
2549
border-radius: var(--radius-panel);
2650
background: var(--wb-background);
2751
box-shadow: var(--wb-pane-shadow);
52+
/* In step with the sidebar as it opens and closes. */
53+
transition: margin-inline var(--duration-standard) var(--ease-out);
54+
}
55+
56+
.room:has(> [data-slot="project-sidebar"][data-open]) .main {
57+
transition-duration: var(--duration-large);
58+
}
59+
60+
.room:has(> [data-slot="project-sidebar"][data-instant]) .main {
61+
transition: none;
2862
}
2963

3064
.conversationPane {

‎apps/web/src/pages/workspace/plugin-space.module.css‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
background: var(--wb-background);
77
}
88

9-
/* Beside the main area: a column of its own, set off by one hairline. */
9+
/* Beside the main area: a column of its own, set off by one hairline, as wide as the room gives it. */
1010
.space[data-as="column"] {
11-
flex: 0 0 min(28rem, 42%);
11+
flex: 0 0 var(--plugin-column, min(28rem, 42%));
1212
border-inline-start: 1px solid var(--wb-border);
1313
}
1414

0 commit comments

Comments
 (0)