breadman: fold New Note into the shared AdwDialog editor surface #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/pad-3-unify-new-note-editor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Part of PAD-3. This does the piece the direction comment calls "the highest-value piece of this ticket":
show_add_note_windowandeditor::open_editorbuilt the same four fields (body, type, time, recurrence) with two different widget sets and two different input languages - a baregtk4::Windowwith plainGtkEntryrows + free labels + a Cancel button for New Note, versus anAdwDialogwithPreferencesGroup/EntryRowrows + the shared chip type-picker for Edit Note. The code comments already flagged this as a bug.Changes
editor.rs: the field surface is extracted intobuild_fields(), shared byopen_editor(existing note) and a newopen_new_note(fresh note). Both now render the identicalAdwDialog+AdwHeaderBar+AdwPreferencesGroupsurface via a smallshell()helper.open_new_notekeeps create-time semantics: the body runs throughparse_rule_based(so "todo: call the vet tomorrow 9am" still sets type/time/cleaned body), an explicit type pick always overrides the parser, thensave_note+Scheduler::schedule. Enter in the body field submits when time/recurrence are empty, same as before.main.rs:show_add_note_windowis now a thin wrapper overopen_new_notethat wires theAppStaterefresh into its callbacks and presents the dialog against the parent. Itson_buildhook is nowimpl FnOnce(&adw::Dialog)(was>k4::Window) for screenshot mode.spawn_bgmoved here aspub(crate)- it was duplicated ineditor.rsand already imported fromviews/row.rs, so this consolidates all three copies into one.Net
-250 / +278lines, most of it the deleted bespoke dialog.Deferred (still open on PAD-3)
The main-window chrome pass from the direction comment -
gtk4::ApplicationWindow->adw::ApplicationWindow+adw::NavigationSplitView+adw::HeaderBars, search moved into the header - is not in this PR. There is no existing GTKNavigationSplitViewimplementation anywhere in the ecosystem to model it on (breadhelp, the only other adw app, uses a plain window + stack + tab switcher), and a blind split-view conversion needs visual iteration a headless run can't do safely. See the issue comment.Verification
cargo build -p breadman,cargo clippy --workspace --all-targets --locked -- -D warnings: cleancargo test --workspace --locked: all pass (169 + 15 + 26 + 16 + 28 ...)cargo fmt:editor.rsis fully clean; my changes reduce the repo's pre-existing fmt drift by 14 diffs (breadpad CI does not gate fmt)breadman --screenshot new-note,--screenshot editor,--screenshot allagainst a live compositor: all exit 0, the New Note dialog now renders the same AdwDialog + HeaderBar as the editor. Full-window captures need thebread-captureorchestrator to position the window, which isn't available here.Refs PAD-3 (Breadway/breadpad#3).
Hold this PR - do not merge standalone.
Per the decision on PAD-3, the deferred chrome pass (adw::ApplicationWindow + NavigationSplitView + header-search conversion of
build_app_window) will be done now, interactively, before BOS 0.6.2. This PR's New Note / editor unification lands as part of that complete refresh in a single PR, not on its own.The branch work here is sound and stays as the base for the chrome pass.
Flagging before this sits any longer: PR #6 now has a merge conflict with main, and it's not a simple rebase. main's only new commit since this branch's base is "Rebuild breadman as a Tauri 2 + Svelte app (PAD-3)" (breadpad#7, merged after this branch was cut). That PR replaced the GTK4 app this branch modifies (editor.rs, main.rs, the AdwDialog New Note/editor unification) with a Tauri+Svelte frontend. The GTK4 files this PR touches likely no longer exist on main in their old form, so this is not a whitespace-conflict rebase, the work may be entirely superseded by the rewrite.
This also still carries your own "hold, do not merge standalone" comment from before the rebuild landed. Given the rebuild already happened, that hold decision may itself need revisiting: is there anything in this branch's dialog-unification approach worth porting into the new Tauri/Svelte New Note UI, or is it fully moot now? Leaving in review rather than todo since this needs your call on the branch's fate, not a rework cycle.
Not merging: conflicted, and explicitly on hold besides.
Closing as moot per the user's call: main replaced the GTK4 breadman codebase this PR targets with a Tauri 2 + Svelte rewrite, so the dialog-unification work no longer has anything to apply to. Not porting forward for now.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.