feat(styles): make style managers transactional — persist only on Apply

A style manager is now a staged transaction. When it opens, a snapshot of
the style tables, style objects and current-style pointers is taken. Every
New / Copy / Delete / Rename / Set Current / property edit mutates the
document live so the dialog previews the result, but the tab is not marked
dirty, nothing is pushed to undo, and the drawing is not rebuilt.

- Apply commits: one undo entry (restoring the pre-edit state), the tab is
  marked dirty, the drawing rebuilds, and the baseline is reset so further
  edits stage afresh.
- Closing the window without Apply discards: the opening snapshot is
  restored, so none of the changes persist.

Side effects (dirty / undo / bump_geometry) were removed from every style
edit handler and routed exclusively through the commit. Multiline's Apply
is a structural-only commit since its editor has no editable properties.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-10 15:38:32 +03:00
1 parent 65a25033bc
commit de4eb31003
6 files changed
+205 -101

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
use crate::app::Message;
use iced::widget::{
button, checkbox, column, container, pick_list, row, scrollable, text, text_input, Space,
button, checkbox, column, container, pick_list, row, scrollable, text, text_input,
};
use iced::{Background, Border, Color, Element, Fill, Theme};
+2 -2
View File
@@ -1,8 +1,8 @@
//! Multiline Style Manager window — fills the entire OS window.
use crate::app::Message;
use iced::widget::{column, container, row, scrollable, text, Space};
use iced::{Background, Color, Element, Fill, Theme};
use iced::widget::{column, container, row, scrollable, text};
use iced::{Color, Element, Fill};
const DIM: Color = Color {
r: 0.55,
-1
View File
@@ -3,7 +3,6 @@
use crate::app::Message;
use iced::widget::{
button, checkbox, column, container, pick_list, row, scrollable, text, text_input, Column,
Space,
};
use iced::{Background, Border, Color, Element, Fill, Theme};