Compare commits

...
Author SHA1 Message Date
autocraft-bot[bot] 9023412620 Merge main (aac335b5) into the pull request
Only docs/typing-parity.md conflicted, in the one-line "Change" header. 

Only docs/typing-parity.md conflicted, in the one-line "Change" header. I kept the default branch's line, which starts with its new #7307 entry and the #6518 entry. Then I added the pull request's #6516 entry after the #6518 one, in the same "previously trivial" form as before. The PR's new section and revision-history row merged cleanly. No conflict markers are left in any .rs or .md file. cargo fmt --check is clean. The engine tests matching "toggle" pass, including `toggles_on_mixed_selection_follow_first_character` and `toggle_on_a_selection_from_an_empty_paragraph_follows_the_first_text`. I did not run clippy or the full test suite.
2026-12-02 19:52:15 +00:00
autocraft-bot[bot] aac335b5e3 Merge pull request #6528 2026-12-02 07:39:07 +00:00
autocraft-bot[bot] 20f9015fec Merge pull request #6523 2026-12-02 07:39:07 +00:00
autocraft-bot[bot] 806d2a0b2f Merge pull request #6213 2026-12-02 07:39:07 +00:00
autocraft-bot[bot] 9048100c16 Merge pull request #4614 2026-12-02 07:39:07 +00:00
fluorine 592d3cb902 Merge remote-tracking branch 'upstream/main' into cursor-arrow-off-paper 2026-11-30 10:14:41 -04:00
Joseph Anglada 8e7fca10b4 Ignore egui performance warnings in i18n audit 2026-11-23 19:51:17 -04:00
Fluorine b83864e0f4 Merge remote-tracking branch 'upstream/main' into HEAD 2026-11-23 18:27:17 -04:00
Fluorine 60ec8580cd Merge commit '7fd0136bc8e643b08977b8692eb9867c992472ea' into sync-pr-6213 2026-11-23 13:51:41 -04:00
Joseph Anglada ac306cf704 Fix rustfmt in off-paper cursor test 2026-11-23 11:15:35 -04:00
fluorineandClaude Haiku 5.5 0ac9cbfba9 Merge main into cursor-arrow-off-paper
The UI port (#7101) moved the press and cursor code into canvas/input.rs and removed ibeam.rs. The cursor fix now lives in PageTextTool::cursor. The test harness for the grey-area test is the shared one, which installs the app's command set.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
2026-11-23 10:18:15 -04:00
Michael Higgins ce2f7789f4 Merge storytold/wordcraft main into fix/6516-toggle-first-character 2026-11-20 17:05:13 -05:00
Martin Ball af9dca95de Merge branch 'main' into fix/right-tab-beyond-indent 2026-11-17 16:59:34 +01:00
Michael Higgins 9d005a6a40 Merge branch 'fix/6516-toggle-first-character' of https://github.com/Higgs32584/wordcraft into fix/6516-toggle-first-character 2026-11-17 09:58:23 -05:00
Michael Higgins 95d1c1b4be Merge storytold/wordcraft main into fix/6516-toggle-first-character 2026-11-17 09:35:27 -05:00
Martin Ball 9e8732bd85 Merge branch 'main' into fix/turned-text-at-least-rows 2026-11-17 13:44:00 +01:00
Martin Ball 4c0b520a53 Merge branch 'main' into cursor-arrow-off-paper 2026-11-17 13:42:52 +01:00
Martin Ball 370489a59b Merge branch 'main' into fix/frames-in-cells 2026-11-17 12:33:37 +01:00
Martin Ball 1392290eec Merge branch 'main' into fix/right-tab-beyond-indent 2026-11-17 08:53:46 +01:00
Martin Ball b2964c2c1c Merge branch 'main' into fix/frames-in-cells 2026-11-17 07:54:18 +01:00
Martin Ball 609aa80e5e Merge branch 'main' into fix/6516-toggle-first-character 2026-11-17 07:25:19 +01:00
Martin Ball 3310e9f5ee Merge branch 'main' into fix/right-tab-beyond-indent 2026-11-17 05:33:56 +01:00
Michael Higgins 376a714e73 Merge storytold/wordcraft main into fix/6516-toggle-first-character 2026-11-16 08:50:01 -05:00
Michael HigginsandClaude Opus 5.5 824a5e2c1d #6516: pin that a selection from an empty paragraph follows its first text
Word ignores an empty paragraph's mark at the start of the selection and
decides from the first text character (review on #6519).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 11:01:00 -05:00
Michael HigginsandClaude Opus 5.5 7612fe17db #6516: toggles on a partly formatted selection follow its first character
Word decides Bold, Italic, Underline and the other character toggles on a
selection from its first character in document order: if it has the format,
the whole selection loses it; otherwise the whole selection gets it.
WordCraft turned the format on unless every selected character had it.
A caret keeps its existing rule, explicit values still set, and the ribbon
state is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-13 10:48:08 -05:00
dfgodvan c120c09423 Layout: a right tab past the right indent takes its text up to the stop, as in Word
A TOC entry in Word's TOC styles has a right indent and a right tab with a dot leader at
the margin, past that indent. Word keeps the page number on the entry's line whenever it
fits between the text and the stop, so the number ends past the indent. WordCraft checked
the first character after the tab against the right indent (the tab has no room yet), and
moved the tab and its number to the next line when the text ended less than a digit short
of the indent.

Measured in Word for Mac 16.93 (Times New Roman 12pt, right indent 1cm, stop at the margin):
entries whose text ends 0.4, 1, 2, 3, 4, 5 and 5.8pt short of the indent all keep their dot
leader and number on the line, the number ending at the stop. With a 0.2cm indent the
number stays on the line when 18.7pt are left before the stop and goes to the next line
when 16.7pt are left.

Text after a right or decimal tab now fits while it ends before the stop. The running
shift of the tab also no longer counts the tab's own room as text: it dropped back to
nothing after every second character, so those characters were checked against the
indent as well. A tab whose text is pending starts with no room on the line it goes to.
2026-11-12 23:12:43 +03:00
Fin Warman f438ec2943 Page-anchored frames in a table cell stay in the cell 2026-11-12 16:01:31 +00:00
fluorine 021269b675 Cursor test: set the Ctrl modifier and check the unit selection starts 2026-11-11 11:10:11 -04:00
fluorine b395c45437 Canvas: classify a press by its own position and gate unit drags on it
A press and a move in one frame no longer let the move decide whether the press began on the paper. A unit selection that began in the grey keeps the arrow.
2026-11-11 10:57:15 -04:00
fluorineandClaude Sonnet 5.5 68c5dfe8c7 Canvas: remember where a press began so scrolling cannot change the pointer
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-11 10:34:47 -04:00
Fluorine eac757af34 Keep off-paper drag cursor as arrow 2026-11-10 19:07:59 -04:00
fluorineandClaude Sonnet 5.5 3c159e2331 Canvas: keep the arrow off the paper, show the text pointer only over a page
The grey around and between pages and the rulers showed the I-beam although no text
can be typed there. They keep the arrow now; a drag begun on the page keeps its I-beam.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-10 16:04:10 -04:00
10 changed files with 247 additions and 10 deletions
+12 -2
View File
@@ -351,6 +351,16 @@ fn resolved(s: &Session) -> Vec<ResolvedChar> {
out
}
/// Whether a toggle without a `value` turns its format on. A selection follows its first character
/// in document order, as Word does: one that starts formatted loses the format, all of it (#6516).
fn turns_on(s: &Session, has: impl Fn(&ResolvedChar) -> bool) -> bool {
let chars = resolved(s);
if !s.sel.is_collapsed() || selected_text_box(s).is_some() || column_rows(s).is_some() {
return !chars.first().is_some_and(has);
}
!chars.iter().all(has)
}
/// Bold as drawn: a run marked complex script (`w:cs`) or right to left (`w:rtl`) shows its
/// complex-script bold.
fn shown_bold(r: &ResolvedChar) -> bool {
@@ -366,7 +376,7 @@ fn shown_italic(r: &ResolvedChar) -> bool {
fn toggle(s: &mut Session, v: &Value, get: fn(&ResolvedChar) -> bool, set: fn(&mut CharProps, bool)) -> CmdResult {
let on = match p::bool(v, "value") {
Some(b) => b,
None => !resolved(s).iter().all(get),
None => turns_on(s, get),
};
apply(s, &|c| set(c, on))
}
@@ -376,7 +386,7 @@ fn underline(s: &mut Session, v: &Value) -> CmdResult {
let on = match (p::bool(v, "value"), style) {
(Some(b), _) => b,
(None, Some(_)) => true,
(None, None) => !resolved(s).iter().all(|r| r.underline != Underline::None),
(None, None) => turns_on(s, |r| r.underline != Underline::None),
};
let u = if on { style.unwrap_or(Underline::Single) } else { Underline::None };
apply(s, &|c| c.underline = Some(u))
+66
View File
@@ -1043,6 +1043,72 @@ fn bold_toggles_selection_and_caret_word() {
assert_eq!(p.props_of_char(9).italic, None);
}
/// A partly formatted selection toggles by its first character, as Word does (#6516).
#[test]
fn toggles_on_mixed_selection_follow_first_character() {
// `Abc abc` with `fmt` set by `cmd`, then `cmd` with `v` on the selection `from` → `to`.
let toggled = |cmd: &str, fmt: (usize, usize), from: usize, to: usize, v: serde_json::Value| -> String {
let mut s = s();
run(&mut s, "text.insert", json!({"text": "Abc abc"}));
let sel = |s: &mut Session, a: usize, b: usize| {
run(s, "select.range", json!({"anchor": {"block": 0, "off": a}, "focus": {"block": 0, "off": b}}));
};
sel(&mut s, fmt.0, fmt.1);
run(&mut s, cmd, json!({"value": true}));
sel(&mut s, from, to);
run(&mut s, cmd, v);
let p = s.doc.para_at(&Pos::body(0, 0)).unwrap();
(0..7)
.map(|i| {
let c = p.props_of_char(i);
match cmd {
"format.italic" => c.italic == Some(true),
"format.underline" => c.underline.is_some_and(|u| u != wordcraft_doc::props::Underline::None),
_ => c.bold == Some(true),
}
})
.map(|on| if on { 'F' } else { '.' })
.collect()
};
let t = || json!({});
for cmd in ["format.bold", "format.italic", "format.underline"] {
// `FFF....`: a selection starting on formatted text removes the format from all of it.
assert_eq!(toggled(cmd, (0, 3), 2, 5, t()), "FF.....", "{cmd}");
assert_eq!(toggled(cmd, (0, 3), 0, 7, t()), ".......", "{cmd}");
assert_eq!(toggled(cmd, (0, 3), 1, 7, t()), "F......", "{cmd}");
// Made right to left: still the first character in document order.
assert_eq!(toggled(cmd, (0, 3), 5, 2, t()), "FF.....", "{cmd}");
assert_eq!(toggled(cmd, (0, 3), 7, 0, t()), ".......", "{cmd}");
// `....FFF`: a selection starting on plain text applies it to all of it.
assert_eq!(toggled(cmd, (4, 7), 0, 7, t()), "FFFFFFF", "{cmd}");
// An explicit value still sets.
assert_eq!(toggled(cmd, (0, 3), 0, 7, json!({"value": true})), "FFFFFFF", "{cmd}");
assert_eq!(toggled(cmd, (4, 7), 0, 7, json!({"value": false})), ".......", "{cmd}");
}
}
/// A selection that starts in an empty paragraph: Word decides from the first text character, not
/// from the empty paragraph's mark (observed in Word for Windows, #6516 review).
#[test]
fn toggle_on_a_selection_from_an_empty_paragraph_follows_the_first_text() {
let toggled = |mark_bold: bool, text_bold: bool| -> Option<bool> {
let mut s = s();
run(&mut s, "text.newParagraph", json!({}));
run(&mut s, "text.insert", json!({"text": "abc"}));
let first = Pos::body(0, 0);
s.doc.para_mut(first.story, &first.path).unwrap().mark.bold = Some(mark_bold);
run(&mut s, "select.range", json!({"anchor": {"block": 1, "off": 0}, "focus": {"block": 1, "off": 3}}));
run(&mut s, "format.bold", json!({"value": text_bold}));
run(&mut s, "select.range", json!({"anchor": {"block": 0, "off": 0}, "focus": {"block": 1, "off": 3}}));
run(&mut s, "format.bold", json!({}));
s.doc.para_at(&Pos::body(1, 0)).unwrap().props_of_char(0).bold
};
// A bold empty paragraph before plain text: Bold goes on.
assert_eq!(toggled(true, false), Some(true));
// A plain empty paragraph before bold text: Bold comes off.
assert_eq!(toggled(false, true), Some(false));
}
#[test]
fn border_toggles_and_saves() {
use wordcraft_doc::props::Border;
+3 -1
View File
@@ -261,6 +261,8 @@ pub(crate) fn layout_box(ctx: &mut Ctx, input: BoxInput<'_>) -> BoxLayout {
// Word has no frames in a text box: a framed paragraph there (its style's frame, usually)
// runs with the box's text (#2357).
let frames = !matches!(story, StoryRef::Part(id) if ctx.doc.parts.get(&id).is_some_and(|p| p.kind == wordcraft_doc::PartKind::TextBox));
// Nor in a table cell for a frame placed on the page: Word keeps its text in the cell.
let cell_frame = |fr: &wordcraft_doc::props::TextFrame| !in_cell || fr.v_anchor == "text";
// The bottom of the last paragraph's lines.
let mut prev_end = 0.0f32;
// Where the last paragraph, whose mark is hidden, ended: the next one goes on from there.
@@ -282,7 +284,7 @@ pub(crate) fn layout_box(ctx: &mut Ctx, input: BoxInput<'_>) -> BoxLayout {
// A text frame (a footer's page number in a frame, say) is placed apart, like a
// floating object, and the text after it wraps around it; it takes no room in
// the flow.
if let Some(fr) = pl.rp.frame.clone().filter(|_| frames) {
if let Some(fr) = pl.rp.frame.clone().filter(|fr| frames && cell_frame(fr)) {
let fw = fr.w.unwrap_or_else(|| natural_width(&pl)).clamp(1.0, 1584.0);
let pf = if (fw - width).abs() > 0.01 { ctx.para_labelled(p, fw, table, &[], label) } else { pl };
let h = match fr.h {
+16 -5
View File
@@ -909,19 +909,29 @@ impl Scan {
}
self.x += w;
}
_ => self.pending_tab = Some((j, stop, self.x)),
_ => {
// Its room grows from nothing with its text (a tab moved on from the line before
// may still hold the width it had there).
if let Some(c) = pl.clusters.get_mut(j) {
c.adv = 0.0;
}
self.pending_tab = Some((j, stop, self.x));
}
}
if stop.leader != TabLeader::None {
self.leaders.push((j, stop.leader));
}
}
/// Whether text after a right/centre tab grows leftwards into the tab's space first.
/// Whether text after a right/centre tab grows leftwards into the tab's space first. Up to a
/// right or decimal stop it fits even past the right indent (Word: a TOC entry whose text ends
/// less than a digit short of the indent keeps its page number on its line when the stop is
/// at the margin); unshifted, the text after the tab ends at `x - room`.
fn absorbs(&self, pl: &ParaLayout, advance: f32) -> bool {
self.pending_tab.is_some_and(|(tj, stop, _)| {
let room = pl.clusters.get(tj).map(|t| t.adv).unwrap_or(0.0);
match stop.align {
TabAlign::Right | TabAlign::Decimal => room >= advance,
TabAlign::Right | TabAlign::Decimal => room >= advance || self.x - room + advance <= stop.pos + 0.01,
TabAlign::Center => room >= advance / 2.0 && self.x + advance / 2.0 <= self.right_edge + 0.01,
_ => false,
}
@@ -997,7 +1007,9 @@ impl Scan {
/// Text after a decimal/centre/right tab shifts as it grows.
fn shift_pending_tab(&mut self, pl: &mut ParaLayout) {
let Some((tj, stop, tx)) = self.pending_tab else { return };
let seg_w = self.x - tx;
// `x` includes the room the tab has so far.
let old = pl.clusters.get(tj).map(|c| c.adv).unwrap_or(0.0);
let seg_w = self.x - tx - old;
let shift = match stop.align {
TabAlign::Right => stop.pos - tx - seg_w,
TabAlign::Center => stop.pos - tx - seg_w / 2.0,
@@ -1006,7 +1018,6 @@ impl Scan {
_ => 0.0,
};
let shift = shift.max(0.0);
let old = pl.clusters.get(tj).map(|c| c.adv).unwrap_or(0.0);
if (shift - old).abs() > 0.001 {
let delta = shift - old;
if let Some(c) = pl.clusters.get_mut(tj) {
+68
View File
@@ -1970,6 +1970,54 @@ fn leader_dots_are_spaced_and_placed_as_in_word() {
}
}
/// A TOC entry with a right indent and its right tab at the margin, past the indent (Word's TOC
/// styles): the page number may end past the indent, up to the stop. Like Word, the number stays
/// on the text's line whenever it fits between the text and the stop, also when the text ends
/// less than a digit short of the indent; when it doesn't fit there, the tab and the number go
/// to the next line as before.
#[test]
fn right_tab_past_the_right_indent_takes_its_number_up_to_the_stop() {
use wordcraft_doc::props::{TabAlign, TabLeader, TabStop};
let stop = 72.0 + 468.0;
let mut close = 0;
for indent in [28.35f32, 6.0] {
let edge = stop - indent;
for m in 20..40 {
for r in 2..7 {
let text = format!("{}{}\t104", "abc ".repeat(m), "y".repeat(r));
let n = text.chars().count();
let tab = n - 4;
let mut d = Document::from_text(&text);
d.format_paragraphs(&Pos::body(0, 0), &Pos::body(0, 0), &|p| {
p.indent_right = Some(indent);
p.tabs = Some(vec![TabStop { pos: 468.0, align: TabAlign::Right, leader: TabLeader::Dot }]);
})
.unwrap();
let l = lay(&d);
let Some(para) = l.pages[0].items.iter().find_map(|i| if let Placed::Lines { para, .. } = i { Some(para.clone()) } else { None })
else {
panic!("no lines")
};
let line_of = |k: usize| para.lines.iter().position(|l| l.c0 <= k && k < l.c1).unwrap();
// Where the text ends and how wide the number is (the text's last letter and the number
// are each on one line; the last two letters are both a "y").
let last = l.caret(&Pos::body(0, tab - 1)).unwrap().x;
let text_end = last + (last - l.caret(&Pos::body(0, tab - 2)).unwrap().x);
let end = l.caret(&Pos::body(0, n)).unwrap().x;
let number = end - l.caret(&Pos::body(0, n - 3)).unwrap().x;
assert!((end - stop).abs() < 0.5, "indent {indent}, {m} words + {r}: number ends at {end}");
assert_eq!(line_of(tab), line_of(n - 1), "indent {indent}, {m} words + {r}: the tab and its number are on different lines");
let same = line_of(tab) == line_of(tab - 1);
assert_eq!(same, text_end + number <= stop + 0.01, "indent {indent}, {m} words + {r}: text ends at {text_end}, number {number} wide");
if same && text_end > edge - number / 3.0 {
close += 1;
}
}
}
}
assert!(close > 0, "no entry whose text ends within a digit of the indent");
}
/// A left tab whose only stop is past the right indent wraps; on the next line it still can't
/// reach that stop, so it takes no room there and its text starts at the indent instead of
/// going to a line of its own.
@@ -12690,6 +12738,26 @@ fn a_text_frame_in_a_cell_floats_beside_the_text() {
assert!(frame.x > text.x + 200.0, "right-aligned in the cell: {} vs {}", frame.x, text.x);
}
/// A cell paragraph framed against the page (a divider page's floating table, its paragraphs
/// carrying the table's page position as a frame) stays in its cell in Word. WordCraft placed it
/// apart at the page offset, past the page's foot, and added a blank page per divider.
#[test]
fn a_page_anchored_frame_in_a_cell_stays_in_the_cell() {
use wordcraft_doc::props::TextFrame;
let mut d = Document::from_text("Above");
let mut t = Table::new(1, 1, 300.0);
let mut framed = wordcraft_doc::Paragraph::with_text("Divider", Default::default());
framed.props.frame = Some(TextFrame { y: 777.5, h_anchor: "page".into(), v_anchor: "page".into(), wrap: "around".into(), ..Default::default() });
let text = wordcraft_doc::Paragraph::with_text("Cell text", Default::default());
t.rows[0].cells[0].blocks = vec![wordcraft_doc::para_block(framed), wordcraft_doc::para_block(text)];
d.insert_block(StoryRef::Body, &Path::top(1), wordcraft_doc::Block::Table(t)).unwrap();
let l = lay(&d);
let at = |i: u32| l.caret(&Pos { story: StoryRef::Body, path: Path(vec![1, 0, 0, i]), off: 0 }).unwrap();
let (frame, text) = (at(0), at(1));
assert!(text.top > frame.top + 5.0, "the framed paragraph takes its line: {} vs {}", frame.top, text.top);
assert_eq!(l.pages.len(), 1, "no page for the frame's offset");
}
/// Word has no frames inside a text box: a paragraph there whose style carries a frame (a
/// letterhead's "Weld" and "Governor" styles, framed at the page's left) runs in the box's text
/// like any other. WordCraft placed each one apart at the frame's offset, so two of them in a row
+5 -1
View File
@@ -271,7 +271,11 @@ impl CanvasTool for PageTextTool<'_> {
if let Some(c) = ObjectGesture::cursor(&*self.app, &self.layout, self.body, pointer.pos, pointer.mods) {
return c;
}
let Some((page, x, y)) = page_of(self.body.pages, pointer.pos) else { return Cursor::System(CursorIcon::Default) };
// Off the paper the arrow shows, except while a drag that began on the page is still held.
let Some((page, x, y)) = page_of(self.body.pages, pointer.pos) else {
let held = self.app.canvas.dragging || self.app.canvas.unit_drag.is_some();
return if held { text() } else { Cursor::System(CursorIcon::Default) };
};
// The selection bar keeps its arrow.
if self.app.session.sel.focus.story == StoryRef::Body && !pointer.mods.alt && self.layout.selection_bar_at(page, x, y).is_some() {
return Cursor::System(CursorIcon::Default);
+61
View File
@@ -658,6 +658,67 @@ fn an_armed_format_painter_changes_the_pointer() {
assert!(matches!(bar, None | Some(Cursor::System(CursorIcon::Default))), "the selection bar keeps its arrow: {bar:?}");
}
/// The text pointer shows over the paper only: the grey beside a page keeps the arrow.
#[test]
fn the_text_pointer_stays_off_the_grey_around_the_page() {
let mut a = WordApp::new(wordcraft_engine::Session::new(wordcraft_doc::Document::new()), Default::default());
a.run("text.insert", json!({"text": "Some text"})).unwrap();
a.run("view.commentsPane", json!({"value": false})).unwrap();
let mut h = crate::test_harness::builder().with_size(egui::vec2(1440.0, 900.0)).with_step_dt(1.0 / 60.0).build_ui_state(
|ui, app: &mut WordApp| {
let ctx = ui.ctx().clone();
app.logic(&ctx);
app.ui(ui);
},
a,
);
for _ in 0..6 {
h.step();
}
let c = h.state_mut().session.layout().caret(&Pos::body(0, 4)).expect("caret");
let y = c.top + c.height / 2.0;
let on_page = page_to_screen(h.state_mut(), c.page, c.x, y).expect("on screen");
let beside = page_to_screen(h.state_mut(), c.page, -40.0, y).expect("on screen");
h.event(egui::Event::PointerMoved(on_page));
h.step();
assert_ne!(h.output().platform_output.cursor_icon, egui::CursorIcon::Default, "text pointer on the paper");
h.event(egui::Event::PointerMoved(beside));
h.step();
assert_eq!(h.output().platform_output.cursor_icon, egui::CursorIcon::Default, "arrow on the grey beside the page");
// A drag that starts on the page retains its text pointer after moving off it.
h.event(egui::Event::PointerMoved(on_page));
h.step();
h.event(egui::Event::PointerButton { pos: on_page, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() });
h.step();
h.event(egui::Event::PointerMoved(beside));
h.step();
assert_ne!(h.output().platform_output.cursor_icon, egui::CursorIcon::Default, "a drag that began on the page keeps its text pointer");
h.event(egui::Event::PointerButton { pos: beside, button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() });
h.step();
// A drag that begins in the grey area must not inherit the text cursor merely because the
// canvas response is dragged. Keep the pointer off the page for the whole drag.
h.event(egui::Event::PointerButton { pos: beside, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() });
h.step();
let further_beside = beside + egui::vec2(20.0, 0.0);
h.event(egui::Event::PointerMoved(further_beside));
h.step();
assert_eq!(h.output().platform_output.cursor_icon, egui::CursorIcon::Default, "arrow during a drag that began in the grey area");
h.event(egui::Event::PointerButton { pos: further_beside, button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() });
h.step();
// A press on the page and a move onto the grey that arrive in one frame: the press decides.
h.event(egui::Event::PointerMoved(on_page));
h.step();
h.event(egui::Event::PointerButton { pos: on_page, button: egui::PointerButton::Primary, pressed: true, modifiers: Default::default() });
h.event(egui::Event::PointerMoved(beside));
h.step();
assert_ne!(h.output().platform_output.cursor_icon, egui::CursorIcon::Default, "press and move in one frame keep the text pointer");
h.event(egui::Event::PointerButton { pos: beside, button: egui::PointerButton::Primary, pressed: false, modifiers: Default::default() });
h.step();
}
/// #4410: with the Format Painter armed, a double-click on a word paints that word, and the
/// painter goes off again (it was only dragging across the text that painted it).
#[test]
+3
View File
@@ -324,6 +324,7 @@ impl<'a> Exempt<'a> {
|| plain == "CONFIDENTIAL" // the watermark dialog's text: document content, kept as typed
|| plain == "Figure 1" // the caption dialog's sample: the label goes into the document as is
|| clock_text(plain) // the Date and Time preview: formatted from the clock
|| plain.starts_with("egui PERF WARNING:") // framework diagnostic, not application interface text
|| is_url(plain) // a link is data, not wording
}
}
@@ -356,6 +357,8 @@ fn runtime_data_is_exempt_and_wording_is_not() {
}
assert!(exempt.allows(&app, "https://github.com/storytold/wordcraft/releases"));
assert!(!exempt.allows(&app, "Download the newest release"), "an unwrapped sentence is reported");
assert!(exempt.allows(&app, "egui PERF WARNING: request_discard has been called 3 frames in a row"));
assert!(!exempt.allows(&app, "Performance warnings should be translated"));
assert!(!exempt.allows(&app, "See https://example.com now"), "a sentence with a link is not a link");
assert!(!exempt.allows(&app, "11/22/1999 5:28:50 PM"), "a time before the audit began is not the preview");
// A stubbed check finds no update and puts no updater error on screen.
+1
View File
@@ -413,6 +413,7 @@ The front-of-text opt-out is retained from the earlier implementation; this patc
| 2026-10-27 | trivial | A kept-together paragraph in a continuous section is measured against the next page's body, so a tall different first-page header no longer splits one that fits on page 2 (#3907 CodeRabbit) |
| 2026-10-27 | trivial | 2026-10-27 · #4533 review: numeric REF updates lazily index body bookmarks once per update, retaining the first body bookmark for duplicate names. Unsupported switches and ordinary REF/PAGEREF behavior are unchanged; a synthetic 64-reference regression covers repeated updates and duplicate names. Estimates unchanged. |
| 2026-10-27 | trivial | 2026-10-27 · #4533: numeric REF fields use paragraph list numbers for no/full/relative context, reusing bounded numbering. Shared context already embedded in a level label is removed; merged-away cells do not count. Unsupported separator/text/position switches and ambiguous contexts or delimiter-free joins retain cached results. Synthetic OOXML regressions; no native Word or real-document validation, estimates unchanged. |
| 2026-10-27 | trivial | A right or decimal tab past the right indent (a TOC entry's page number at the margin) keeps its text on the line while it ends before the stop, also when the text before the tab ends less than a digit short of the indent; measured in Word for Mac 16.93. `layout::tests::right_tab_past_the_right_indent_takes_its_number_up_to_the_stop` |
| 2026-10-20 | trivial | A click below a floating table, outside its cells, goes to the paragraph beside or after it instead of a cell of its last row, as checked in Word (#2038) |
| 2026-10-19 | trivial | A right, centre or decimal tab whose text doesn't fit, or a left tab past the right indent, starts the next line with its text instead of ending the line (a TOC entry's page number keeps its leader); a left tab still past the right indent there takes no room (#1840) |
| 2026-10-19 | trivial | Justified lines (compatibility mode 15) shrink their spaces to fit one more word by at most a quarter of the spaces' width (was a fifth) and by at most 0.355 of that word's own width with the space before it. Measured in Word for Mac with synthetic justified paragraphs: words of 2.7 to 80 pt, spaces of 3.3 and 6.7 pt, only justified text, last lines included, never in modes 12 and 14. A real paper's justified abstract now breaks like Word on all 23 lines (3 before); on 180 real-world papers, page counts matching Word went from 139 to 142, none further |
+12 -1
View File
File diff suppressed because one or more lines are too long