Repository navigation
feat(sidebar): add a connect-to-server dialog with optional pinning - #1726
Conversation
Add "Add network location…" to the Network row's context menu with a modal dialog that validates a single URI and, on request, pins the location to the sidebar only after the location loads successfully. Failed mounts and rejected loads never leave a bookmark behind, and the stored pin is normalized through GIO so the sidebar row matches the bookmark parser's form and unpins cleanly on a later removal. Unmount, eject, or externally removing a network mount also unpins the matching location, gated to network schemes so removable-media pins survive and skipped when the same root is still mounted. Ship the localized dialog strings in all eleven supported languages.
|
Keeping pins for network locations that are unmounted or unreachable is intentional (#1373, #67). A mount disappearing doesn't mean the user is done with that location: the server may be rebooting, the network may have dropped, GVfs may have timed out, or they may have disconnected for now and plan to come back. A pin is also the quickest way back in, since clicking a pinned share remounts it. Pins live in the GTK bookmarks file that Nautilus and other apps share, so removing one automatically takes it away everywhere, and the user has no idea why. That's why cleanup only happens for confirmed deletions, never because a mount went away. Could you drop the |
…ends Connect now locks the form and shows the dialog spinner until the location opens or fails. Validation, mount and authentication failures appear inline in the dialog instead of a second error dialog, and Cancel or Escape cancels the pending validation or mount. The pin is written only once the location opens, which replaces the event-tracking PinTracker. Pins are no longer removed when a network mount goes away, since a pin is the quickest way back to a share that is temporarily unavailable. The network:/// root is now titled "Network" in columns, breadcrumbs and the window title, and the untranslatable URI placeholder left the catalogs.
With nothing pinned, the sidebar showed a Pinned heading over an empty gap. The section now stays hidden and appears only while a file drag is over the sidebar, so dragging a folder in still pins it.
GTK 4.24 leaves a spinner that was stopped and hidden blank or frozen when it is started again, so retries after a failed connect showed no working spinner. Each attempt now swaps in a fresh spinner. GTK's spinner also fades in over about a second, so a retry that fails at once looked as if Connect did nothing. A failure now holds the dialog busy for at least one second before showing its error.
The dialog connects to a server and only pins it when asked, so it is now "Connect to server…" with a "Pin to sidebar" checkbox, matching the sidebar's Pinned and Unpin wording and reusing the existing translation.
My bad my laptop had suddenly gone off probably due to motherboard issue while I was working on solution so i couldn't fix it |
…ompat-followups Resolves the catalog, services, preview test, context menu, theme and typed-navigation conflicts, and adapts what main added since the fork to this branch's rules: - The user stylesheet (#1758) is watched through the monitors worker and re-read off the UI thread. - The Diagnostics page (#1735) and the Integrations page (#1748) detect the package manager and resolve the terminal off the UI thread; the Run-in-terminal button spawns through the reaper closure. - Connect to server (#1726) waits for a native path's asynchronous validation instead of pinning and closing at once. - The pinned-places tests read the GTK bookmarks file through adapters::bookmarks after the settings writer settles. - Traditional Chinese (#1745) gets the strings this branch adds.
Description
Strata could open
smb://,sftp://,ftp://, anddavs://URIs typed into the location bar, but there was no discoverable way to add a network location or keep one a click away. The Network sidebar row's context menu now offers Connect to server…, which opens a dialog with a server address field and a Pin to sidebar checkbox. Without the checkbox it connects once, like typing the address in the location bar; with it, the share is also pinned.network:///root is now titled Network (localized) in its column, breadcrumbs, and window title instead ofnetwork:.Dialog strings are localized in all eleven supported languages.
Visual evidence
Before (contributor's recording: the dialog closes on Connect with no feedback, and the column reads
network:):https://github.com/user-attachments/assets/b6ddb8ab-4b13-4934-b49d-f74f85fa841d
After: screenshots pending upload by the maintainer (connecting state, inline error, Network column title).
How to test
nonsenseand press Connect: an inline validation error appears and the dialog stays open.sftp://10.255.255.1/shareand press Connect: the fields and Connect disable and the spinner runs. Press Cancel: the dialog closes and nothing opens later.sftp://nonexistent.invalid/shareand press Connect: the dialog stays open with "That host couldn’t be found…" under the address. No pin is added.Expected result: The dialog always reports an outcome before closing, cancellation never opens the location later, and network locations are pinned only after they open and stay pinned until the user unpins them.
Related issue
Closes #1725