Merge PR #3221: Status bar names footnotes and endnotes, not just header/footer

This commit is contained in:
aiongg
2026-10-22 01:20:01 +00:00
24 changed files with 82 additions and 3 deletions
+1 -1
View File
@@ -3030,7 +3030,7 @@ pub fn in_text_box(app: &WordApp) -> bool {
part_kind(app, app.session.sel.focus.story) == Some(PartKind::TextBox)
}
fn part_kind(app: &WordApp, s: StoryRef) -> Option<PartKind> {
pub(crate) fn part_kind(app: &WordApp, s: StoryRef) -> Option<PartKind> {
match s {
StoryRef::Part(id) => app.session.doc.parts.get(&id).map(|p| p.kind),
StoryRef::Body => None,
+37 -2
View File
@@ -2,7 +2,7 @@
use egui::{Align2, Rect, Sense, Stroke, Ui, pos2, vec2};
use serde_json::json;
use wordcraft_doc::StoryRef;
use wordcraft_doc::{PartKind, StoryRef};
use crate::theme::{Tokens, TypeRung, medium, paint_text, regular, semibold, text_width};
use crate::{WordApp, icons};
@@ -558,7 +558,12 @@ pub fn status_bar(app: &mut WordApp, ui: &mut Ui) {
let _ = app.run("ui.dialog", json!({"name": "wordCount"}));
}
if app.session.sel.focus.story != StoryRef::Body && !crate::canvas::in_text_box(app) {
st(ui, tl!("Editing header/footer"));
let label = match crate::canvas::part_kind(app, app.session.sel.focus.story) {
Some(PartKind::Footnote) => tl!("Editing footnote"),
Some(PartKind::Endnote) => tl!("Editing endnote"),
_ => tl!("Editing header/footer"),
};
st(ui, label);
}
// The language at the caret; a click sets the proofing language (Review › Language).
let lang = crate::ribbon::caret_language(app);
@@ -805,6 +810,36 @@ mod tests {
}
}
/// The status bar's "editing a non-body story" line named every one of them "Editing
/// header/footer", footnotes and endnotes included — it only ever checked "not the body,
/// not a text box", with no regard for which kind of part it actually was.
#[test]
fn status_bar_names_the_actual_part_being_edited() {
let label = |a: &mut WordApp| {
let ctx = ctx();
ctx.enable_accesskit();
let input = egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, vec2(1200.0, 800.0))), ..Default::default() };
let mut out = ctx.run_ui(input, |ui| status_bar(a, ui));
out.textures_delta.clear();
let update = out.platform_output.accesskit_update.take().unwrap();
for prefix in ["Editing footnote", "Editing endnote", "Editing header/footer"] {
if update.nodes.iter().any(|(_, node)| node.label().is_some_and(|l| l == prefix)) {
return prefix.to_string();
}
}
"(none shown)".to_string()
};
let mut a = WordApp::new(wordcraft_engine::Session::new(wordcraft_doc::Document::new()), crate::Services::default());
a.run("text.insert", json!({"text": "Body text"})).unwrap();
a.run("references.footnote", json!({})).unwrap();
assert_eq!(label(&mut a), "Editing footnote");
a.run("caret.docEnd", json!({})).unwrap();
a.run("references.endnote", json!({})).unwrap();
assert_eq!(label(&mut a), "Editing endnote");
a.run("insert.createHeader", json!({})).unwrap();
assert_eq!(label(&mut a), "Editing header/footer");
}
/// #1903: the footer's Cancel row closes the Undo list without undoing anything.
#[test]
fn undo_list_cancel_closes_without_undoing() {
+2
View File
@@ -320,6 +320,8 @@
Edit\nRecipient List Редактиране на\nсписъка с получатели
Edited Редактиран
Editing Редактиране
Editing endnote Редактиране на бележка в края
Editing footnote Редактиране на бележка под линия
Editing header/footer Редактиране на горен/долен колонтитул
Editing — edit the document directly Редактиране – директно редактиране на документа
Editor Редактор
Can't render this file because it contains an unexpected character in line 7 and column 25.
+2
View File
@@ -377,6 +377,8 @@
Edit\nRecipient List Upravit seznam\npříjemců
Edited Upraveno
Editing Úpravy
Editing endnote Úprava vysvětlivky
Editing footnote Úprava poznámky pod čarou
Editing header/footer Úprava záhlaví/zápatí
Editing — edit the document directly Úpravy — přímá úprava dokumentu
Editor Editor
Can't render this file because it contains an unexpected character in line 7 and column 25.
+2
View File
@@ -322,6 +322,8 @@
Edit\nRecipient List Empfängerliste\nbearbeiten
Edited Bearbeitet
Editing Bearbeitung
Editing endnote Endnote bearbeiten
Editing footnote Fußnote bearbeiten
Editing header/footer Kopf-/Fußzeile bearbeiten
Editing — edit the document directly Bearbeitung — das Dokument direkt bearbeiten
Editor Editor
Can't render this file because it contains an unexpected character in line 6 and column 25.
+2
View File
@@ -374,6 +374,8 @@
Edit\nRecipient List Editar lista de\ndestinatarios
Edited Editado
Editing Edición
Editing endnote Editando nota final
Editing footnote Editando nota al pie
Editing header/footer Editando encabezado y pie de página
Editing — edit the document directly Edición — edita el documento directamente
Editor Editor
Can't render this file because it contains an unexpected character in line 6 and column 25.
+2
View File
@@ -238,6 +238,8 @@
Edit\nRecipient List Muuda\nadressaatide loendit
Edited Muudetud
Editing Redigeerimine
Editing endnote Lõpumärkuse redigeerimine
Editing footnote Allmärkuse redigeerimine
Editing header/footer Päise või jaluse redigeerimine
Editing — edit the document directly Redigeerimine — muuda dokumenti otse
Editor Toimetaja
1 # Estonian (et) interface catalog. Columns separated by a TAB:
238
239
240
241
242
243
244
245
+2
View File
@@ -332,6 +332,8 @@
Edit\nRecipient List Modifier\nla liste des destinataires
Edited Modifié
Editing Modification
Editing endnote Modification de la note de fin
Editing footnote Modification de la note de bas de page
Editing header/footer Modification de l’en-tête/pied de page
Editing — edit the document directly Modification — modifier directement le document
Editor Éditeur
Can't render this file because it contains an unexpected character in line 7 and column 25.
+2
View File
@@ -745,6 +745,8 @@
Edit\nRecipient List Uredi\npopis primatelja
Edited Uređeno
Editing Uređivanje
Editing endnote Uređivanje bilješke na kraju
Editing footnote Uređivanje fusnote
Editing header/footer Uređivanje zaglavlja/podnožja
Editing in this document is restricted. Uređivanje u ovom dokumentu je ograničeno.
Editing — edit the document directly Uređivanje – izravno uređujte dokument
Can't render this file because it contains an unexpected character in line 6 and column 25.
+2
View File
@@ -234,6 +234,8 @@
Edit\nRecipient List Címzettlista\nszerkesztése
Edited Szerkesztve
Editing Szerkesztés
Editing endnote Végjegyzet szerkesztése
Editing footnote Lábjegyzet szerkesztése
Editing header/footer Élőfej és élőláb szerkesztése
Editing — edit the document directly Szerkesztés – a dokumentum közvetlen módosítása
Editor Szerkesztő
Can't render this file because it contains an unexpected character in line 6 and column 25.
+2
View File
@@ -315,6 +315,8 @@
Edit\nRecipient List Modifica elenco\ndestinatari
Edited Modificato
Editing Modifica
Editing endnote Modifica nota di chiusura
Editing footnote Modifica nota a piè di pagina
Editing header/footer Modifica intestazione/piè di pagina
Editing — edit the document directly Modifica — modifica direttamente il documento
Editor Editor
Can't render this file because it contains an unexpected character in line 6 and column 25.
+2
View File
@@ -378,6 +378,8 @@
Edit\nRecipient List アドレス帳の編集
Edited 編集済み
Editing 編集
Editing endnote 文末脚注を編集中
Editing footnote 脚注を編集中
Editing header/footer ヘッダー/フッターを編集中
Editing — edit the document directly 編集 — 文書を直接編集します
Editor エディター
1 # Japanese (ja) interface catalog. Same format and clean-room rules as zh-hans.tsv.
378
379
380
381
382
383
384
385
+2
View File
@@ -370,6 +370,8 @@
Edit\nRecipient List 받는 사람\n목록 편집
Edited 편집됨
Editing 편집
Editing endnote 미주 편집
Editing footnote 각주 편집
Editing header/footer 머리글/바닥글 편집
Editing — edit the document directly 편집 — 문서를 직접 편집합니다
Editor 편집기
1 # Korean (ko) interface catalog. Same format and clean-room rules as zh-hans.tsv.
370
371
372
373
374
375
376
377
+2
View File
@@ -236,6 +236,8 @@
Edit\nRecipient List Edytuj listę\nadresatów
Edited Zmieniony
Editing Edytowanie
Editing endnote Edycja przypisu końcowego
Editing footnote Edycja przypisu dolnego
Editing header/footer Edycja nagłówka/stopki
Editing — edit the document directly Edytowanie — zmiany trafiają wprost do dokumentu
Editor Edytor
Can't render this file because it contains an unexpected character in line 6 and column 25.
+2
View File
@@ -379,6 +379,8 @@
Edit\nRecipient List Editar lista\nde destinatários
Edited Editado
Editing Edição
Editing endnote Editando nota de fim
Editing footnote Editando nota de rodapé
Editing header/footer Editando cabeçalho/rodapé
Editing — edit the document directly Edição — edite o documento diretamente
Editor Editor
Can't render this file because it contains an unexpected character in line 6 and column 25.
+2
View File
@@ -236,6 +236,8 @@
Edit\nRecipient List Изменить список\nполучателей
Edited Изменено
Editing Редактирование
Editing endnote Редактирование концевой сноски
Editing footnote Редактирование сноски
Editing header/footer Редактирование колонтитула
Editing — edit the document directly Редактирование — правка документа напрямую
Editor Редактор
Can't render this file because it contains an unexpected character in line 7 and column 25.
+2
View File
@@ -426,6 +426,8 @@
Edit\nRecipient List Uredi\nlistu primalaca
Edited Izmenjeno
Editing Uređivanje
Editing endnote Uređivanje endnote
Editing footnote Uređivanje fusnote
Editing header/footer Uređivanje zaglavlja/podnožja
Editing — edit the document directly Uređivanje — menjajte dokument direktno
Editor Urednik
Can't render this file because it contains an unexpected character in line 6 and column 25.
+2
View File
@@ -430,6 +430,8 @@
Edit\nRecipient List Уреди\nлисту прималаца
Edited Измењено
Editing Уређивање
Editing endnote Уређивање ендноте
Editing footnote Уређивање фусноте
Editing header/footer Уређивање заглавља/подножја
Editing — edit the document directly Уређивање — мењајте документ директно
Editor Уредник
Can't render this file because it contains an unexpected character in line 11 and column 25.
+2
View File
@@ -368,6 +368,8 @@
Edit\nRecipient List Redigera\nmottagarlista
Edited Ändrat
Editing Redigering
Editing endnote Redigerar slutnot
Editing footnote Redigerar fotnot
Editing header/footer Redigerar sidhuvud/sidfot
Editing — edit the document directly Redigering – redigera dokumentet direkt
Editor Språkkontroll
Can't render this file because it contains an unexpected character in line 7 and column 25.
+2
View File
@@ -232,6 +232,8 @@
Edit\nRecipient List Alıcı Listesini\nDüzenle
Edited Düzenlendi
Editing Düzenleme
Editing endnote Sonnot düzenleniyor
Editing footnote Dipnot düzenleniyor
Editing header/footer Üstbilgi/altbilgi düzenleniyor
Editing — edit the document directly Düzenleme — belgeyi doğrudan düzenleyin
Editor Düzenleyici
1 # Turkish (tr) interface catalog. Columns, separated by a TAB:
232
233
234
235
236
237
238
239
+2
View File
@@ -388,6 +388,8 @@
Edit\nRecipient List Редагувати\nсписок одержувачів
Edited Відредаговано
Editing Редагування
Editing endnote Редагування кінцевої виноски
Editing footnote Редагування виноски
Editing header/footer Редагування колонтитула
Editing — edit the document directly Редагування — безпосередні зміни в документі
Editor Редактор
Can't render this file because it contains an unexpected character in line 6 and column 31.
+2
View File
@@ -314,6 +314,8 @@
Edit\nRecipient List Sửa\ndanh sách người nhận
Edited Đã sửa
Editing Chỉnh sửa
Editing endnote Đang chỉnh sửa chú thích cuối tài liệu
Editing footnote Đang chỉnh sửa chú thích chân trang
Editing header/footer Đang chỉnh sửa đầu trang/chân trang
Editing — edit the document directly Chỉnh sửa — sửa tài liệu trực tiếp
Editor Trình biên tập
Can't render this file because it contains an unexpected character in line 7 and column 25.
+2
View File
@@ -390,6 +390,8 @@
Edit\nRecipient List 编辑收件人列表
Edited 已编辑
Editing 编辑
Editing endnote 正在编辑尾注
Editing footnote 正在编辑脚注
Editing header/footer 正在编辑页眉/页脚
Editing — edit the document directly 编辑 — 直接编辑文档
Editor 编辑器
Can't render this file because it contains an unexpected character in line 7 and column 25.
+2
View File
@@ -379,6 +379,8 @@
Edit\nRecipient List 編輯收件者清單
Edited 已編輯
Editing 編輯
Editing endnote 正在編輯章節附註
Editing footnote 正在編輯註腳
Editing header/footer 正在編輯頁首/頁尾
Editing — edit the document directly 編輯 — 直接編輯文件
Editor 編輯器
1 # Traditional Chinese (zh-hant, Taiwan vocabulary) interface catalog. Same format and clean-room
379
380
381
382
383
384
385
386