Skip to content

Optional clock in the compact island - #162

Open
4rchila wants to merge 1 commit into
Louis-CFM:mainfrom
4rchila:pr/compact-clock
Open

4rchila wants to merge 1 commit into
Louis-CFM:mainfrom
4rchila:pr/compact-clock

Conversation

@4rchila

@4rchila 4rchila commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

What

An optional clock in the compact island: Settings → General → Clock (off by default). When it is on, the compact island shows the time and date, centred between Mochi and the mini bots, and stays compact instead of hiding after a minute.

Why

On Linux and Windows the island sits on the top edge of the screen. With a top panel that auto-hides (a common KDE Plasma setup), the island covers the spot where the panel's clock usually is. With this option the island itself shows the time, so the panel clock can go.

How

  • settings.rs / state.ts: showClock, defaulting to false (serde default, older settings files still load).
  • island.ts: a #clock element, refreshed on the minute boundary and then every minute, only while it is visible; the timer is cleared otherwise, so a hidden island still costs nothing. Time and date use the system locale (toLocaleTimeString / toLocaleDateString).
  • fsm.ts: setKeepPetit() keeps the island compact instead of scheduling the compact → hidden step while the clock is on.
  • Compact island size is unchanged (288 × 32).

Testing

  • Fedora 44 / KDE Plasma: toggled the option on and off; the clock appears centred and vertically aligned, the island stays compact, and goes back to hiding when the option is off.
  • tsc --noEmit, vite build and cargo check --release pass with no new warnings.

Screenshot

Compact island with the clock on, built from this branch (stock 288 × 32 size), KDE Plasma:

Settings -> General -> Clock (off by default) shows the time and date,
centred, in the compact island and keeps the island compact instead of
hiding after a minute. Meant for setups whose top panel, and its clock,
auto-hides under the island. The clock only ticks while it is visible
(re-armed on the minute boundary), so a hidden island costs nothing.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant