Skip to content

feat: add UI scale setting (Normal / Small / Compact)#301

Open
arifszn wants to merge 4 commits intorobinebers:mainfrom
arifszn:feat/compact-mode
Open

feat: add UI scale setting (Normal / Small / Compact)#301
arifszn wants to merge 4 commits intorobinebers:mainfrom
arifszn:feat/compact-mode

Conversation

@arifszn
Copy link

@arifszn arifszn commented Mar 16, 2026

Summary

Adds a UI Scale setting with three options — Normal, Small, and Compact — that adjusts font size and spacing across the entire UI.

  • Setting lives in Settings → UI Scale as a radio button group (matching existing settings style)
  • Preference persists across restarts via Tauri's LazyStore
  • Scales all rem-based font sizes and spacing proportionally via a single CSS rule:
    • Normal — default (16px)
    • Small — 14px
    • Compact — 11px

Screenshots

Normal Small Compact
Normal Small Compact

Implementation

  • src/lib/settings.tsUIScale type, UI_SCALE_OPTIONS, loadUIScale / saveUIScale
  • src/stores/app-preferences-store.tsuiScale state + setUIScale
  • src/hooks/app/use-settings-compact.ts — applies small or compact class on <html>
  • src/hooks/app/use-settings-bootstrap.ts — loads setting on startup
  • src/hooks/app/use-settings-display-actions.tshandleUIScaleChange
  • src/index.csshtml.small { font-size: 14px }, html.compact { font-size: 11px }
  • src/pages/settings.tsx — UI Scale section with Normal / Small / Compact radio buttons

Test plan

  • Select Small — UI immediately scales down slightly
  • Select Compact — UI scales down more noticeably
  • Select Normal — UI returns to default
  • Restart app — preference persists

Adds a Compact Mode toggle to the Settings panel that reduces font size
and spacing across the entire UI for users who prefer a denser layout.

- Persist compact mode preference via Tauri LazyStore (settings.json)
- Apply/remove `compact` class on <html> via useSettingsCompact hook
- Scale all rem-based font sizes and spacing down with a single CSS rule
- Wire setting through store, bootstrap, display actions, and settings page
@github-actions github-actions bot added the core label Mar 16, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 9 files


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

@davidarny
Copy link
Collaborator

Thanks @arifszn , great idea!

For me it seems like half-compact mode, as the difference is not that large.

Maybe we can reduce spacing/font sizes even more, so that difference would be more obvious?

What do you think?

@arifszn
Copy link
Author

arifszn commented Mar 16, 2026

Thanks @arifszn , great idea!

For me it seems like half-compact mode, as the difference is not that large.

Maybe we can reduce spacing/font sizes even more, so that difference would be more obvious?

What do you think?

Thanks for the feedback, @davidarny! Totally agree, the current difference is subtle.

Two ideas to make it more flexible — either a slider for fine-grained control, or three fixed options: Normal, Small, and Compact. The slider is more flexible, but the three-option approach feels cleaner and more intentional for a settings UI.

What do you prefer? Happy to update the PR accordingly!

@davidarny
Copy link
Collaborator

@arifszn three options way makes more sense for me. Much less complexity in the code and will fit for most of users.

Slider though is good too, but IMHO a bit like overkill for an app 😅

Replaces the single compact mode checkbox with three UI scale options
(Normal, Small, Compact) using the same radio button pattern as other
settings. Font sizes: Small = 14px, Compact = 11px.
@arifszn arifszn changed the title feat: add compact mode setting feat: add UI scale setting (Normal / Small / Compact) Mar 16, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 9 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/lib/settings.ts">

<violation number="1" location="src/lib/settings.ts:316">
P2: Legacy persisted `compactMode` values are not migrated/read, causing existing users to lose their compact UI preference after upgrade.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@arifszn
Copy link
Author

arifszn commented Mar 17, 2026

