Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

spaces: a status message never moves the buttons under your pointer (#352)

nyblnet1a67857a88b8
diff --git a/spaces/src/editor.ts b/spaces/src/editor.ts
index 1c1811f4..4d50e6d8 100644
--- a/spaces/src/editor.ts
+++ b/spaces/src/editor.ts
@@ -433,7 +433,14 @@ export class Editor {
const right = el('div', 'sp-group sp-group-right')
right.append(insert, search, ...inlineSecondary, inspB, this.liveSlot, more, saveGroup)
- bar.append(pagesB, mark, title, this.statusEl, history, right)
+ // The status goes AFTER undo/redo, never before. It is transient text that
+ // grows from nothing to a whole sentence, and anything downstream of it in
+ // the flex flow gets shoved sideways every time it changes — measured at
+ // 36px on a plain edit and 246px entering reading view, which is more than
+ // a button's width, so undo lands where redo just was. Past the history
+ // group it grows into the slack the right group's margin-auto already
+ // holds, and nothing before it can move. Reported against slides as #300.
+ bar.append(pagesB, mark, title, history, this.statusEl, right)
// Drive the fit now, and again whenever the bar's size or its CONTENT
// changes. The ResizeObserver is the primary width signal — it fires for
diff --git a/spaces/src/styles.css b/spaces/src/styles.css
index b15e1185..f77f72c3 100644
--- a/spaces/src/styles.css
+++ b/spaces/src/styles.css
@@ -1382,8 +1382,12 @@ button.sp-callout-chip:hover { text-decoration: underline; text-underline-offset
}
/* Belt and braces at every width: a status message can shrink and clip, but it
- can never be the reason a control leaves the bar. */
-.sp-status { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
+ can never be the reason a control leaves the bar — nor the reason the bar
+ changes tier. Basis 0 keeps the message out of the bar's intrinsic width, so
+ text arriving cannot push fitTopbar into hiding labels and resizing buttons
+ under the pointer; grow lets it use whatever slack is going, and it
+ ellipsises when there is none. */
+.sp-status { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Hit targets: a 30px button is a miss on a touch screen. */
@media (pointer: coarse) {