mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 03:47:53 +01:00
ux(shell): icon-only NotificationsPill; remove dark mode from sidebar
Two small UX fixes from a real user observation during dogfood today: 1. NotificationsPill — was "[bell icon] Notifications off" in a pill. Visually read as two elements (icon + text) for one button; users asked if there were two notification controls. Collapsed to a single bell-on/bell-off icon button matching the topbar's other icon-only buttons (mobile search, Sessions drawer). The hover-title carries the state explanation for users who need it. 2. SidebarFooter — dropped the full-width dark/light mode toggle. Theme is a set-once-and-forget preference; full-width sidebar slot was disproportionate. Settings → Appearance has the same toggle (AppearanceSettings.tsx) which is the right home for it. Sidebar slots now: collapse, Settings, Lock private zone (conditional), Sign out — all frequent navigation/presence actions. The third issue raised (prompt library showing prompts despite an empty Hetzner DB) is by design — src/config/prompt-library.ts ships ~30 FleetCrown defaults baked into the build, independent of DB state. User-defined / project-specific / personal prompts are a real feature gap noted for a future sprint (needs a user_prompts table + UI to manage; meaningful scope, separate change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a2db503c42
commit
ecc98bf53d
2 files changed
+17
-33
No files matched your search
@@ -23,14 +23,19 @@ export function NotificationsPill() {
|
||||
else void push.subscribe();
|
||||
};
|
||||
|
||||
// Icon-only — the bell on/off state communicates the same thing the text
|
||||
// label used to ("Notifications on" / "Notifications off"). Hover-tooltip
|
||||
// (title) carries the longer state explanation for users who need it. The
|
||||
// text-label version visually read as two elements (icon + word) for one
|
||||
// button; users called it out as confusing duplication.
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={onClick}
|
||||
disabled={isWorking}
|
||||
className={cn(
|
||||
"ui-topbar-pill",
|
||||
isSubscribed && "ui-topbar-pill-active",
|
||||
"inline-flex h-9 w-9 items-center justify-center rounded-full text-text-tertiary transition-colors hover:bg-surface-raised hover:text-text-secondary",
|
||||
isSubscribed && "text-accent-text",
|
||||
)}
|
||||
title={
|
||||
push.publicKeyMissing
|
||||
@@ -43,12 +48,9 @@ export function NotificationsPill() {
|
||||
}
|
||||
aria-label={isSubscribed ? "Disable push notifications" : "Enable push notifications"}
|
||||
>
|
||||
{isWorking ? <Loader2 className="h-3.5 w-3.5 animate-spin" />
|
||||
: isSubscribed ? <Bell className="h-3.5 w-3.5" />
|
||||
: <BellOff className="h-3.5 w-3.5" />}
|
||||
<span className="ui-topbar-pill-label">
|
||||
{isSubscribed ? "Notifications on" : "Notifications off"}
|
||||
</span>
|
||||
{isWorking ? <Loader2 className="h-4 w-4 animate-spin" />
|
||||
: isSubscribed ? <Bell className="h-4 w-4" />
|
||||
: <BellOff className="h-4 w-4" />}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
@@ -1,15 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import Link from "next/link";
|
||||
import { PanelLeftOpen, PanelLeftClose, LogOut, Lock, Sun, Moon, Settings as SettingsIcon } from "lucide-react";
|
||||
import { PanelLeftOpen, PanelLeftClose, LogOut, Lock, Settings as SettingsIcon } from "lucide-react";
|
||||
import { signOut } from "next-auth/react";
|
||||
import { useTheme } from "next-themes";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { usePrivateZone } from "@/hooks/use-private-zone";
|
||||
import { ROUTES } from "@/config/auth";
|
||||
import { NAV } from "@/config/navigation";
|
||||
|
||||
// The dark-mode toggle used to live here. Moved its sole home to
|
||||
// Settings → Appearance (AppearanceSettings.tsx) — theme is set-once-and-
|
||||
// forget, not worth a full-width sidebar slot. The sidebar should hold
|
||||
// frequent navigation + presence affordances (private-zone lock, sign-out),
|
||||
// not preference toggles.
|
||||
|
||||
export function SidebarFooter({
|
||||
collapsed,
|
||||
onToggleCollapsed,
|
||||
@@ -18,12 +22,6 @@ export function SidebarFooter({
|
||||
onToggleCollapsed: () => void;
|
||||
}) {
|
||||
const { unlocked, lock, configured } = usePrivateZone();
|
||||
const { resolvedTheme, setTheme } = useTheme();
|
||||
const [mounted, setMounted] = useState(false);
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect -- standard next-themes SSR hydration guard
|
||||
useEffect(() => setMounted(true), []);
|
||||
|
||||
const isDark = resolvedTheme !== "light";
|
||||
|
||||
return (
|
||||
<div className="ui-sidebar-section space-y-1 border-t border-border-subtle">
|
||||
@@ -65,22 +63,6 @@ export function SidebarFooter({
|
||||
{collapsed && <span className="ui-sidebar-tooltip">Lock private zone</span>}
|
||||
</button>
|
||||
)}
|
||||
{mounted && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setTheme(isDark ? "light" : "dark")}
|
||||
className={cn(
|
||||
"ui-sidebar-utility group relative w-full",
|
||||
collapsed && "justify-center px-2",
|
||||
)}
|
||||
>
|
||||
{isDark
|
||||
? <Sun className="h-4 w-4 shrink-0" />
|
||||
: <Moon className="h-4 w-4 shrink-0" />}
|
||||
{!collapsed && (isDark ? "Light mode" : "Dark mode")}
|
||||
{collapsed && <span className="ui-sidebar-tooltip">{isDark ? "Light mode" : "Dark mode"}</span>}
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
onClick={() => signOut({ callbackUrl: ROUTES.SIGN_IN })}
|
||||
className={cn(
|
||||
|
||||
Reference in new issue
Block a user