@arifszn three options way makes more sense for me. Much less complexity in the code and will fit for most of users.

Slider though is good too, but IMHO a bit like overkill for an app 😅

@davidarny done.

@validatedev validatedev requested a review from Copilot March 17, 2026 22:04
@validatedev
Copy link
Collaborator

@codex review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a persisted UI Scale preference (Normal / Small / Compact) that globally scales the app UI by changing the root html font size and wiring the setting through the existing settings state/actions flow.

Changes:

  • Introduces UIScale setting model + persistence helpers (loadUIScale / saveUIScale) and adds uiScale to the app preferences store.
  • Loads UI scale on startup and applies it by toggling small/compact classes on the <html> element.
  • Adds a new “UI Scale” radio-button section in Settings and wires it to analytics + persistence.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/lib/settings.ts Adds UIScale type, options, defaults, and load/save functions backed by LazyStore.
src/stores/app-preferences-store.ts Stores uiScale in zustand and exposes setUIScale.
src/hooks/app/use-settings-bootstrap.ts Loads uiScale on startup and applies to preferences state.
src/hooks/app/use-settings-display-actions.ts Adds handleUIScaleChange to track + persist changes.
src/hooks/app/use-settings-compact.ts Applies the UI scale by toggling small/compact classes on <html>.
src/index.css Adds html.small / html.compact root font-size overrides.
src/pages/settings.tsx Adds Settings UI section for UI Scale selection.
src/components/app/app-content.tsx Plumbs uiScale and onUIScaleChange into SettingsPage.
src/App.tsx Wires bootstrap + actions + HTML class application for UI scale.
Comments suppressed due to low confidence (1)

src/hooks/app/use-settings-bootstrap.ts:56

  • useSettingsBootstrap now depends on DEFAULT_UI_SCALE, loadUIScale, and a required setUIScale argument, but the existing unit test src/hooks/app/use-settings-bootstrap.test.ts currently omits setUIScale in createArgs() and its @/lib/settings mock does not provide DEFAULT_UI_SCALE / loadUIScale. This will break the test suite. Update the test args + mocks and add coverage for loading/fallback behavior of the UI scale setting.
type UseSettingsBootstrapArgs = {
  setPluginSettings: (value: PluginSettings | null) => void
  setPluginsMeta: (value: PluginMeta[]) => void
  setAutoUpdateInterval: (value: AutoUpdateIntervalMinutes) => void
  setThemeMode: (value: ThemeMode) => void
  setDisplayMode: (value: DisplayMode) => void
  setResetTimerDisplayMode: (value: ResetTimerDisplayMode) => void
  setGlobalShortcut: (value: GlobalShortcut) => void
  setStartOnLogin: (value: boolean) => void
  setMenubarIconStyle: (value: MenubarIconStyle) => void
  setUIScale: (value: UIScale) => void
  setLoadingForPlugins: (ids: string[]) => void
  setErrorForPlugins: (ids: string[], error: string) => void
  startBatch: (pluginIds?: string[]) => Promise<string[] | undefined>
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +143 to +149
/* UI scale: reduce font size and spacing globally */
html.small {
font-size: 14px;
}
html.compact {
font-size: 11px;
}
@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🎉

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

Copy link
Collaborator

@davidarny davidarny left a comment

Choose a reason for hiding this comment

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

Hey @arifszn , please check copilot review comments. Overall looks good!

arifszn added 2 commits March 18, 2026 15:06
- Add isUIScale() type-guard to settings.ts (consistent with other guards)
- Rename useSettingsCompact → useSettingsUIScale for clarity
- Add saveUIScale mock and handleUIScaleChange test to display-actions tests
@arifszn arifszn requested a review from davidarny March 18, 2026 09:12
@arifszn
Copy link
Author

arifszn commented Mar 20, 2026

Hey @arifszn , please check copilot review comments. Overall looks good!

@davidarny done.

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.

4 participants