Repository navigation
[review only] proactive: src #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,24 @@ | ||
| @import "tailwindcss"; | ||
| @import "@kleinbem/web-config/theme"; | ||
| @import "@kleinbem/web-config/base.css"; | ||
| @import "@kleinbem/web-config/badges.css"; | ||
|
|
||
| /* App-level names for web-config's tokens; without these the *-brand, bg-bg-surface and | ||
| text-text-primary utilities generate no CSS. */ | ||
| @theme inline { | ||
| --color-bg-surface: var(--color-bg); | ||
| --color-bg-elevated: var(--color-surface); | ||
| --color-text-primary: var(--color-heading); | ||
| --color-border-subtle: var(--color-line); | ||
| --color-brand: var(--color-accent); | ||
| } | ||
|
|
||
| @custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *, .dark, .dark *)); | ||
| @source "../node_modules/@kleinbem/web-config"; | ||
|
|
||
| /* Glassmorphism utility for modern card and navbar styling */ | ||
| .glass-panel { | ||
| background: color-mix(in srgb, var(--color-bg-elevated, #18181b) 75%, transparent); | ||
| background: color-mix(in srgb, var(--color-surface, #151a21) 80%, transparent); | ||
| backdrop-filter: blur(12px); | ||
| -webkit-backdrop-filter: blur(12px); | ||
| border: 1px solid var(--color-border-subtle, rgba(255, 255, 255, 0.08)); | ||
| border: 1px solid var(--color-line, rgba(255, 255, 255, 0.08)); | ||
| } | ||
|
|
||
| dialog:modal { | ||
| overscroll-behavior: contain; | ||
| } | ||
|
|
||
| .light .glass-panel, [data-theme="light"] .glass-panel { | ||
| background: color-mix(in srgb, #ffffff 80%, transparent); | ||
| border: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.06)); | ||
| dialog::backdrop { | ||
| background: rgb(9 9 11 / 0.6); | ||
| backdrop-filter: blur(4px); | ||
| -webkit-backdrop-filter: blur(4px); | ||
| overflow: hidden; | ||
| overscroll-behavior: contain; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🏠</text></svg>" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <meta name="color-scheme" content="dark light" /> | ||
| <title>Foyer</title> | ||
| <!-- web-config:init (written by `web-config sync`, do not edit) --> | ||
| <script>try{const p=localStorage.getItem("fleet-theme");const m=window.matchMedia('(prefers-color-scheme: dark)').matches;const t=p==='dark'||p==='light'?p:(m?'dark':'light');document.documentElement.dataset.theme=t;document.documentElement.classList.toggle('dark',t==='dark');document.documentElement.classList.toggle('light',t==='light');}catch(e){}try{const s=localStorage.getItem("fleet-font-size");if(s==='large'||s==='larger'){document.documentElement.dataset.fontSize=s;document.documentElement.classList.add('font-size-'+s);}}catch(e){}</script> | ||
| <!-- /web-config:init --> | ||
| %sveltekit.head% | ||
| </head> | ||
| <body class="min-h-screen bg-bg text-fg antialiased transition-colors selection:bg-accent/20" data-sveltekit-preload-data="hover"> | ||
| <div style="display: contents">%sveltekit.body%</div> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <script lang="ts"> | ||
| import { formatRelativeTime } from '../portal'; | ||
| import type { AttentionItem, AttentionSeverity } from '../types'; | ||
|
|
||
| const COLLAPSED_COUNT = 5; | ||
|
|
||
| let { items }: { items: AttentionItem[] } = $props(); | ||
|
|
||
| let expanded = $state(false); | ||
| let visible = $derived(expanded ? items : items.slice(0, COLLAPSED_COUNT)); | ||
| let worst = $derived<AttentionSeverity>( | ||
| items.some((i) => i.severity === 'critical') ? 'critical' | ||
| : items.some((i) => i.severity === 'warning') ? 'warning' | ||
| : 'info' | ||
| ); | ||
|
|
||
| const SEVERITY = { | ||
| critical: { icon: '🔴', label: 'Critical', border: 'border-status-danger-border', text: 'text-status-danger' }, | ||
| warning: { icon: '🟠', label: 'Warning', border: 'border-status-warning-border', text: 'text-status-warning' }, | ||
| info: { icon: '🔵', label: 'Info', border: 'border-line', text: 'text-heading' } | ||
| } as const; | ||
| </script> | ||
|
|
||
| {#if items.length > 0} | ||
| <section aria-label="Needs attention" class="p-3.5 rounded-2xl glass-panel shadow-2xs border {SEVERITY[worst].border}"> | ||
| <div class="flex items-center gap-2 mb-2 px-1"> | ||
| <h2 class="text-xs font-semibold {SEVERITY[worst].text}">Needs attention</h2> | ||
| <span class="text-[10px] font-mono px-1.5 py-0.5 rounded bg-surface-high text-muted">{items.length}</span> | ||
| </div> | ||
|
|
||
| <ul class="space-y-1"> | ||
| {#each visible as item (item.id)} | ||
| {@const sev = SEVERITY[item.severity]} | ||
| {@const when = formatRelativeTime(item.updatedAt)} | ||
| <li class="flex items-start gap-2.5 px-2 py-1.5 rounded-xl hover:bg-surface-high/60 transition-colors"> | ||
| <span class="text-[10px] leading-5 select-none shrink-0" role="img" aria-label={sev.label}>{sev.icon}</span> | ||
| <div class="min-w-0 flex-1"> | ||
| {#if item.url} | ||
| <a | ||
| href={item.url} | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| class="text-xs font-medium text-heading hover:text-accent hover:underline break-words" | ||
| > | ||
| {item.title} | ||
| </a> | ||
| {:else} | ||
| <span class="text-xs font-medium text-heading break-words">{item.title}</span> | ||
| {/if} | ||
| {#if item.detail} | ||
| <p class="text-[11px] text-muted font-mono line-clamp-2" title={item.detail}>{item.detail}</p> | ||
| {/if} | ||
| </div> | ||
| <div class="flex items-center gap-2 shrink-0 text-[10px] font-mono text-muted leading-5"> | ||
| {#if item.source} | ||
| <span class="px-1.5 rounded bg-surface-high">{item.source}</span> | ||
| {/if} | ||
| {#if when} | ||
| <time datetime={item.updatedAt}>{when}</time> | ||
| {/if} | ||
| </div> | ||
| </li> | ||
| {/each} | ||
| </ul> | ||
|
|
||
| {#if items.length > COLLAPSED_COUNT} | ||
| <button | ||
| type="button" | ||
| aria-expanded={expanded} | ||
| onclick={() => (expanded = !expanded)} | ||
| class="mt-1.5 ml-2 text-[11px] font-mono text-accent hover:underline cursor-pointer" | ||
| > | ||
| {expanded ? 'Show fewer' : `Show ${items.length - COLLAPSED_COUNT} more`} | ||
| </button> | ||
| {/if} | ||
| </section> | ||
| {/if} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| <script lang="ts"> | ||
| import ThemeToggle from '@kleinbem/web-config/theme/toggle'; | ||
| import type { WeatherConfig } from '../types'; | ||
| import WeatherWidget from './WeatherWidget.svelte'; | ||
|
|
||
| let { | ||
| title = 'Foyer', | ||
| badge, | ||
| subtitle, | ||
| weather, | ||
| onOpenSearch | ||
| }: { | ||
| title?: string; | ||
| badge?: string; | ||
| subtitle?: string; | ||
| weather?: WeatherConfig; | ||
| onOpenSearch: () => void; | ||
| } = $props(); | ||
|
|
||
| let now = $state(new Date()); | ||
|
|
||
| // Refresh at minute boundaries instead of waking every second for an HH:MM display. | ||
| $effect(() => { | ||
| let timer: ReturnType<typeof setTimeout>; | ||
| function scheduleNextMinute() { | ||
| const current = new Date(); | ||
| now = current; | ||
| const delayMs = (60 - current.getSeconds()) * 1000 - current.getMilliseconds() + 50; | ||
| timer = setTimeout(scheduleNextMinute, delayMs); | ||
| } | ||
| scheduleNextMinute(); | ||
| return () => clearTimeout(timer); | ||
| }); | ||
|
|
||
| let timeStr = $derived(now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })); | ||
| let dateStr = $derived( | ||
| now.toLocaleDateString([], { weekday: 'short', month: 'short', day: 'numeric' }) | ||
| ); | ||
| </script> | ||
|
|
||
| <svelte:document | ||
| onvisibilitychange={() => { | ||
| if (!document.hidden) now = new Date(); | ||
| }} | ||
| /> | ||
|
|
||
| <header class="sticky top-0 z-40 w-full border-b border-line glass-panel"> | ||
| <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between gap-4"> | ||
| <div class="flex items-center gap-3 min-w-0"> | ||
| <span class="text-2xl select-none" aria-hidden="true">🏠</span> | ||
| <div class="min-w-0"> | ||
| <div class="flex items-center gap-2"> | ||
| <h1 class="font-bold text-base tracking-tight text-heading truncate"> | ||
| {title} | ||
| </h1> | ||
| {#if badge} | ||
| <span class="text-[10px] uppercase tracking-wider px-1.5 py-0.5 font-mono font-medium rounded bg-surface-high text-muted border border-line"> | ||
| {badge} | ||
| </span> | ||
| {/if} | ||
| </div> | ||
| {#if subtitle} | ||
| <p class="text-[11px] text-muted font-mono hidden sm:block truncate"> | ||
| {subtitle} | ||
| </p> | ||
| {/if} | ||
| </div> | ||
| </div> | ||
|
|
||
| <button | ||
| type="button" | ||
| onclick={onOpenSearch} | ||
| class="flex items-center gap-2.5 px-3 py-1.5 rounded-xl border border-line bg-surface/80 hover:bg-surface-high text-muted hover:text-heading text-xs shadow-2xs transition-colors cursor-pointer max-w-xs w-full sm:w-64" | ||
| > | ||
| <svg aria-hidden="true" class="w-3.5 h-3.5 shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor"> | ||
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /> | ||
| </svg> | ||
| <span class="flex-1 text-left truncate">Search services...</span> | ||
| <kbd class="hidden sm:inline-block px-1.5 py-0.5 text-[10px] font-mono rounded bg-bg text-muted border border-line"> | ||
| ⌘K | ||
| </kbd> | ||
| </button> | ||
|
|
||
| <div class="flex items-center gap-3 shrink-0"> | ||
| <div class="hidden md:flex flex-col text-right font-mono leading-none"> | ||
| <span class="text-xs font-semibold text-heading">{timeStr}</span> | ||
| <span class="text-[10px] text-muted mt-0.5">{dateStr}</span> | ||
| </div> | ||
|
|
||
| {#if weather} | ||
| <div class="hidden sm:block"> | ||
| <WeatherWidget config={weather} /> | ||
| </div> | ||
| {/if} | ||
|
|
||
| <div class="pl-1 border-l border-line"> | ||
| <ThemeToggle /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </header> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlayered .glass-panel overrides Tailwind v4 border utilities:
.glass-panelis declared outside any CSS@layer, so itsbordershorthand overrides Tailwind v4@layer utilitiesclasses regardless of specificity. This breaks severity border colors inAttentionPanel.svelte:25(border-status-danger-border,border-status-warning-border) and adds unintended top/left/right borders toHeader.svelte:47(border-b). Wrap.glass-panelin@layer components.