Skip to content

Hidden “More Features” page, adaptive theme sync, time-period rule, and related fixes#50

Merged
Programmer-MrWang merged 15 commits intomainfrom
codex/update-and-add-features-to-my-plugin
Apr 1, 2026
Merged

Hidden “More Features” page, adaptive theme sync, time-period rule, and related fixes#50
Programmer-MrWang merged 15 commits intomainfrom
codex/update-and-add-features-to-my-plugin

Conversation

@Programmer-MrWang
Copy link
Copy Markdown
Owner

Motivation

  • Expose extra plugin functionality behind a hidden settings page and provide an entry from the main settings without showing it in the sidebar.
  • Improve UX/safety for several features: make the local quote carousel accept a much larger interval, ensure temporary-class-plan actions can be reverted to the original state, and make timed shutdown stop when the host exits.
  • Provide an opt-in automatic theme sync that matches ClassIsland main-window background luminance to app theme.
  • Add a simple time-period rule for automation that supports cross-day ranges.

Description

  • LocalQuote component: increased UI NumericUpDown maximum to 8000 and added runtime clamping with Math.Clamp(Settings.CarouselIntervalSeconds, 1, 8000) in RefreshTimerInterval to enforce range 1..8000 seconds (Controls/Components/LocalQuoteSettingsControl.axaml, LocalQuoteComponent.axaml.cs).
  • LoadTemporaryClassPlanAction: snapshot the prior TempClassPlanId/TempClassPlanSetupTime when invoked (when revertible) and restore that snapshot in OnRevert (or clear if no snapshot) using a ConcurrentDictionary keyed by ActionSet.Guid (Actions/LoadTemporaryClassPlanAction.cs).
  • Hidden settings page: added MoreFeaturesOptionsSettingsPage (XAML + code-behind) and registered it with HideDefault=true, added a Button on the main plugin SystemTools settings to navigate to the hidden page using a classisland://app/settings/...?ci_keepHistory=true URI (SettingsPage/MoreFeaturesOptionsSettingsPage.*, SettingsPage/SystemToolsSettingsPage.axaml(.cs), registration in Plugin.cs).
  • Adaptive theme sync: added AdaptiveThemeSyncService that samples the ClassIsland main-window area every 2s, computes luminance from a few sample pixels and calls IThemeService.SetTheme(...) to switch between Light/Dark; added AutoMatchMainBackgroundTheme config flag in MainConfigData, registered the service as singleton and start/stop hooks in plugin lifecycle (Services/AdaptiveThemeSyncService.cs, ConfigHandlers/MainConfigData.cs, Plugin.cs).
  • Advanced shutdown: ensure planned shutdown is fully cancelled when stopping plugin or when stopping internal states by killing the internal countdown process and attempting shutdown /a as a fallback; added CancelPlanOnAppStopping call during plugin shutdown and call to TryAbortSystemShutdown() when stopping states (Actions/AdvancedShutdownAction.cs, Plugin.cs).
  • New rule: InTimePeriodRule with InTimePeriodRuleSettings and InTimePeriodRuleSettingsControl, supporting start/end input and cross-day intervals (e.g. 22:00 - 06:00); handler HandleInTimePeriodRule added and rule registered in Plugin.cs, and added to feature list in settings view model (Rules/InTimePeriodRuleSettings.cs, Controls/InTimePeriodRuleSettingsControl.cs, Plugin.cs, SettingsPage/SystemToolsSettingsViewModel.cs).

Testing

  • Attempted to run an automated build with dotnet build -v minimal in the execution environment but dotnet is not available (/bin/bash: dotnet: command not found), so no successful compilation was performed.
  • No other automated tests were executed in this environment. Please run a full local build (dotnet build) and smoke-test the plugin inside ClassIsland to verify behavior (start/stop lifecycle, navigation to the hidden settings page, toggle AutoMatchMainBackgroundTheme, trigger LoadTemporaryClassPlan with revertable automation, and test advanced shutdown cancellation).

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1029b5e1fc

ℹ️ 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".

private void StopAllStates()
{
StopCountdownProcess();
TryAbortSystemShutdown();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid aborting unrelated system shutdowns

StopAllStates now always calls shutdown /a, which cancels any pending Windows shutdown globally, not just one started by this action. That means stopping this action (or app shutdown via CancelPlanOnAppStopping) can unexpectedly cancel a shutdown scheduled by another tool/admin process, which is a functional regression outside this feature's scope.

Useful? React with 👍 / 👎.

Comment on lines +51 to +52
if (targetTheme == null || targetTheme == _lastAppliedTheme)
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reapply theme after re-enabling auto-sync

The early-return on targetTheme == _lastAppliedTheme assumes the app theme still matches the last auto-applied value. If users disable auto-sync, manually switch theme, then re-enable it, RefreshNow can skip SetTheme entirely because _lastAppliedTheme is stale, leaving the theme mismatched to the detected background until a later luminance change.

Useful? React with 👍 / 👎.

@Programmer-MrWang Programmer-MrWang merged commit b62bf7f into main Apr 1, 2026
1 check passed
@Programmer-MrWang Programmer-MrWang deleted the codex/update-and-add-features-to-my-plugin branch April 1, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant