Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

spaces: a page can be as wide as it needs to be (#325)

nyblnet9d392ed2468b
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md
index 89e87a58..4fec0e48 100644
--- a/docs/DECISIONS.md
+++ b/docs/DECISIONS.md
@@ -14,6 +14,40 @@ Decision. Why. Pointers.
---
+## 2026-08-19 — How wide a page is belongs to the PAGE, not the theme
+
+`theme.measure` is one number for the whole document — "text column width in px
+— DOCUMENT data: the same for every reader". The right answer genuinely differs
+per page, and the renderer already knew it: a page carrying a `view` block
+silently jumped from 720px to 1500px, with a good comment explaining that a
+board is not a line of text.
+
+The problem was that it decided for you and offered no way to disagree. MEASURED
+at a 1600px viewport: a 720px column with 631px of the page empty beside it, and
+0 of the 15 blocks on the starter's Welcome page reaching the limit at all. The
+line length was never the complaint — 720px at 16px is ~88 characters, already
+at the upper end of comfortable. Having no say was.
+
+`Page.width?: 'wide' | 'full'` now, offered in the page menu as Column / Wide /
+Full width. It makes the board rule EXPLICIT rather than magic: a board page
+with no key still gets its room, and a board page set to Column now gets to be
+narrow.
+
+THE DEFAULT IS AN ABSENT KEY, never a stored `'normal'` — the rule `editView`
+already follows. A page somebody set to wide and back is byte-identical to one
+never touched, and a file written before this control existed stays that way. An
+unknown value from a newer build falls back to the measure rather than to no
+width at all.
+
+Not raised: `theme.measure` itself stays 720. Widening it would push past 88
+characters for every page in the document to solve a complaint about empty
+space, which is the wrong lever.
+
+Measured after: column 720, wide 1500, full 1895 at a 2200px viewport; a board
+page with no key still 1500. +1,128 B, no ceiling change.
+
+---
+
## 2026-08-18 — The spaces topbar fits itself by measuring, not by px breakpoints
The bar folded at 820px and again at 600px. Those numbers moved once already
diff --git a/scripts/test-spaces-model.ts b/scripts/test-spaces-model.ts
index ab8477e2..4eabb031 100644
--- a/scripts/test-spaces-model.ts
+++ b/scripts/test-spaces-model.ts
@@ -374,6 +374,49 @@ for (const [label, input, err] of [
// not be saved on a phone, and nothing said so: the controls were in the DOM,
// laid out, and simply painted past the edge.
//
+// ---------------------------------------------------------------------------
+// HOW WIDE A PAGE IS.
+//
+// The renderer already varied this — a page carrying a `view` block jumped to
+// 1500px — but it decided for you and offered no way to disagree. Measured at
+// a 1600px viewport before the control existed: a 720px column with 631px of
+// the page empty beside it, and 0 of the 15 blocks on the starter's Welcome
+// page even reaching the limit. The line length was never the problem.
+//
+// What must not regress: the default is an ABSENT key (so a file written
+// before this stays byte-identical), a board with no key keeps its room, and
+// an unknown value from a newer build falls back to the measure rather than to
+// no width at all.
+{
+ const fs = await import('node:fs')
+ const render = fs.readFileSync(new URL('../spaces/src/render.ts', import.meta.url), 'utf8')
+ const editor = fs.readFileSync(new URL('../spaces/src/editor.ts', import.meta.url), 'utf8')
+ const model = fs.readFileSync(new URL('../spaces/src/model.ts', import.meta.url), 'utf8')
+
+ ok(/width\?: 'wide' \| 'full'/.test(model), "Page.width is 'wide' | 'full' — absent is the default")
+ ok(/\[extra: string\]: unknown/.test(model), '…on a Page that still round-trips unknown fields')
+
+ // the board default survives, and the page overrides it
+ ok(/page\.blocks\.some\(\(b\) => b\.type === 'view'\)/.test(render),
+ 'a board page is still the DEFAULT wide case')
+ ok(/page\.width === 'wide' \|\| page\.width === 'full' \? page\.width/.test(render),
+ '…and an explicit page width wins over it')
+ ok(/page\.width === undefined \? auto/.test(render),
+ '…while an absent key falls through to the board default')
+ ok(/maxWidth = 'none'/.test(render), "'full' removes the cap rather than picking a big number")
+ ok(/maxWidth = `\$\{doc\.theme\.measure\}px`/.test(render), 'and the prose default is still the theme measure')
+
+ // THE DEFAULT IS AN ABSENT KEY. A page set to wide and back must be
+ // byte-identical to one never touched — the same rule editView follows.
+ ok(/if \(v === 'normal'\) delete pg\.width/.test(editor),
+ 'choosing the default DELETES the key rather than storing "normal"')
+ ok(/t\('Width'\)/.test(editor) && /t\('Column'\)/.test(editor) &&
+ /t\('Wide'\)/.test(editor) && /t\('Full width'\)/.test(editor),
+ 'the page menu offers all three, translated')
+ ok(/selected: current === 'normal'/.test(editor),
+ '…and marks the one in force, so the menu says what the page already is')
+}
+
// The rule (slides' rule) is: drop text and fold, never scroll. The failure
// mode to guard is not the CSS — it is the SECOND LIST: a ⋯ menu maintained by
// hand as a copy of the desktop row drifts the first time either changes, and
diff --git a/spaces/CHANGELOG.md b/spaces/CHANGELOG.md
index 9bcaf085..ade96021 100644
--- a/spaces/CHANGELOG.md
+++ b/spaces/CHANGELOG.md
@@ -14,6 +14,11 @@ Versions follow `0.MINOR.PATCH` while pre-1.0.
## [Unreleased]
+- **A page can be as wide as it needs to be.** Column, Wide or Full width, in
+ the page menu. Pages of writing keep a comfortable line; a page with a board
+ on it can have the room. Boards already widened themselves — now they say so,
+ and you can disagree.
+
- **The toolbar fits itself.** It used to fold at two fixed widths that were
measured in English; German needs 50px more for the same buttons, and eight
languages ship in every file. It now measures itself and steps down when it
diff --git a/spaces/src/editor.ts b/spaces/src/editor.ts
index 5ec18726..ab001530 100644
--- a/spaces/src/editor.ts
+++ b/spaces/src/editor.ts
@@ -2709,6 +2709,35 @@ export class Editor {
})
}))
+ // HOW WIDE THIS PAGE IS. The renderer already varied it — a page carrying a
+ // board jumped to 1500px — but it decided for you silently. Measured at a
+ // 1600px viewport: the default column is 720px with 631px of the page left
+ // empty beside it, and nothing on the starter pages even reaches the limit
+ // (0 of 15 blocks wrap). The line length was never the problem; having no
+ // say was.
+ pop.append(el('div', 'sp-menu-label', t('Width')))
+ const current: 'normal' | 'wide' | 'full' =
+ page.width === 'wide' ? 'wide' : page.width === 'full' ? 'full' : 'normal'
+ const setWidth = (v: 'normal' | 'wide' | 'full') => {
+ this.closeOverlay()
+ s.commit(() => {
+ const pg = s.index.page.get(pageId)
+ if (!pg) return
+ // THE DEFAULT IS AN ABSENT KEY, never a stored 'normal'. A page somebody
+ // set to wide and back is then byte-identical to one never touched, and
+ // a file written before this control existed stays that way.
+ if (v === 'normal') delete pg.width
+ else pg.width = v
+ }, { scope: 'doc' })
+ this.paintPage()
+ }
+ pop.append(this.menuItem('widthNarrow', t('Column'), t('Comfortable for reading'),
+ () => setWidth('normal'), { selected: current === 'normal' }))
+ pop.append(this.menuItem('widthWide', t('Wide'), t('Room for a board or a table'),
+ () => setWidth('wide'), { selected: current === 'wide' }))
+ pop.append(this.menuItem('widthFull', t('Full width'), t('Fills the window'),
+ () => setWidth('full'), { selected: current === 'full' }))
+
pop.append(this.menuItem('trash', t('Delete…'), t('Links to it become dead'), () => {
this.closeOverlay()
this.deletePage(pageId)
diff --git a/spaces/src/i18n/de.ts b/spaces/src/i18n/de.ts
index 4b76c2e3..016609f7 100644
--- a/spaces/src/i18n/de.ts
+++ b/spaces/src/i18n/de.ts
@@ -51,6 +51,8 @@ export const de: Catalog = {
"Clear filter": "Filter zurücksetzen",
"Close": "Schließen",
"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "Zugeklappte Toggle-Blöcke werden immer offen gedruckt. Im Druckdialog deines Browsers gibt es die Option „Als PDF speichern“.",
+ "Column": "Spalte",
+ "Comfortable for reading": "Angenehm zu lesen",
"Contents": "Inhalt",
"Contents page": "Inhaltsverzeichnis",
"Copy document JSON": "Dokument-JSON kopieren",
@@ -79,11 +81,13 @@ export const de: Catalog = {
"Export as Markdown": "Als Markdown exportieren",
"Export as Markdown…": "Als Markdown exportieren…",
"File": "Datei",
+ "Fills the window": "Füllt das Fenster",
"Filter": "Filtern",
"Filter blocks…": "Blöcke filtern…",
"Find": "Suchen",
"Find in this space…": "In diesem Space suchen…",
"Find or create a page…": "Seite finden oder erstellen…",
+ "Full width": "Volle Breite",
"Group": "Gruppieren",
"Guest": "Gast",
"Hide the page list ([)": "Seitenliste ausblenden ([)",
@@ -178,6 +182,7 @@ export const de: Catalog = {
"Resized": "Verkleinert",
"Restore": "Wiederherstellen",
"Restore to the page list": "Zurück in die Seitenliste",
+ "Room for a board or a table": "Platz für ein Board oder eine Tabelle",
"Save": "Speichern",
"Save (⌘S)": "Speichern (⌘S)",
"Save a copy…": "Kopie speichern…",
@@ -253,6 +258,8 @@ export const de: Catalog = {
"Version, language, password, exports": "Version, Sprache, Passwort, Export",
"Visit bento.page (opens in a new tab)": "bento.page besuchen (öffnet in neuem Tab)",
"Warning": "Warnung",
+ "Wide": "Breit",
+ "Width": "Breite",
"Width in the text column": "Breite in der Textspalte",
"Wrong password — try again": "Falsches Passwort — bitte erneut versuchen",
"You have the newest version ({v}).": "Du hast die neueste Version ({v}).",
diff --git a/spaces/src/i18n/es.ts b/spaces/src/i18n/es.ts
index 0f0cd769..2cf1c5b4 100644
--- a/spaces/src/i18n/es.ts
+++ b/spaces/src/i18n/es.ts
@@ -51,6 +51,8 @@ export const es: Catalog = {
"Clear filter": "Borrar el filtro",
"Close": "Cerrar",
"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "Los desplegables plegados siempre se imprimen abiertos. El diálogo de impresión de tu navegador tiene la opción «Guardar como PDF».",
+ "Column": "Columna",
+ "Comfortable for reading": "Cómodo para leer",
"Contents": "Índice",
"Contents page": "Página de índice",
"Copy document JSON": "Copiar JSON del documento",
@@ -79,11 +81,13 @@ export const es: Catalog = {
"Export as Markdown": "Exportar como Markdown",
"Export as Markdown…": "Exportar como Markdown…",
"File": "Archivo",
+ "Fills the window": "Ocupa toda la ventana",
"Filter": "Filtrar",
"Filter blocks…": "Filtrar bloques…",
"Find": "Buscar",
"Find in this space…": "Buscar en este espacio…",
"Find or create a page…": "Buscar o crear una página…",
+ "Full width": "Ancho completo",
"Group": "Agrupar",
"Guest": "Invitado",
"Hide the page list ([)": "Ocultar la lista de páginas ([)",
@@ -178,6 +182,7 @@ export const es: Catalog = {
"Resized": "Redimensionada",
"Restore": "Restaurar",
"Restore to the page list": "Restaurar a la lista de páginas",
+ "Room for a board or a table": "Espacio para un tablero o una tabla",
"Save": "Guardar",
"Save (⌘S)": "Guardar (⌘S)",
"Save a copy…": "Guardar una copia…",
@@ -253,6 +258,8 @@ export const es: Catalog = {
"Version, language, password, exports": "Versión, idioma, contraseña, exportaciones",
"Visit bento.page (opens in a new tab)": "Visitar bento.page (se abre en una pestaña nueva)",
"Warning": "Advertencia",
+ "Wide": "Ancho",
+ "Width": "Anchura",
"Width in the text column": "Ancho en la columna de texto",
"Wrong password — try again": "Contraseña incorrecta: inténtalo de nuevo",
"You have the newest version ({v}).": "Tienes la versión más reciente ({v}).",
diff --git a/spaces/src/i18n/fr.ts b/spaces/src/i18n/fr.ts
index 79a514e3..1216d474 100644
--- a/spaces/src/i18n/fr.ts
+++ b/spaces/src/i18n/fr.ts
@@ -51,6 +51,8 @@ export const fr: Catalog = {
"Clear filter": "Effacer le filtre",
"Close": "Fermer",
"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "Les bascules repliées s’impriment toujours dépliées. La boîte d’impression de votre navigateur propose « Enregistrer au format PDF ».",
+ "Column": "Colonne",
+ "Comfortable for reading": "Confortable à lire",
"Contents": "Sommaire",
"Contents page": "Page de sommaire",
"Copy document JSON": "Copier le JSON du document",
@@ -79,11 +81,13 @@ export const fr: Catalog = {
"Export as Markdown": "Exporter en Markdown",
"Export as Markdown…": "Exporter en Markdown…",
"File": "Fichier",
+ "Fills the window": "Occupe toute la fenêtre",
"Filter": "Filtrer",
"Filter blocks…": "Filtrer les blocs…",
"Find": "Rechercher",
"Find in this space…": "Rechercher dans cet espace…",
"Find or create a page…": "Trouver ou créer une page…",
+ "Full width": "Pleine largeur",
"Group": "Grouper",
"Guest": "Invité",
"Hide the page list ([)": "Masquer la liste des pages ([)",
@@ -178,6 +182,7 @@ export const fr: Catalog = {
"Resized": "Redimensionnée",
"Restore": "Restaurer",
"Restore to the page list": "Restaurer dans la liste des pages",
+ "Room for a board or a table": "De la place pour un tableau",
"Save": "Enregistrer",
"Save (⌘S)": "Enregistrer (⌘S)",
"Save a copy…": "Enregistrer une copie…",
@@ -253,6 +258,8 @@ export const fr: Catalog = {
"Version, language, password, exports": "Version, langue, mot de passe, exports",
"Visit bento.page (opens in a new tab)": "Aller sur bento.page (nouvel onglet)",
"Warning": "Avertissement",
+ "Wide": "Large",
+ "Width": "Largeur",
"Width in the text column": "Largeur dans la colonne de texte",
"Wrong password — try again": "Mot de passe incorrect — réessayez",
"You have the newest version ({v}).": "Vous avez la dernière version ({v}).",
diff --git a/spaces/src/i18n/it.ts b/spaces/src/i18n/it.ts
index ee00867b..87a8de04 100644
--- a/spaces/src/i18n/it.ts
+++ b/spaces/src/i18n/it.ts
@@ -51,6 +51,8 @@ export const it: Catalog = {
"Clear filter": "Azzera il filtro",
"Close": "Chiudi",
"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "I blocchi comprimibili chiusi vengono sempre stampati aperti. La finestra di stampa del browser offre l’opzione «Salva come PDF».",
+ "Column": "Colonna",
+ "Comfortable for reading": "Comodo da leggere",
"Contents": "Indice",
"Contents page": "Pagina indice",
"Copy document JSON": "Copia JSON del documento",
@@ -79,11 +81,13 @@ export const it: Catalog = {
"Export as Markdown": "Esporta come Markdown",
"Export as Markdown…": "Esporta come Markdown…",
"File": "File",
+ "Fills the window": "Riempie la finestra",
"Filter": "Filtra",
"Filter blocks…": "Filtra i blocchi…",
"Find": "Trova",
"Find in this space…": "Trova in questo spazio…",
"Find or create a page…": "Trova o crea una pagina…",
+ "Full width": "Larghezza piena",
"Group": "Raggruppa",
"Guest": "Ospite",
"Hide the page list ([)": "Nascondi l'elenco delle pagine ([)",
@@ -178,6 +182,7 @@ export const it: Catalog = {
"Resized": "Ridimensionata",
"Restore": "Ripristina",
"Restore to the page list": "Ripristina nell’elenco delle pagine",
+ "Room for a board or a table": "Spazio per una bacheca o una tabella",
"Save": "Salva",
"Save (⌘S)": "Salva (⌘S)",
"Save a copy…": "Salva una copia…",
@@ -253,6 +258,8 @@ export const it: Catalog = {
"Version, language, password, exports": "Versione, lingua, password, esportazioni",
"Visit bento.page (opens in a new tab)": "Vai su bento.page (si apre in una nuova scheda)",
"Warning": "Avviso",
+ "Wide": "Largo",
+ "Width": "Larghezza",
"Width in the text column": "Larghezza nella colonna di testo",
"Wrong password — try again": "Password errata — riprova",
"You have the newest version ({v}).": "Hai la versione più recente ({v}).",
diff --git a/spaces/src/i18n/ja.ts b/spaces/src/i18n/ja.ts
index c0614cc8..6fb52916 100644
--- a/spaces/src/i18n/ja.ts
+++ b/spaces/src/i18n/ja.ts
@@ -51,6 +51,8 @@ export const ja: Catalog = {
"Clear filter": "フィルターを解除",
"Close": "閉じる",
"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "折りたたんだトグルも印刷では必ず開いた状態になります。「PDF として保存」はブラウザの印刷ダイアログにあります。",
+ "Column": "1カラム",
+ "Comfortable for reading": "読みやすい幅",
"Contents": "目次",
"Contents page": "目次ページ",
"Copy document JSON": "ドキュメント JSON をコピー",
@@ -79,11 +81,13 @@ export const ja: Catalog = {
"Export as Markdown": "Markdown で書き出す",
"Export as Markdown…": "Markdown で書き出す…",
"File": "ファイル",
+ "Fills the window": "ウィンドウいっぱいに広げます",
"Filter": "フィルター",
"Filter blocks…": "ブロックを絞り込む…",
"Find": "検索",
"Find in this space…": "このスペース内を検索…",
"Find or create a page…": "ページを検索または作成…",
+ "Full width": "全幅",
"Group": "グループ",
"Guest": "ゲスト",
"Hide the page list ([)": "ページ一覧を隠す([)",
@@ -178,6 +182,7 @@ export const ja: Catalog = {
"Resized": "縮小済み",
"Restore": "復元",
"Restore to the page list": "ページ一覧に戻す",
+ "Room for a board or a table": "ボードや表にちょうどよい幅",
"Save": "保存",
"Save (⌘S)": "保存 (⌘S)",
"Save a copy…": "コピーを保存…",
@@ -253,6 +258,8 @@ export const ja: Catalog = {
"Version, language, password, exports": "バージョン・言語・パスワード・書き出し",
"Visit bento.page (opens in a new tab)": "bento.page を開く(新しいタブ)",
"Warning": "警告",
+ "Wide": "広め",
+ "Width": "幅",
"Width in the text column": "本文カラム内の幅",
"Wrong password — try again": "パスワードが違います — もう一度お試しください",
"You have the newest version ({v}).": "最新バージョンです ({v})。",
diff --git a/spaces/src/i18n/packed.ts b/spaces/src/i18n/packed.ts
index fe34d908..1cfbb7a1 100644
--- a/spaces/src/i18n/packed.ts
+++ b/spaces/src/i18n/packed.ts
@@ -52,6 +52,8 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Clear filter": ["フィルターを解除","清除筛选","清除篩選","Borrar el filtro","Effacer le filtre","Filter zurücksetzen","Azzera il filtro","Limpar o filtro"],
"Close": ["閉じる","关闭","關閉","Cerrar","Fermer","Schließen","Chiudi","Fechar"],
"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": ["折りたたんだトグルも印刷では必ず開いた状態になります。「PDF として保存」はブラウザの印刷ダイアログにあります。","折叠起来的折叠块打印时一律展开。浏览器的打印对话框里有“存为 PDF”选项。","收合的摺疊區塊列印時一律展開。「另存為 PDF」的選項在瀏覽器的列印對話方塊中。","Los desplegables plegados siempre se imprimen abiertos. El diálogo de impresión de tu navegador tiene la opción «Guardar como PDF».","Les bascules repliées s’impriment toujours dépliées. La boîte d’impression de votre navigateur propose « Enregistrer au format PDF ».","Zugeklappte Toggle-Blöcke werden immer offen gedruckt. Im Druckdialog deines Browsers gibt es die Option „Als PDF speichern“.","I blocchi comprimibili chiusi vengono sempre stampati aperti. La finestra di stampa del browser offre l’opzione «Salva come PDF».","Os blocos recolhidos são sempre impressos abertos. A janela de impressão do navegador tem a opção \"Guardar como PDF\"."],
+ "Column": ["1カラム","单栏","單欄","Columna","Colonne","Spalte","Colonna","Coluna"],
+ "Comfortable for reading": ["読みやすい幅","适合阅读的宽度","適合閱讀的寬度","Cómodo para leer","Confortable à lire","Angenehm zu lesen","Comodo da leggere","Confortável para ler"],
"Contents": ["目次","目录","目錄","Índice","Sommaire","Inhalt","Indice","Índice"],
"Contents page": ["目次ページ","目录页","目錄頁","Página de índice","Page de sommaire","Inhaltsverzeichnis","Pagina indice","Página de índice"],
"Copy document JSON": ["ドキュメント JSON をコピー","复制文档 JSON","複製文件 JSON","Copiar JSON del documento","Copier le JSON du document","Dokument-JSON kopieren","Copia JSON del documento","Copiar JSON do documento"],
@@ -79,11 +81,13 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Export as Markdown": ["Markdown で書き出す","导出为 Markdown","匯出為 Markdown","Exportar como Markdown","Exporter en Markdown","Als Markdown exportieren","Esporta come Markdown","Exportar como Markdown"],
"Export as Markdown…": ["Markdown で書き出す…","导出为 Markdown…","匯出為 Markdown…","Exportar como Markdown…","Exporter en Markdown…","Als Markdown exportieren…","Esporta come Markdown…","Exportar como Markdown…"],
"File": ["ファイル","文件","檔案","Archivo","Fichier","Datei","File","Ficheiro"],
+ "Fills the window": ["ウィンドウいっぱいに広げます","铺满整个窗口","鋪滿整個視窗","Ocupa toda la ventana","Occupe toute la fenêtre","Füllt das Fenster","Riempie la finestra","Preenche a janela"],
"Filter": ["フィルター","筛选","篩選","Filtrar","Filtrer","Filtern","Filtra","Filtrar"],
"Filter blocks…": ["ブロックを絞り込む…","筛选块…","篩選區塊…","Filtrar bloques…","Filtrer les blocs…","Blöcke filtern…","Filtra i blocchi…","Filtrar blocos…"],
"Find": ["検索","查找","尋找","Buscar","Rechercher","Suchen","Trova","Localizar"],
"Find in this space…": ["このスペース内を検索…","在此空间中查找…","在此空間尋找…","Buscar en este espacio…","Rechercher dans cet espace…","In diesem Space suchen…","Trova in questo spazio…","Localizar neste espaço…"],
"Find or create a page…": ["ページを検索または作成…","查找或新建页面…","尋找或建立頁面…","Buscar o crear una página…","Trouver ou créer une page…","Seite finden oder erstellen…","Trova o crea una pagina…","Encontrar ou criar uma página…"],
+ "Full width": ["全幅","全宽","全寬","Ancho completo","Pleine largeur","Volle Breite","Larghezza piena","Largura total"],
"Group": ["グループ","分组","分組","Agrupar","Grouper","Gruppieren","Raggruppa","Agrupar"],
"Guest": ["ゲスト","访客","訪客","Invitado","Invité","Gast","Ospite","Convidado"],
"Hide the page list ([)": ["ページ一覧を隠す([)","隐藏页面列表([)","隱藏頁面清單([)","Ocultar la lista de páginas ([)","Masquer la liste des pages ([)","Seitenliste ausblenden ([)","Nascondi l'elenco delle pagine ([)","Ocultar a lista de páginas ([)"],
@@ -174,6 +178,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Resized": ["縮小済み","已缩放","已縮小","Redimensionada","Redimensionnée","Verkleinert","Ridimensionata","Redimensionada"],
"Restore": ["復元","恢复","還原","Restaurar","Restaurer","Wiederherstellen","Ripristina","Restaurar"],
"Restore to the page list": ["ページ一覧に戻す","恢复到页面列表","還原到頁面清單","Restaurar a la lista de páginas","Restaurer dans la liste des pages","Zurück in die Seitenliste","Ripristina nell’elenco delle pagine","Restaurar para a lista de páginas"],
+ "Room for a board or a table": ["ボードや表にちょうどよい幅","给看板或表格留出空间","給看板或表格留出空間","Espacio para un tablero o una tabla","De la place pour un tableau","Platz für ein Board oder eine Tabelle","Spazio per una bacheca o una tabella","Espaço para um quadro ou uma tabela"],
"Save": ["保存","保存","儲存","Guardar","Enregistrer","Speichern","Salva","Guardar"],
"Save (⌘S)": ["保存 (⌘S)","保存 (⌘S)","儲存 (⌘S)","Guardar (⌘S)","Enregistrer (⌘S)","Speichern (⌘S)","Salva (⌘S)","Guardar (⌘S)"],
"Save a copy…": ["コピーを保存…","保存副本…","儲存副本…","Guardar una copia…","Enregistrer une copie…","Kopie speichern…","Salva una copia…","Guardar uma cópia…"],
@@ -249,6 +254,8 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {
"Version, language, password, exports": ["バージョン・言語・パスワード・書き出し","版本、语言、密码、导出","版本、語言、密碼、匯出","Versión, idioma, contraseña, exportaciones","Version, langue, mot de passe, exports","Version, Sprache, Passwort, Export","Versione, lingua, password, esportazioni","Versão, idioma, senha, exportações"],
"Visit bento.page (opens in a new tab)": ["bento.page を開く(新しいタブ)","访问 bento.page(在新标签页打开)","造訪 bento.page(在新分頁開啟)","Visitar bento.page (se abre en una pestaña nueva)","Aller sur bento.page (nouvel onglet)","bento.page besuchen (öffnet in neuem Tab)","Vai su bento.page (si apre in una nuova scheda)","Visitar bento.page (abre num novo separador)"],
"Warning": ["警告","警告","警告","Advertencia","Avertissement","Warnung","Avviso","Aviso"],
+ "Wide": ["広め","加宽","加寬","Ancho","Large","Breit","Largo","Largo"],
+ "Width": ["幅","宽度","寬度","Anchura","Largeur","Breite","Larghezza","Largura"],
"Width in the text column": ["本文カラム内の幅","在正文栏中的宽度","相對於文字欄的寬度","Ancho en la columna de texto","Largeur dans la colonne de texte","Breite in der Textspalte","Larghezza nella colonna di testo","Largura na coluna de texto"],
"Wrong password — try again": ["パスワードが違います — もう一度お試しください","密码错误 — 请重试","密碼錯誤 — 請重試","Contraseña incorrecta: inténtalo de nuevo","Mot de passe incorrect — réessayez","Falsches Passwort — bitte erneut versuchen","Password errata — riprova","Palavra-passe incorreta — tente novamente"],
"You have the newest version ({v}).": ["最新バージョンです ({v})。","你已是最新版本 ({v})。","你已是最新版本 ({v})。","Tienes la versión más reciente ({v}).","Vous avez la dernière version ({v}).","Du hast die neueste Version ({v}).","Hai la versione più recente ({v}).","Já tem a versão mais recente ({v})."],
diff --git a/spaces/src/i18n/pt.ts b/spaces/src/i18n/pt.ts
index 056d8346..b5cf37ac 100644
--- a/spaces/src/i18n/pt.ts
+++ b/spaces/src/i18n/pt.ts
@@ -51,6 +51,8 @@ export const pt: Catalog = {
"Clear filter": "Limpar o filtro",
"Close": "Fechar",
"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "Os blocos recolhidos são sempre impressos abertos. A janela de impressão do navegador tem a opção \"Guardar como PDF\".",
+ "Column": "Coluna",
+ "Comfortable for reading": "Confortável para ler",
"Contents": "Índice",
"Contents page": "Página de índice",
"Copy document JSON": "Copiar JSON do documento",
@@ -79,11 +81,13 @@ export const pt: Catalog = {
"Export as Markdown": "Exportar como Markdown",
"Export as Markdown…": "Exportar como Markdown…",
"File": "Ficheiro",
+ "Fills the window": "Preenche a janela",
"Filter": "Filtrar",
"Filter blocks…": "Filtrar blocos…",
"Find": "Localizar",
"Find in this space…": "Localizar neste espaço…",
"Find or create a page…": "Encontrar ou criar uma página…",
+ "Full width": "Largura total",
"Group": "Agrupar",
"Guest": "Convidado",
"Hide the page list ([)": "Ocultar a lista de páginas ([)",
@@ -178,6 +182,7 @@ export const pt: Catalog = {
"Resized": "Redimensionada",
"Restore": "Restaurar",
"Restore to the page list": "Restaurar para a lista de páginas",
+ "Room for a board or a table": "Espaço para um quadro ou uma tabela",
"Save": "Guardar",
"Save (⌘S)": "Guardar (⌘S)",
"Save a copy…": "Guardar uma cópia…",
@@ -253,6 +258,8 @@ export const pt: Catalog = {
"Version, language, password, exports": "Versão, idioma, senha, exportações",
"Visit bento.page (opens in a new tab)": "Visitar bento.page (abre num novo separador)",
"Warning": "Aviso",
+ "Wide": "Largo",
+ "Width": "Largura",
"Width in the text column": "Largura na coluna de texto",
"Wrong password — try again": "Palavra-passe incorreta — tente novamente",
"You have the newest version ({v}).": "Já tem a versão mais recente ({v}).",
diff --git a/spaces/src/i18n/zh-Hans.ts b/spaces/src/i18n/zh-Hans.ts
index 5ea49b3c..7d1f7638 100644
--- a/spaces/src/i18n/zh-Hans.ts
+++ b/spaces/src/i18n/zh-Hans.ts
@@ -51,6 +51,8 @@ export const zh_Hans: Catalog = {
"Clear filter": "清除筛选",
"Close": "关闭",
"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "折叠起来的折叠块打印时一律展开。浏览器的打印对话框里有“存为 PDF”选项。",
+ "Column": "单栏",
+ "Comfortable for reading": "适合阅读的宽度",
"Contents": "目录",
"Contents page": "目录页",
"Copy document JSON": "复制文档 JSON",
@@ -79,11 +81,13 @@ export const zh_Hans: Catalog = {
"Export as Markdown": "导出为 Markdown",
"Export as Markdown…": "导出为 Markdown…",
"File": "文件",
+ "Fills the window": "铺满整个窗口",
"Filter": "筛选",
"Filter blocks…": "筛选块…",
"Find": "查找",
"Find in this space…": "在此空间中查找…",
"Find or create a page…": "查找或新建页面…",
+ "Full width": "全宽",
"Group": "分组",
"Guest": "访客",
"Hide the page list ([)": "隐藏页面列表([)",
@@ -178,6 +182,7 @@ export const zh_Hans: Catalog = {
"Resized": "已缩放",
"Restore": "恢复",
"Restore to the page list": "恢复到页面列表",
+ "Room for a board or a table": "给看板或表格留出空间",
"Save": "保存",
"Save (⌘S)": "保存 (⌘S)",
"Save a copy…": "保存副本…",
@@ -253,6 +258,8 @@ export const zh_Hans: Catalog = {
"Version, language, password, exports": "版本、语言、密码、导出",
"Visit bento.page (opens in a new tab)": "访问 bento.page(在新标签页打开)",
"Warning": "警告",
+ "Wide": "加宽",
+ "Width": "宽度",
"Width in the text column": "在正文栏中的宽度",
"Wrong password — try again": "密码错误 — 请重试",
"You have the newest version ({v}).": "你已是最新版本 ({v})。",
diff --git a/spaces/src/i18n/zh-Hant.ts b/spaces/src/i18n/zh-Hant.ts
index ae912918..599d5f48 100644
--- a/spaces/src/i18n/zh-Hant.ts
+++ b/spaces/src/i18n/zh-Hant.ts
@@ -51,6 +51,8 @@ export const zh_Hant: Catalog = {
"Clear filter": "清除篩選",
"Close": "關閉",
"Collapsed toggles always print open. Your browser's print dialog has the \"Save as PDF\" option.": "收合的摺疊區塊列印時一律展開。「另存為 PDF」的選項在瀏覽器的列印對話方塊中。",
+ "Column": "單欄",
+ "Comfortable for reading": "適合閱讀的寬度",
"Contents": "目錄",
"Contents page": "目錄頁",
"Copy document JSON": "複製文件 JSON",
@@ -79,11 +81,13 @@ export const zh_Hant: Catalog = {
"Export as Markdown": "匯出為 Markdown",
"Export as Markdown…": "匯出為 Markdown…",
"File": "檔案",
+ "Fills the window": "鋪滿整個視窗",
"Filter": "篩選",
"Filter blocks…": "篩選區塊…",
"Find": "尋找",
"Find in this space…": "在此空間尋找…",
"Find or create a page…": "尋找或建立頁面…",
+ "Full width": "全寬",
"Group": "分組",
"Guest": "訪客",
"Hide the page list ([)": "隱藏頁面清單([)",
@@ -178,6 +182,7 @@ export const zh_Hant: Catalog = {
"Resized": "已縮小",
"Restore": "還原",
"Restore to the page list": "還原到頁面清單",
+ "Room for a board or a table": "給看板或表格留出空間",
"Save": "儲存",
"Save (⌘S)": "儲存 (⌘S)",
"Save a copy…": "儲存副本…",
@@ -253,6 +258,8 @@ export const zh_Hant: Catalog = {
"Version, language, password, exports": "版本、語言、密碼、匯出",
"Visit bento.page (opens in a new tab)": "造訪 bento.page(在新分頁開啟)",
"Warning": "警告",
+ "Wide": "加寬",
+ "Width": "寬度",
"Width in the text column": "相對於文字欄的寬度",
"Wrong password — try again": "密碼錯誤 — 請重試",
"You have the newest version ({v}).": "你已是最新版本 ({v})。",
diff --git a/spaces/src/icons.ts b/spaces/src/icons.ts
index 38d42755..fd9f1cd6 100644
--- a/spaces/src/icons.ts
+++ b/spaces/src/icons.ts
@@ -42,6 +42,9 @@ export const ICONS = {
down: svg('<path d="m6 9 6 6 6-6"/>'),
chevronLeft: svg('<path d="m15 18-6-6 6-6"/>'),
chevronRight: svg('<path d="m9 18 6-6-6-6"/>'),
+ widthNarrow: svg('<rect x="8" y="4" width="8" height="16" rx="1.5"/><line x1="3" y1="8" x2="3" y2="16"/><line x1="21" y1="8" x2="21" y2="16"/>'),
+ widthWide: svg('<rect x="5" y="4" width="14" height="16" rx="1.5"/><line x1="2" y1="9" x2="2" y2="15"/><line x1="22" y1="9" x2="22" y2="15"/>'),
+ widthFull: svg('<rect x="2" y="4" width="20" height="16" rx="1.5"/>'),
people: svg('<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>'),
more: svg('<circle cx="12" cy="5" r="1.6" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.6" fill="currentColor" stroke="none"/><circle cx="12" cy="19" r="1.6" fill="currentColor" stroke="none"/>'),
unarchive: svg('<rect x="2" y="4" width="20" height="5" rx="1"/><path d="M4 9v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9"/><polyline points="9 15 12 12 15 15"/><line x1="12" y1="12" x2="12" y2="18"/>'),
diff --git a/spaces/src/model.ts b/spaces/src/model.ts
index 9adc91f5..0aa25919 100644
--- a/spaces/src/model.ts
+++ b/spaces/src/model.ts
@@ -116,6 +116,22 @@ export interface Page {
* the field untouched.
*/
journal?: string
+ /**
+ * How wide this page's column is: absent = the theme measure (prose),
+ * 'wide' = room for a board, 'full' = the whole window.
+ *
+ * ON THE PAGE, not on the theme. `theme.measure` is one number for the whole
+ * document, and the right answer genuinely differs per page: a page of notes
+ * wants a comfortable line, a board wants the room. The renderer ALREADY
+ * knew that — a page carrying a `view` block silently jumped to 1500px — but
+ * it decided for you and offered no way to disagree. This makes that rule
+ * explicit and overridable in one field: a board page with no `width` still
+ * gets its room, and a board page set to normal now gets to be narrow.
+ *
+ * Additive. Absent on every page written before this, and an unknown value
+ * falls back to the measure rather than to nothing.
+ */
+ width?: 'wide' | 'full'
/** the one page daily entries hang from, so the sidebar stays a tree */
journalHome?: boolean
/** out of the sidebar, still searchable and linkable, and ENUMERATED at
diff --git a/spaces/src/render.ts b/spaces/src/render.ts
index 8428299f..b4b86f1a 100644
--- a/spaces/src/render.ts
+++ b/spaces/src/render.ts
@@ -568,9 +568,18 @@ export function renderPage(page: Page, doc: SpacesDoc, opts: RenderOpts = {}): H
// squeezing one into 720px shows two and a half columns of a six-column
// board. A page carrying a view gets the room instead; a page of writing
// keeps its measure.
- const wide = page.blocks.some((b) => b.type === 'view')
- if (doc.theme.measure) inner.style.maxWidth = wide ? '1500px' : `${doc.theme.measure}px`
- if (wide) inner.classList.add('sp-wide')
+ // The page decides; a board is only the DEFAULT for a page that has not.
+ // `width` absent on a board page keeps the room it always had, and an
+ // unknown value from a newer build falls back to the measure rather than to
+ // no width at all.
+ const auto: 'wide' | undefined = page.blocks.some((b) => b.type === 'view') ? 'wide' : undefined
+ const width = page.width === 'wide' || page.width === 'full' ? page.width
+ : page.width === undefined ? auto
+ : undefined
+ if (width === 'full') inner.style.maxWidth = 'none'
+ else if (width === 'wide') inner.style.maxWidth = '1500px'
+ else if (doc.theme.measure) inner.style.maxWidth = `${doc.theme.measure}px`
+ if (width) inner.classList.add('sp-wide')
const h = document.createElement('h1')
h.className = 'sp-title'
diff --git a/spaces/src/styles.css b/spaces/src/styles.css
index 8c4d6350..ee318e80 100644
--- a/spaces/src/styles.css
+++ b/spaces/src/styles.css
@@ -1102,3 +1102,11 @@ button.sp-issue-set:hover { background: var(--chrome-2); border-color: #b9c3d2;
}
.sp-paction:hover { background: var(--chrome-2); }
.sp-paction span { color: var(--muted); font-size: 12px; }
+
+/* A heading inside a menu: the three width rows are a CHOICE among themselves,
+ not three more actions in the list above them. */
+.sp-menu-label {
+ font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
+ color: var(--muted); padding: 10px 10px 4px; margin-top: 4px;
+ border-top: 1px solid var(--line);
+}