feat: add tray floating-window toggle and local quote playback order#72
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0f0a0b82a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var trayService = IAppHost.TryGetService<ITaskBarIconService>(); | ||
| if (trayService == null) | ||
| { | ||
| return; |
There was a problem hiding this comment.
Retry tray menu registration when service is temporarily null
RegisterOrUpdateFloatingWindowTrayMenu exits immediately when IAppHost.TryGetService<ITaskBarIconService>() returns null, but this method is only invoked at startup and on floating-window config changes. In startup orders where the tray service is not ready yet, the menu item is never added for the entire session unless the user later toggles ShowFloatingWindow/EnableFloatingWindowFeature, so the new tray toggle silently disappears for affected users.
Useful? React with 👍 / 👎.
Motivation
显示/隐藏悬浮窗from the system tray and keep that control synchronized with the main settings page.DutyIsland(manipulatingITaskBarIconService.MoreOptionsMenuItems) to register/unregister tray items only when the floating-window feature is enabled.Description
Plugin.cs: implementRegisterOrUpdateFloatingWindowTrayMenu,UnregisterFloatingWindowTrayMenu,OnMainConfigDataPropertyChanged, andUpdateFloatingWindowTrayMenuHeader, and call registration on startup and unregistration on stop; the tray item togglesMainConfigData.ShowFloatingWindow, callsFloatingWindowService.UpdateWindowState(), and persists the config.LocalQuotePlaybackOrderenum andPlaybackOrderobservable property inModels/ComponentSettings/LocalQuoteSettings.cswith defaultSequential.轮播顺序settings expander (iconE143) and a ComboBox bound to the new enum inControls/Components/LocalQuoteSettingsControl.axamland exposePlaybackOrdersin the control code-behind.LocalQuoteComponentruntime logic to support random playback by adding aRandominstance, responding toPlaybackOrderchanges, and choosing a random index whenPlaybackOrder == LocalQuotePlaybackOrder.Randomwhile preserving existing sequential behavior and persistence semantics.Testing
dotnet build -v minimal, but the execution environment does not havedotnetinstalled so the build could not be performed (failed).git commitsucceeded).Codex Task