Skip to content

Migrate UI to libadwaita 1.8 and align with GNOME HIG - #7

Merged
Xarishark merged 41 commits into
Xarishark:mainfrom
meowtypes:feat/libadwaita-01
Sep 8, 2026
Merged

Xarishark merged 41 commits into
Xarishark:mainfrom
meowtypes:feat/libadwaita-01

Conversation

@meowtypes

@meowtypes meowtypes commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Full migration of the SMB Mount Manager GTK4 UI to libadwaita, followed by a
GNOME HIG audit pass and a libadwaita 1.8 baseline bump that adopts newer APIs.

Libadwaita migration

  • Adw.Application + Adw.StyleManager (delegated color scheme; no custom CSS)
  • Adw.ApplicationWindow with ToolbarView and ToastOverlay
  • Mount list as AdwPreferencesGroup / AdwActionRow (hybrid row pattern:
    switch + inline primary suffix + kebab menu for destructive actions)
  • Empty state via Adw.StatusPage
  • AdwDialog (progressive reveal) for Add Share, with debounced host check
    that runs off the main thread and is cancelled on close
  • Adw.AlertDialog for delete confirmations, Adw.AboutDialog for About
  • All status / error messaging surfaced via Adw.Toast
  • GUI split into mount_manager_ui.py; mount_manager.py stays
    importable without a display so the polkit --helper re-exec path
    doesn't pull in GTK/Adw

GNOME HIG fixes

  • Modern symbolic icon names
  • Header-bar Add Share button styled per HIG
  • About dialog dedup, toast copy aligned with HIG voice
  • Keyboard shortcuts + shortcuts window
  • AddShareDialog focus order and Enter-to-submit

libadwaita 1.8 baseline

  • Minimum libadwaita bumped to 1.8
  • Adw.Spinner in Add Share dialog
  • Adw.ShortcutsDialog replaces the deprecated Gtk.ShortcutsWindow family
  • Gtk.FileLauncher replaces xdg-open for opening mount folders
  • AdwPreferencesGroup.set_separate_rows(True) — mount rows render as
    separate cards

Packaging

  • packaging/build-appimage.sh installs both Python modules under their real
    filenames and symlinks mount-manager → mount_manager.py (needed so
    from mount_manager import … resolves at runtime)
  • packaging/appimage-helper.patch re-anchored and retargeted to
    mount_manager.py

Docs

  • Design specs and implementation plans under docs/specs/ and docs/plans/
  • AGENTS.md updated with new architecture, UI conventions, and packaging notes

Test Plan

  • python3 -m unittest discover -s tests -v — 9/9 pass
  • Helper path remains GUI-free (python3 -X importtime mount_manager.py --helper … shows no Gtk/Adw imports)
  • AppImage builds and launches; cross-module imports resolve in the AppDir
  • Manual smoke: add, remove, and toggle a mount via the GUI
  • Manual smoke: upgrade an existing mount (not tested — no means to test)
  • Polkit helper invocation verified under both source-run and AppImage

meowtypes added 30 commits May 28, 2026 02:58
Previously check_smb_host_reachable ran on the GTK main loop, freezing
the UI for up to 4 seconds (DNS + TCP connect timeout) when the host
could not be reached. Now the call runs in a daemon thread, the result
is marshalled back via GLib.idle_add, and cancellation is driven by a
Gio.Cancellable so that:

  - typing more characters cancels the in-flight check and starts a
    fresh one (no stale result clobbers the UI),
  - closing the dialog cancels the check so its callback never touches
    destroyed widgets.
The Add Share success toast claimed the share would mount when accessed,
but request_helper_create mounts the share immediately and the refreshed
row already reflects the mounted state. Drop the speculative claim and
just confirm the action.
Drop the speculative "will mount when accessed" suffix from the
upgrade toast for the same reason as the create toast: the refreshed
row already reflects the actual mount state, so the toast should only
confirm the action.
meowtypes added 6 commits May 28, 2026 14:30
mount_manager_ui.py does 'from mount_manager import ...', which failed
in the built AppImage because the build script installed mount_manager.py
as 'mount-manager' (renamed, no .py extension, hyphenated -- unimportable
as a Python module). Install it under its real filename and create a
'mount-manager' symlink for the AppRun entry point. Retarget the helper
patch to mount_manager.py accordingly.
@meowtypes
meowtypes requested a review from Xarishark as a code owner May 28, 2026 22:41
@Xarishark

Copy link
Copy Markdown
Owner

Hey I haven't forgotten about this PR just so you know. I am just swamped with family stuff. Some patience and I will review it and merge it. I srsly appreciate the time you have put on this ❤️

@Xarishark

Xarishark commented Jun 7, 2026 •

Copy link
Copy Markdown
Owner

the share path is missing the hint text in the field with the example \hostname\share so the user knows what to input from the example.

also the progressive reveal described in the PR does not exist as the modal that adds the share already shows the credentials fields.

meowtypes added 2 commits June 7, 2026 13:47
UX fixes for the Add SMB Share dialog:
 - Show example syntax as the Share group's description so users see
   "//hostname/sharename" before typing.
 - Hide the credentials group until the host check succeeds, instead
   of just disabling it, so the form clearly progresses.
 - Replace Adw.PreferencesPage with Adw.Clamp + Gtk.Box so the dialog
   grows to fit revealed content instead of pinning a fixed height
   behind a scrollbar.
 - Drop the redundant header-bar close button; Cancel + Esc remain.
 - Use canonical Adwaita icon names (object-select-symbolic,
   dialog-error-symbolic) for the host-check status indicator.

 Main window polish:
 - Make the Add Share header button icon-only per GNOME HIG.
 - Drop the redundant empty-state description.

 Refactor mount_manager_ui.py (no behavior change):
 - Add a bind_action helper to collapse repeated SimpleAction wiring.
 - Extract _cancel_pending_host_check and _run_helper_action helpers.
 - Inline the GLib_VariantType wrapper, table-drive the shortcuts
   items, simplify the host-check worker and row-clearing loop.

 Docs:
 - Update AGENTS.md and the libadwaita migration design spec to
   reflect the Clamp + Box body and the visible (rather than
   sensitive) credentials-group reveal.

 623 -> 603 lines in mount_manager_ui.py. All tests still pass.
@Xarishark

Copy link
Copy Markdown
Owner

Hey! just an update the reason I havent merged the PR yet is that I dont want to break the native package I have on terra. After I am done with some things I have IRL I will remove the terra package and then merge the PR.

@Xarishark
Xarishark merged commit 8fc70c5 into Xarishark:main Sep 8, 2026
1 check passed
@meowtypes
meowtypes deleted the feat/libadwaita-01 branch September 9, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants