Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
UX: unsaved-changes dot badges the Save button (was a floating dot by undo)
nyblnete19455230a6e
diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.tsindex f6dffe29..09cdb605 100644--- a/slides/src/editor/editor.ts+++ b/slides/src/editor/editor.ts@@ -215,7 +215,7 @@ export class Editor {}})this.dirtyDot = div('ed-dirty')- this.dirtyDot.title = t('Unsaved changes')+ this.dirtyDot.title = t('Unsaved changes — ⌘S saves this file in place')const insert = div('ed-group ed-insert')insert.append(@@ -257,6 +257,7 @@ export class Editor {const undoB = btn(ICONS.undo, '', () => this.store.undo(), t('Undo (⌘Z)'))const redoB = btn(ICONS.redo, '', () => this.store.redo(), t('Redo (⇧⌘Z)'))const saveB = btn(ICONS.save, t('Save'), () => this.save(false), t('Save — rewrite this file in place (⌘S)'))+ saveB.appendChild(this.dirtyDot) // the amber unsaved-changes dot lives ON Saveconst pdfB = btn(ICONS.pdf, '', () => this.exportPdf(), t('Export PDF (print)'))const helpB = btn('<b class="ed-help-q">?</b>', '', () => this.openHelp(), t('Shortcuts & tips (?)'))helpB.classList.add('ed-btn-help')@@ -269,7 +270,7 @@ export class Editor {const saveGroup = div('ed-split')saveGroup.append(saveB, this.saveDropdown())actions.append(pdfB, this.avatarsBox, this.shareDropdown(), saveGroup, this.languageDropdown(), helpB)- bar.append(logo, this.updatesB, title, this.dirtyDot, history, insert, actions)+ bar.append(logo, this.updatesB, title, history, insert, actions)// main areaconst main = div('ed-main')@@ -1711,7 +1712,7 @@ export class Editor {private savedTimer = 0private flashSaved() {let tag = document.querySelector<HTMLElement>('.ed-autosaved')- if (!tag) { tag = div('ed-autosaved'); this.dirtyDot.after(tag) }+ if (!tag) { tag = div('ed-autosaved'); document.querySelector('.ed-topbar .ed-title')?.after(tag) }tag.textContent = t('Saved')tag.classList.add('show')clearTimeout(this.savedTimer)diff --git a/slides/src/styles.css b/slides/src/styles.cssindex 72a069a7..79ed3070 100644--- a/slides/src/styles.css+++ b/slides/src/styles.css@@ -61,11 +61,15 @@ html, body {.ed-title:hover { border-color: var(--line); }.ed-title:focus { border-color: var(--blue); outline: none; background: #fff; }+/* unsaved-changes dot — badges the SAVE button's corner (amber when dirty) */.ed-dirty {- width: 8px; height: 8px; border-radius: 50%;- background: transparent; margin-left: -4px; flex: none;+ position: absolute;+ top: 3px; right: 3px;+ width: 7px; height: 7px; border-radius: 50%;+ background: transparent; pointer-events: none;}.ed-dirty.on { background: var(--accent); }+.ed-split > .ed-btn:first-child { position: relative; }.ed-group { display: flex; align-items: center; gap: 6px; }.ed-group-right { margin-left: auto; }