Task #61: Add quick hide-clock toggle to home top bar

Added a dedicated Eye/EyeOff icon button next to the existing
ClockStylePicker in the home top bar. Clicking it instantly hides or
shows the home wall-clock widget without opening any popover.

- Wired to the existing useHomeClockVisibility hook so it stays in
  sync with the toggle inside the clock-style popover (same storage
  key + custom event).
- Reuses existing locale keys home.clockStyle.hideWidget /
  home.clockStyle.showWidget for aria-label and title (flips with
  state).
- aria-pressed reflects hidden state for accessibility.
- No new locale keys, no changes to default position behavior, and
  the popover toggle is left intact as requested.

Files:
- artifacts/teaboy-os/src/pages/home.tsx (added Eye/EyeOff imports
  and the new icon button between ClockStylePicker and the language
  toggle).
This commit is contained in:
Riyadh
2026-04-21 17:57:12 +00:00
parent c49f67f8cb
commit 1d1f45653e
+12
View File
@@ -21,6 +21,8 @@ import {
Bell,
LogOut,
Globe,
Eye,
EyeOff,
Grid2X2,
Coffee,
MessageSquare,
@@ -457,6 +459,16 @@ export default function HomePage() {
currentStyle={user?.clockStyle ?? null}
currentHour12={user?.clockHour12 ?? null}
/>
<button
type="button"
onClick={() => setHomeClockVisible(!homeClockVisible)}
aria-label={t(homeClockVisible ? "home.clockStyle.hideWidget" : "home.clockStyle.showWidget")}
title={t(homeClockVisible ? "home.clockStyle.hideWidget" : "home.clockStyle.showWidget")}
aria-pressed={!homeClockVisible}
className="text-muted-foreground hover:text-foreground transition-colors p-1.5 rounded-lg hover:bg-foreground/5"
>
{homeClockVisible ? <Eye size={18} /> : <EyeOff size={18} />}
</button>
<button
onClick={toggleLanguage}
aria-label="Toggle language"