Repository navigation
feat(app): add an option to hide the Sites section in the panel - #173
mansoorkhan96 wants to merge 7 commits into
Conversation
|
Thanks for the PR, @mansoorkhan96! Flock takes pull requests only for issues a maintainer has approved, so this one is closed. Edit this pull request's description to reference an approved issue, then save it to reopen automatically. See CONTRIBUTING.md. |
|
Thanks for the submission @mansoorkhan96. We require that any UI change be implemented on all three platforms before we accept a PR. Please make your changes available for Windows and Linux as well, along with all applicable tests. |
…Linux tray menu Settings → General gets the same switch on every platform, and the docs mention it. Refs flock-php#172
|
Added the UI changes for Windows and Linux. Tested only on macOS. result.mp4 |
There was a problem hiding this comment.
🟡 Changes recommended
Save-handling issues can leave Sites visibility out of sync with the switch on Windows and Linux, and the Windows switch lacks an accessible label.
3 open issues
What changed in this PR
Adds an opt-in setting to hide Sites from the macOS and Windows panels and the Linux tray menu, addressing #172 while keeping sites available in Settings.
Changes:
- Adds platform-specific General settings with persisted preferences, defaulting to showing Sites.
- Updates panel and tray visibility when the preference changes.
- Adds Windows and Linux tests and documents the setting.
| File | Description |
|---|---|
| windows/Flock.Tray/ViewModels/PanelViewModel.cs | Exposes Sites section visibility and observes preference changes. |
| windows/Flock.Tray/Settings/GeneralPane.xaml.cs | Initializes and saves the hide-sites switch. |
| windows/Flock.Tray/Settings/GeneralPane.xaml | Adds the Panel settings switch. |
| windows/Flock.Tray/PanelWindow.xaml | Binds Sites section and divider visibility. |
| windows/Flock.Tray/Features/Preferences/PreferenceData.cs | Adds the persisted Windows preference. |
| windows/Flock.Tray.Tests/PreferencesTests.cs | Tests defaults, persistence, and preservation of existing preferences. |
| windows/Flock.Tray.Tests/PanelViewModelTests.cs | Tests Sites section visibility mapping. |
| macos/Sources/FlockUI/Settings/GeneralPane.swift | Adds the Menu bar setting backed by AppStorage. |
| macos/Sources/FlockUI/PanelView.swift | Conditionally hides Sites and its divider. |
| linux/src/tray.rs | Conditionally omits the Sites submenu and tests visibility. |
| linux/src/prefs.rs | Persists the preference and tests default compatibility and serialization. |
| linux/src/panes/general.rs | Adds the Tray settings switch. |
| linux/src/model.rs | Loads and updates the preference and notifies listeners. |
| docs/sites.md | Documents the setting on all three platforms. |
Review effort: Balanced

Fixes #172
What and why
With many sites, the Sites section fills most of the panel and pushes the toggles and the Mail, Dumps and Logs shortcuts out of view. This adds a switch to Settings → General on every platform, off by default, so nothing changes unless it's turned on:
panel.hideSites) through@AppStorage, next topanel.expandedSites.PreferenceData.HideSitesInPanelintray.json;PanelViewModelfollowsPreferences.StateChanged, so the panel updates as soon as it's toggled.hide_sitesinapp.json;AppModelholds it and notifies its listeners, so the tray menu drops its Sites submenu right away.Settings → Sites still lists every site.
docs/sites.mdmentions the switch.How I tested it
swift buildandswift test --package-path macospass. Tested by hand with a debug build: the switch hides and shows the Sites section right away.prefs(an olderapp.jsonwithout the field loads with sites shown, and the field round-trips) andtray(the menu has the Sites submenu unless it's hidden).PreferencesTests.PanelShowsSitesUntilTheyAreHiddenAndRemembersIt(an oldertray.jsonloads with sites shown, and the value persists without touching the other preferences), andPanelViewModelTests.SitesSectionShowsUntilThePreferenceHidesIt(the panel's Sites section is visible by default and collapsed when the preference is on).Flock.Tray.Tests, and I don't have a Windows or Linux machine, so Windows and Linux are verified by CI only.Checklist
docs/, or no docs change is needed