Skip to content

feat(app): add an option to hide the Sites section in the panel - #173

Open
mansoorkhan96 wants to merge 7 commits into
flock-php:mainfrom
mansoorkhan96:feature/hide-menubar-sites
Open

mansoorkhan96 wants to merge 7 commits into
flock-php:mainfrom
mansoorkhan96:feature/hide-menubar-sites

Conversation

@mansoorkhan96

@mansoorkhan96 mansoorkhan96 commented Nov 14, 2026 •

Copy link
Copy Markdown

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:

  • macOS: Menu bar → Hide sites in the menu bar panel. The panel leaves out the Sites section and its divider. Stored in UserDefaults (panel.hideSites) through @AppStorage, next to panel.expandedSites.
  • Windows: Panel → Hide sites in the panel. PreferenceData.HideSitesInPanel in tray.json; PanelViewModel follows Preferences.StateChanged, so the panel updates as soon as it's toggled.
  • Linux: Tray → Hide sites in the tray menu. hide_sites in app.json; AppModel holds it and notifies its listeners, so the tray menu drops its Sites submenu right away.

Settings → Sites still lists every site. docs/sites.md mentions the switch.

How I tested it

  • macOS: swift build and swift test --package-path macos pass. Tested by hand with a debug build: the switch hides and shows the Sites section right away.
  • Linux: new tests in prefs (an older app.json without the field loads with sites shown, and the field round-trips) and tray (the menu has the Sites submenu unless it's hidden).
  • Windows: new PreferencesTests.PanelShowsSitesUntilTheyAreHiddenAndRemembersIt (an older tray.json loads with sites shown, and the value persists without touching the other preferences), and PanelViewModelTests.SitesSectionShowsUntilThePreferenceHidesIt (the panel's Sites section is visible by default and collapsed when the preference is on).
  • The full CI run passes on my fork, including Linux fmt, clippy and tests, the Windows Tray and Screenshot builds, and package validation: CI check: hide sites option (do not merge) mansoorkhan96/flock#1. CI doesn't run Flock.Tray.Tests, and I don't have a Windows or Linux machine, so Windows and Linux are verified by CI only.

Checklist

  • I tested this change
  • I updated the docs in docs/, or no docs change is needed
  • This changes only the daemon or CLI, not the apps
  • This changes the apps, and I made and tested the change on every platform:
    • macOS
    • Windows
    • Linux

@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot closed this Nov 14, 2026
@onairmarc onairmarc reopened this Nov 14, 2026
@onairmarc

Copy link
Copy Markdown
Member

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.

@onairmarc onairmarc self-assigned this Nov 14, 2026
@onairmarc
onairmarc self-requested a review November 15, 2026 04:06
@onairmarc onairmarc removed their assignment Nov 15, 2026
…Linux tray menu

Settings → General gets the same switch on every platform, and the docs mention it. Refs flock-php#172
@mansoorkhan96 mansoorkhan96 changed the title feat(macos): add an option to hide the Sites section in the menu bar panel feat(app): add an option to hide the Sites section in the panel Nov 15, 2026
@mansoorkhan96

Copy link
Copy Markdown
Author

Added the UI changes for Windows and Linux. Tested only on macOS.

result.mp4

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread linux/src/panes/general.rs Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: option to hide the Sites section in the menu bar panel

3 participants