Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
chore: replace bird sprites with ink empty states
johnnyjoygh05a2c6db7a3e
diff --git a/web/src/components/PagedMemoList/PagedMemoList.tsx b/web/src/components/PagedMemoList/PagedMemoList.tsxindex 79e6543c7..4c6596d22 100644--- a/web/src/components/PagedMemoList/PagedMemoList.tsx+++ b/web/src/components/PagedMemoList/PagedMemoList.tsx@@ -230,9 +230,10 @@ const PagedMemoList = (props: Props) => {[props.showCreator, displayMemoList],);+ const hasFilters = filters.length > 0 || memoView !== undefined;const emptyPlaceholder =!isDisplayPending && !isError && !isFetchingNextPage && !hasNextPage && displayMemoList.length === 0 ? (- <Placeholder variant="empty" message={props.emptyMessage ?? t("message.no-data")} className="w-full" />+ <Placeholder scene={hasFilters ? "search" : "memo"} message={props.emptyMessage ?? t("message.no-data")} className="w-full" />) : null;const initialLoader = isDisplayPending && showLoader ? <Loader /> : null;// Only a query the user typed can be edited or cleared from the error; facet and scope@@ -254,7 +255,6 @@ const PagedMemoList = (props: Props) => {// empty state follows them. The newest memo also lands directly beneath them (priorityKey// above). Every vertical seam inside the stack uses GRID_GAP so y-spacing matches the// grid's x-spacing exactly.- const hasFilters = filters.length > 0 || memoView !== undefined;const gridLeading =leadingContent || hasFilters || initialLoader || emptyPlaceholder || initialError ? (<div className="flex w-full flex-col" style={{ gap: GRID_GAP }}>diff --git a/web/src/components/Placeholder/InkIllustration.tsx b/web/src/components/Placeholder/InkIllustration.tsxnew file mode 100644index 000000000..da89ec2de--- /dev/null+++ b/web/src/components/Placeholder/InkIllustration.tsx@@ -0,0 +1,109 @@+type InkScene = "memo" | "search" | "inbox";++interface InkIllustrationProps {+ scene: InkScene;+}++// A quiet line connects the three empty states; only the object at its center changes.+const InkIllustration = ({ scene }: InkIllustrationProps) => (+ <svg+ viewBox="0 0 560 280"+ className="h-auto w-full"+ aria-hidden="true"+ focusable="false"+ data-testid="placeholder-illustration"+ data-scene={scene}+ >+ <path+ d="M54 218 C101 207 119 220 166 230 C212 242 271 229 332 231 C407 233 446 207 510 216"+ fill="none"+ stroke="#ded8ca"+ strokeWidth="1.5"+ />+ <path+ d="M109 80 C133 54 182 55 205 80 C218 94 214 124 201 143 C178 173 131 165 111 141 C90 117 88 94 109 80Z"+ fill="#d9b7aa"+ opacity=".55"+ />+ <path+ d="M341 45 C365 32 406 49 417 73 C434 106 404 125 384 149 C364 172 335 157 322 129 C306 94 313 59 341 45Z"+ fill="#b9c7aa"+ opacity=".73"+ />+ <path+ d="M68 189 C95 160 136 170 157 196 C180 226 196 237 222 225"+ fill="none"+ stroke="#738c9c"+ strokeWidth="23"+ opacity=".27"+ strokeLinecap="round"+ />+ <path d="M432 168 C451 150 470 149 494 160" fill="none" stroke="#d7ad6f" strokeWidth="25" opacity=".42" strokeLinecap="round" />+ <path+ d="M83 121 C127 101 157 121 175 157 C193 195 222 214 260 194 C299 174 267 115 297 94 C327 71 377 97 368 136 C358 178 410 196 473 150"+ fill="none"+ stroke="#2e3435"+ strokeWidth="2.8"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ <path d="M132 47 L136 66 M121 57 L148 55 M442 68 L447 88 M433 79 L456 77" stroke="#a77955" strokeWidth="2" strokeLinecap="round" />+ <circle cx="92" cy="88" r="3" fill="#2e3435" />+ <circle cx="458" cy="119" r="4" fill="#bb785c" />+ <path d="M467 104 Q479 90 493 95 Q481 108 467 104Z" fill="#b7c5a6" stroke="#2e3435" strokeWidth="1.5" />++ {scene === "memo" && (+ <>+ <path+ d="M215 57 Q264 50 307 62 L311 181 Q261 171 211 183Z"+ fill="#f7f0df"+ stroke="#2e3435"+ strokeWidth="2.4"+ strokeLinejoin="round"+ />+ <path d="M260 59 Q257 121 260 174" fill="none" stroke="#a29a8c" strokeWidth="1.5" />+ <path d="M234 90 Q246 85 252 95 M272 97 Q280 91 288 96" fill="none" stroke="#c59b82" strokeWidth="2.4" strokeLinecap="round" />+ <path d="M241 148 C250 135 268 132 279 140" fill="none" stroke="#bf7759" strokeWidth="4" strokeLinecap="round" />+ <circle cx="277" cy="139" r="4" fill="#bf7759" />+ </>+ )}+ {scene === "search" && (+ <>+ <path+ d="M227 64 C255 53 293 62 310 91 C329 126 305 171 270 177 C236 183 204 154 205 121 C206 94 213 77 227 64Z"+ fill="#f7f0df"+ stroke="#2e3435"+ strokeWidth="2.5"+ />+ <path+ d="M229 105 C244 91 260 91 276 106 C288 117 290 134 280 144"+ fill="none"+ stroke="#bd7e5e"+ strokeWidth="2"+ strokeLinecap="round"+ />+ <path d="M282 150 Q292 162 309 158" fill="none" stroke="#bd7e5e" strokeWidth="2" strokeLinecap="round" />+ <circle cx="270" cy="130" r="4" fill="#2e3435" />+ <path d="M307 162 Q326 179 343 191" fill="none" stroke="#2e3435" strokeWidth="5" strokeLinecap="round" />+ </>+ )}+ {scene === "inbox" && (+ <>+ <path+ d="M218 94 Q264 53 310 94 L312 177 Q266 195 217 176Z"+ fill="#f7f0df"+ stroke="#2e3435"+ strokeWidth="2.4"+ strokeLinejoin="round"+ />+ <path d="M218 94 Q257 136 312 94 M218 176 Q254 140 264 145 Q276 142 312 177" fill="none" stroke="#2e3435" strokeWidth="2" />+ <path d="M247 105 Q255 89 264 96 Q274 87 282 105" fill="none" stroke="#bd7e5e" strokeWidth="2.5" />+ <circle cx="264" cy="146" r="7" fill="#bc8a74" />+ </>+ )}+ <path d="M154 213 Q164 198 177 206 M389 217 Q402 204 416 210" fill="none" stroke="#708777" strokeWidth="2" strokeLinecap="round" />+ </svg>+);++export default InkIllustration;+export type { InkScene };diff --git a/web/src/components/Placeholder/TileSpriteStrip.tsx b/web/src/components/Placeholder/TileSpriteStrip.tsxdeleted file mode 100644index 4d8e4238f..000000000--- a/web/src/components/Placeholder/TileSpriteStrip.tsx+++ /dev/null@@ -1,67 +0,0 @@-import { cn } from "@/lib/utils";-import type { TileSprite } from "./tileSprites";--interface TileSpriteStripProps {- sprite: TileSprite;- scale?: number;- className?: string;- testId?: string;-}--const DEFAULT_SCALE = 2;--const getAnimationName = (sprite: TileSprite, scale: number) => `tile-sprite-${sprite.name}-${scale}x`;--const TileSpriteStrip = ({ sprite, scale = DEFAULT_SCALE, className, testId }: TileSpriteStripProps) => {- const stripWidth = sprite.frameWidth * sprite.frames;- const displayStripWidth = stripWidth * scale;- const displayStripHeight = sprite.frameHeight * scale;- const displayFrameWidth = sprite.frameWidth * scale;- const animationName = getAnimationName(sprite, scale);-- return (- <>- <style>{`- @keyframes ${animationName} {- from { transform: translateX(0); }- to { transform: translateX(-${displayStripWidth}px); }- }-- @media (prefers-reduced-motion: reduce) {- [data-tile-sprite-strip="${animationName}"] {- animation: none !important;- transform: translateX(0) !important;- }- }- `}</style>- <div- aria-hidden="true"- data-testid={testId}- className={cn("relative shrink-0 overflow-hidden", className)}- style={{ width: displayFrameWidth, height: displayStripHeight, overflow: "hidden" }}- >- <img- data-tile-sprite-strip={animationName}- src={sprite.src}- alt=""- width={stripWidth}- height={sprite.frameHeight}- draggable={false}- style={{- display: "block",- width: displayStripWidth,- height: displayStripHeight,- maxWidth: "none",- imageRendering: "pixelated",- animationName,- animationDuration: `${sprite.duration}ms`,- animationTimingFunction: `steps(${sprite.frames})`,- animationIterationCount: "infinite",- }}- />- </div>- </>- );-};--export default TileSpriteStrip;diff --git a/web/src/components/Placeholder/index.tsx b/web/src/components/Placeholder/index.tsxindex a53623596..2eb63acff 100644--- a/web/src/components/Placeholder/index.tsx+++ b/web/src/components/Placeholder/index.tsx@@ -1,34 +1,19 @@-import { type ReactNode, useState } from "react";import { cn } from "@/lib/utils";-import { DEFAULT_MESSAGES, type PlaceholderVariant } from "./messages";-import TileSpriteStrip from "./TileSpriteStrip";-import { pickTileSprite } from "./tileSprites";+import InkIllustration, { type InkScene } from "./InkIllustration";interface PlaceholderProps {- variant: PlaceholderVariant;- message?: string;- children?: ReactNode;+ scene: InkScene;+ message: string;className?: string;}-const DISPLAY_SCALE = 2;--const Placeholder = ({ variant, message, children, className }: PlaceholderProps) => {- const [sprite] = useState(pickTileSprite);- const resolvedMessage = message ?? DEFAULT_MESSAGES[variant];- const isLoading = variant === "loading";-- return (- <div- role={isLoading ? "status" : undefined}- aria-live={isLoading ? "polite" : undefined}- className={cn("flex flex-col items-center justify-center max-w-md mx-auto px-4 py-8", className)}- >- <TileSpriteStrip sprite={sprite} scale={DISPLAY_SCALE} className="relative shrink-0" testId="placeholder-sprite" />- <p className="mt-3 font-mono text-sm text-muted-foreground">{resolvedMessage}</p>- {children && <div className="mt-4">{children}</div>}+const Placeholder = ({ scene, message, className }: PlaceholderProps) => (+ <div className={cn("mx-auto flex max-w-md flex-col items-center justify-center px-4 py-8 text-center", className)}>+ <div className="w-full max-w-80 shrink-0">+ <InkIllustration scene={scene} /></div>- );-};+ <p className="mt-1 text-sm text-muted-foreground">{message}</p>+ </div>+);export default Placeholder;diff --git a/web/src/components/Placeholder/messages.ts b/web/src/components/Placeholder/messages.tsdeleted file mode 100644index 46ccb6f10..000000000--- a/web/src/components/Placeholder/messages.ts+++ /dev/null@@ -1,10 +0,0 @@-// Future i18n: swap these for `t("placeholder.<variant>")` lookups via-// react-i18next without touching the component.-export const DEFAULT_MESSAGES = {- empty: "No memos yet",- loading: "Loading…",- noResults: "Nothing matches that search",- notFound: "This page flew the coop",-} as const;--export type PlaceholderVariant = keyof typeof DEFAULT_MESSAGES;diff --git a/web/src/components/Placeholder/pieces/DESIGN.md b/web/src/components/Placeholder/pieces/DESIGN.mddeleted file mode 100644index 31f02fd6a..000000000--- a/web/src/components/Placeholder/pieces/DESIGN.md+++ /dev/null@@ -1,49 +0,0 @@-# Placeholder Bird Tilemaps--These SVGs are pixel-art tile strips for the placeholder component. They should read as small game sprites first, not as decorative illustrations.--## Canvas--- Each frame is 32 by 32 pixels.-- A strip width is `32 * frameCount`; the height stays 32.-- The bird should occupy most of the frame. Use the full height when the animal shape supports it.-- Keep a transparent background.-- Use `shape-rendering="crispEdges"` and integer pixel coordinates.--## Naming--- Start with the animal name, for example `Owl` or `Eagle`.-- Add the animation name when needed, for example `OwlBlink` or `EagleIdle`.-- Do not name assets after UI states or empty-state scenarios.--## Frame Count--Frame count is not fixed. Choose it from the animal and animation:--- short blink: usually 3-5 frames-- quiet idle: usually 4-6 frames-- hop or walk: usually 4-8 frames-- flying, diving, or large body motion: usually 6-10 frames--Avoid padding an animation with duplicate frames just to hit a standard count. A frame should change the pose, expression, feather shape, or weight.--## Shared Style--- Use a strong readable silhouette at 1x.-- Prefer chunky pixel clusters over isolated noisy pixels.-- Use a limited palette with one dark outline, one or two body colors, one highlight color, and one accent.-- Keep eyes readable. At this scale, a 2 by 2 eye or a 1 pixel highlight is often better than a single dark pixel.-- Match visual weight between animals. Different species can have different proportions, but the on-screen size should feel comparable.--## Animation--- Make idle motion local: breathing, wing settling, ear feather movement, tail flicks, head turns, and blinking.-- Avoid moving the entire sprite unless the action is hop, fly, recoil, or collapse.-- Preserve the animal identity in every frame. A blink frame should still clearly read as the same bird.-- Keep the first frame a stable readable pose because it is what appears in reduced-motion rendering.--## Current Assets--- `OwlBlink.svg`: five-frame blink/idle strip with breathing wings, blink, and ear-feather settle.-- `EagleIdle.svg`: four-frame idle strip with breathing, blink, alert head shift, and tail flick.-- `ToucanIdle.svg`: four-frame idle strip with beak bob, chest breathing, blink, tail flick, and settle.diff --git a/web/src/components/Placeholder/pieces/EagleIdle.svg b/web/src/components/Placeholder/pieces/EagleIdle.svgdeleted file mode 100644index 1e53f112a..000000000--- a/web/src/components/Placeholder/pieces/EagleIdle.svg+++ /dev/null@@ -1,122 +0,0 @@-<svg xmlns="http://www.w3.org/2000/svg" width="128" height="32" viewBox="0 0 128 32" role="img" aria-labelledby="title desc" shape-rendering="crispEdges">- <title id="title">Eagle idle pixel tileset</title>- <desc id="desc">A four-frame 32 by 32 pixel eagle idle animation strip.</desc>- <defs>- <style>- .outline { fill: #120f0d; }- .head { fill: #f2efe7; }- .head-shadow { fill: #d4cec2; }- .beak { fill: #e7a634; }- .beak-light { fill: #f1bf48; }- .beak-shadow { fill: #b56e25; }- .body { fill: #7a5943; }- .body-dark { fill: #4b362d; }- .feather { fill: #a77b58; }- .wing { fill: #6a4b39; }- .tail-tip { fill: #f2efe7; }- .claw { fill: #d9972d; }- .eye { fill: #cf482b; }- .eye-light { fill: #ffd069; }- </style>-- <symbol id="eagle-head" viewBox="0 0 32 32">- <path class="outline" d="M14 2h10v1h1v12h2v3h-1v1h-4v-2h-3v-3h-3v-2h-2V9H5V8h1V6h5V4h3V2z" />- <path class="head" d="M15 4h8v1h1v10h2v2h-3v-2h-3v-3h-3v-2h-2V8h-4V6h4V4z" />- <rect class="head-shadow" x="16" y="14" width="3" height="2" />- <rect class="head-shadow" x="20" y="16" width="2" height="1" />- <rect class="outline" x="18" y="7" width="3" height="1" />- <rect class="eye" x="20" y="8" width="2" height="2" />- <rect class="eye-light" x="21" y="8" width="1" height="1" />-- <path class="outline" d="M4 9h11v1h2v5h-1v2H6v3H4V9z" />- <path class="beak-light" d="M6 10h9v1h1v2H6v-3z" />- <path class="beak" d="M5 13h11v2h-1v1H6v3H5v-6z" />- <rect class="beak-shadow" x="6" y="15" width="8" height="1" />- </symbol>-- <symbol id="eagle-head-alert" viewBox="0 0 32 32">- <use href="#eagle-head" x="-1" />- <rect class="outline" x="18" y="7" width="4" height="1" />- <rect class="eye" x="19" y="8" width="2" height="2" />- <rect class="eye-light" x="20" y="8" width="1" height="1" />- </symbol>-- <symbol id="eagle-body" viewBox="0 0 32 32">- <path class="outline" d="M7 15h17v2h2v9h-2v3h-4v2H10v-2H7v-3H6v-9h1v-2z" />- <path class="body" d="M9 16h14v2h1v8h-2v2H12v-2H9V16z" />- <path class="wing" d="M7 17h3v9H8v-1H7v-8z" />- <path class="wing" d="M23 17h3v8h-1v1h-2v-9z" />- <path class="body-dark" d="M10 25h3v2h2v2h-5v-2H8v-2h2z" />- <rect class="body-dark" x="22" y="25" width="3" height="2" />-- <rect class="feather" x="11" y="18" width="1" height="1" />- <rect class="feather" x="15" y="18" width="1" height="1" />- <rect class="feather" x="19" y="18" width="1" height="1" />- <rect class="feather" x="12" y="20" width="1" height="1" />- <rect class="feather" x="16" y="20" width="1" height="1" />- <rect class="feather" x="20" y="20" width="1" height="1" />- <rect class="feather" x="13" y="22" width="1" height="1" />- <rect class="feather" x="18" y="22" width="1" height="1" />- <rect class="feather" x="21" y="22" width="1" height="1" />-- <rect class="outline" x="13" y="28" width="2" height="2" />- <rect class="outline" x="19" y="28" width="2" height="2" />- <path class="claw" d="M14 26h1v3h2v1h-5v-1h2v-3z" />- <path class="claw" d="M20 26h1v3h2v1h-5v-1h2v-3z" />- </symbol>-- <symbol id="eagle-body-breathe" viewBox="0 0 32 32">- <use href="#eagle-body" />- <rect class="outline" x="7" y="16" width="3" height="1" />- <rect class="wing" x="7" y="18" width="3" height="8" />- <rect class="outline" x="23" y="16" width="3" height="1" />- <rect class="wing" x="23" y="18" width="3" height="7" />- <rect class="body" x="11" y="17" width="10" height="1" />- </symbol>-- <symbol id="eagle-tail" viewBox="0 0 32 32">- <path class="outline" d="M23 23h3v2h3v1h2v3h-2v1h-5v-2h-2v-3h1v-2z" />- <path class="body-dark" d="M23 24h3v2h2v1h-4v-1h-1v-2z" />- <rect class="tail-tip" x="26" y="25" width="2" height="2" />- <rect class="tail-tip" x="24" y="27" width="2" height="1" />- </symbol>-- <symbol id="eagle-tail-flick" viewBox="0 0 32 32">- <path class="outline" d="M23 22h3v2h3v1h2v3h-2v1h-5v-2h-2v-3h1v-2z" />- <path class="body-dark" d="M23 23h3v2h2v1h-4v-1h-1v-2z" />- <rect class="tail-tip" x="26" y="24" width="2" height="2" />- <rect class="tail-tip" x="24" y="26" width="2" height="1" />- </symbol>-- <symbol id="eagle-idle-a" viewBox="0 0 32 32">- <use href="#eagle-tail" />- <use href="#eagle-body" />- <use href="#eagle-head" />- </symbol>-- <symbol id="eagle-idle-b" viewBox="0 0 32 32">- <use href="#eagle-tail" />- <use href="#eagle-body-breathe" />- <use href="#eagle-head" />- </symbol>-- <symbol id="eagle-idle-blink" viewBox="0 0 32 32">- <use href="#eagle-tail" />- <use href="#eagle-body" />- <use href="#eagle-head" />- <rect class="head" x="20" y="8" width="2" height="2" />- <rect class="outline" x="19" y="8" width="3" height="1" />- </symbol>-- <symbol id="eagle-idle-c" viewBox="0 0 32 32">- <use href="#eagle-tail-flick" />- <use href="#eagle-body" />- <use href="#eagle-head-alert" />- </symbol>- </defs>-- <use href="#eagle-idle-a" x="0" y="0" width="32" height="32" />- <use href="#eagle-idle-b" x="32" y="0" width="32" height="32" />- <use href="#eagle-idle-blink" x="64" y="0" width="32" height="32" />- <use href="#eagle-idle-c" x="96" y="0" width="32" height="32" />-</svg>diff --git a/web/src/components/Placeholder/pieces/OwlBlink.svg b/web/src/components/Placeholder/pieces/OwlBlink.svgdeleted file mode 100644index db2142846..000000000--- a/web/src/components/Placeholder/pieces/OwlBlink.svg+++ /dev/null@@ -1,85 +0,0 @@-<svg xmlns="http://www.w3.org/2000/svg" width="160" height="32" viewBox="0 0 160 32" role="img" aria-labelledby="title desc" shape-rendering="crispEdges">- <title id="title">Owl blink pixel tileset</title>- <desc id="desc">A five-frame 32 by 32 pixel owl idle and blink animation strip.</desc>- <defs>- <style>- .outline { fill: #2f2a24; }- .body { fill: #70685d; }- .body-dark { fill: #585147; }- .wing { fill: #5f584f; }- .face { fill: #b8afa2; }- .face-dark { fill: #958c7f; }- .eye-light { fill: #f4ead5; }- .eye-dark { fill: #2f2a24; }- .beak { fill: #bf9a53; }- .claw { fill: #d8d1c4; }- .contact { fill: #2f2a24; }- </style>-- <symbol id="owl-open" viewBox="0 0 32 32">- <path class="outline" d="M7 0h6v2h6V0h6v3h2v3h2v19h-2v4h-5v2H10v-2H5v-4H3V6h2V3h2V0z" />- <path class="body" d="M8 5h16v2h2v17h-2v3h-5v2h-6v-2H8v-3H6V7h2V5z" />- <path class="wing" d="M4 15h6v11H8v-1H5v-3H4v-7z" />- <path class="wing" d="M22 15h6v7h-1v3h-3v1h-2V15z" />-- <rect class="face" x="7" y="7" width="8" height="11" />- <rect class="face" x="17" y="7" width="8" height="11" />- <rect class="face-dark" x="9" y="19" width="14" height="5" />-- <rect class="eye-light" x="8" y="9" width="5" height="5" />- <rect class="eye-light" x="19" y="9" width="5" height="5" />- <rect class="eye-dark" x="10" y="10" width="2" height="3" />- <rect class="eye-dark" x="20" y="10" width="2" height="3" />-- <rect class="beak" x="15" y="15" width="2" height="2" />- <rect class="beak" x="14" y="17" width="4" height="2" />- <rect class="contact" x="11" y="27" width="2" height="3" />- <rect class="contact" x="19" y="27" width="2" height="3" />- <rect class="claw" x="10" y="30" width="4" height="1" />- <rect class="claw" x="18" y="30" width="4" height="1" />- </symbol>-- <symbol id="owl-breathe" viewBox="0 0 32 32">- <use href="#owl-open" />- <rect class="body-dark" x="3" y="16" width="1" height="6" />- <rect class="wing" x="4" y="16" width="6" height="10" />- <rect class="body-dark" x="28" y="16" width="1" height="6" />- <rect class="wing" x="22" y="16" width="6" height="10" />- <rect class="body" x="11" y="24" width="10" height="2" />- <rect class="body-dark" x="10" y="25" width="12" height="1" />- <rect class="claw" x="10" y="30" width="5" height="1" />- <rect class="claw" x="17" y="30" width="5" height="1" />- </symbol>-- <symbol id="owl-half" viewBox="0 0 32 32">- <use href="#owl-breathe" />- <rect class="face" x="8" y="9" width="5" height="5" />- <rect class="face" x="19" y="9" width="5" height="5" />- <rect class="eye-dark" x="8" y="11" width="5" height="2" />- <rect class="eye-dark" x="19" y="11" width="5" height="2" />- </symbol>-- <symbol id="owl-closed" viewBox="0 0 32 32">- <use href="#owl-breathe" />- <rect class="face" x="8" y="9" width="5" height="5" />- <rect class="face" x="19" y="9" width="5" height="5" />- <rect class="eye-dark" x="8" y="12" width="5" height="1" />- <rect class="eye-dark" x="19" y="12" width="5" height="1" />- </symbol>-- <symbol id="owl-settle" viewBox="0 0 32 32">- <use href="#owl-open" />- <rect class="body-dark" x="6" y="1" width="2" height="3" />- <rect class="body-dark" x="24" y="1" width="2" height="3" />- <rect class="body-dark" x="4" y="21" width="1" height="2" />- <rect class="body-dark" x="27" y="21" width="1" height="2" />- <rect class="face-dark" x="11" y="20" width="10" height="1" />- </symbol>- </defs>-- <use href="#owl-open" x="0" y="0" width="32" height="32" />- <use href="#owl-breathe" x="32" y="0" width="32" height="32" />- <use href="#owl-half" x="64" y="0" width="32" height="32" />- <use href="#owl-closed" x="96" y="0" width="32" height="32" />- <use href="#owl-settle" x="128" y="0" width="32" height="32" />-</svg>diff --git a/web/src/components/Placeholder/pieces/ToucanIdle.svg b/web/src/components/Placeholder/pieces/ToucanIdle.svgdeleted file mode 100644index cf34c2c76..000000000--- a/web/src/components/Placeholder/pieces/ToucanIdle.svg+++ /dev/null@@ -1,87 +0,0 @@-<svg xmlns="http://www.w3.org/2000/svg" width="128" height="32" viewBox="0 0 128 32" role="img" aria-labelledby="title desc" shape-rendering="crispEdges">- <title id="title">Toucan idle pixel tileset</title>- <desc id="desc">A four-frame 32 by 32 pixel toucan idle animation strip.</desc>- <defs>- <style>- .outline { fill: #2f2a24; }- .body { fill: #1f2528; }- .bodyHighlight { fill: #354046; }- .face { fill: #2b3539; }- .chest { fill: #f1d88b; }- .chestShadow { fill: #c99b55; }- .beak { fill: #e57f24; }- .beakHighlight { fill: #f4c247; }- .beakAccent { fill: #b93d22; }- .eye { fill: #120f0d; }- .eyeLight { fill: #f4ead5; }- .foot { fill: #b86f2e; }- </style>-- <symbol id="toucan-open" viewBox="0 0 32 32">- <path class="outline" d="M14 5h7v2h3v4h2v12h-2v4h-3v2h-8v-2h-3v-5H8v-3H5v-2H2v-6h2V9h4V7h6V5z" />- <path class="beak" d="M4 10h10v1h3v3h-1v3H4v-1H3v-4h1v-2z" />- <path class="beakHighlight" d="M5 10h8v1h2v2H5v-3z" />- <rect class="beakAccent" x="3" y="14" width="4" height="2" />-- <path class="body" d="M15 8h6v2h2v12h-2v3h-3v2h-5v-2h-2v-5h2v-3h2V8z" />- <path class="face" d="M15 8h5v2h1v5h-2v1h-4V8z" />- <path class="bodyHighlight" d="M18 10h3v8h-1v2h-2V10z" />- <rect class="chest" x="15" y="9" width="2" height="2" />- <path class="chest" d="M11 16h6v8h-1v2h-3v-2h-2v-8z" />- <rect class="chestShadow" x="12" y="23" width="4" height="1" />- <rect class="body" x="16" y="17" width="1" height="5" />-- <rect class="eyeLight" x="15" y="9" width="2" height="2" />- <rect class="eye" x="16" y="10" width="1" height="1" />- <rect class="bodyHighlight" x="19" y="12" width="1" height="4" />-- <path class="body" d="M24 20h3v2h2v2h-4v-1h-1v-3z" />- <rect class="bodyHighlight" x="25" y="21" width="2" height="2" />- <rect class="foot" x="13" y="27" width="2" height="3" />- <rect class="foot" x="18" y="27" width="2" height="3" />- </symbol>-- <symbol id="toucan-breathe" viewBox="0 0 32 32">- <path class="outline" d="M14 6h7v2h3v4h2v11h-2v4h-3v2h-8v-2h-3v-5H8v-3H5v-2H2v-6h2V9h4V7h6V6z" />- <path class="beak" d="M4 11h10v1h3v3h-1v3H4v-1H3v-4h1v-2z" />- <path class="beakHighlight" d="M5 11h8v1h2v2H5v-3z" />- <rect class="beakAccent" x="3" y="15" width="4" height="2" />-- <path class="body" d="M15 9h6v2h2v11h-2v3h-3v2h-5v-2h-2v-5h2v-3h2V9z" />- <path class="face" d="M15 9h5v2h1v5h-2v1h-4V9z" />- <path class="bodyHighlight" d="M18 11h3v7h-1v2h-2v-9z" />- <rect class="chest" x="15" y="10" width="2" height="2" />- <path class="chest" d="M10 16h7v9h-1v2h-3v-2h-3v-9z" />- <rect class="chestShadow" x="11" y="24" width="5" height="1" />- <rect class="body" x="17" y="17" width="1" height="5" />-- <rect class="eyeLight" x="15" y="10" width="2" height="2" />- <rect class="eye" x="16" y="11" width="1" height="1" />- <rect class="bodyHighlight" x="19" y="13" width="1" height="3" />-- <path class="body" d="M25 21h3v2h1v2h-4v-1h-1v-2h1v-1z" />- <rect class="bodyHighlight" x="26" y="22" width="2" height="2" />- <rect class="foot" x="13" y="27" width="2" height="3" />- <rect class="foot" x="18" y="27" width="2" height="3" />- </symbol>-- <symbol id="toucan-blink" viewBox="0 0 32 32">- <use href="#toucan-open" />- <rect class="face" x="15" y="9" width="2" height="2" />- <rect class="eye" x="15" y="10" width="2" height="1" />- </symbol>-- <symbol id="toucan-settle" viewBox="0 0 32 32">- <use href="#toucan-open" />- <rect class="bodyHighlight" x="18" y="10" width="3" height="2" />- <rect class="chest" x="12" y="17" width="4" height="1" />- <rect class="body" x="24" y="21" width="3" height="2" />- <rect class="bodyHighlight" x="25" y="22" width="2" height="1" />- </symbol>- </defs>-- <use href="#toucan-open" x="0" y="0" width="32" height="32" />- <use href="#toucan-breathe" x="32" y="0" width="32" height="32" />- <use href="#toucan-blink" x="64" y="0" width="32" height="32" />- <use href="#toucan-settle" x="96" y="0" width="32" height="32" />-</svg>diff --git a/web/src/components/Placeholder/tileSprites.ts b/web/src/components/Placeholder/tileSprites.tsdeleted file mode 100644index 460a9a7d4..000000000--- a/web/src/components/Placeholder/tileSprites.ts+++ /dev/null@@ -1,43 +0,0 @@-import EagleIdle from "./pieces/EagleIdle.svg?url";-import OwlBlink from "./pieces/OwlBlink.svg?url";-import ToucanIdle from "./pieces/ToucanIdle.svg?url";--export interface TileSprite {- name: string;- src: string;- frameWidth: number;- frameHeight: number;- frames: number;- duration: number;-}--export const TILE_SPRITES: TileSprite[] = [- {- name: "OwlBlink",- src: OwlBlink,- frameWidth: 32,- frameHeight: 32,- frames: 5,- duration: 1500,- },- {- name: "EagleIdle",- src: EagleIdle,- frameWidth: 32,- frameHeight: 32,- frames: 4,- duration: 960,- },- {- name: "ToucanIdle",- src: ToucanIdle,- frameWidth: 32,- frameHeight: 32,- frames: 4,- duration: 1120,- },-];--export function pickTileSprite(): TileSprite {- return TILE_SPRITES[Math.floor(Math.random() * TILE_SPRITES.length)];-}diff --git a/web/src/pages/Inboxes.tsx b/web/src/pages/Inboxes.tsxindex 33437cb0f..a37c7ab42 100644--- a/web/src/pages/Inboxes.tsx+++ b/web/src/pages/Inboxes.tsx@@ -51,7 +51,7 @@ const Inboxes = () => {<div className="w-full">{notifications.length === 0 ? (<Placeholder- variant="empty"+ scene="inbox"message={filter === "unread" ? t("inbox.no-unread") : filter === "archived" ? t("inbox.no-archived") : t("message.no-data")}/>) : (diff --git a/web/tests/paged-memo-list.test.tsx b/web/tests/paged-memo-list.test.tsxindex 4f40590f5..2a0dc6530 100644--- a/web/tests/paged-memo-list.test.tsx+++ b/web/tests/paged-memo-list.test.tsx@@ -16,7 +16,7 @@ const feed = vi.hoisted(() => ({isFetchNextPageError: false,}));const sidebar = vi.hoisted(() => ({ setQuickFindOpen: vi.fn() }));-const filterContext = vi.hoisted(() => ({ removeFilter: vi.fn() }));+const filterContext = vi.hoisted(() => ({ filters: [{ factor: "celSearch", value: "pinned" }], removeFilter: vi.fn() }));const readiness = vi.hoisted(() => ({ userSettings: true }));const memoQuery = vi.hoisted(() => ({ request: undefined as Record<string, unknown> | undefined }));@@ -40,7 +40,7 @@ vi.mock("@/hooks/useMemoQueries", () => ({vi.mock("@/contexts/MemoFilterContext", async (importOriginal) => ({...(await importOriginal<typeof import("@/contexts/MemoFilterContext")>()),- useMemoFilterContext: () => ({ filters: [{ factor: "celSearch", value: "pinned" }], removeFilter: filterContext.removeFilter }),+ useMemoFilterContext: () => ({ filters: filterContext.filters, removeFilter: filterContext.removeFilter }),}));vi.mock("@/contexts/AppSidebarContext", () => ({ useAppSidebar: () => sidebar }));@@ -90,6 +90,7 @@ describe("<PagedMemoList>", () => {feed.isFetchNextPageError = false;sidebar.setQuickFindOpen.mockClear();filterContext.removeFilter.mockClear();+ filterContext.filters = [{ factor: "celSearch", value: "pinned" }];readiness.userSettings = true;memoQuery.request = undefined;});@@ -232,11 +233,18 @@ describe("<PagedMemoList>", () => {expect(screen.getByTestId("leading-content")).toBeInTheDocument();});- it("uses the tile sprite Placeholder for the empty state", () => {+ it("uses the search illustration when filters return no memos", () => {renderList();expect(screen.getByText("No data found.")).toBeInTheDocument();- expect(screen.getByTestId("placeholder-sprite")).toBeInTheDocument();+ expect(screen.getByTestId("placeholder-illustration")).toHaveAttribute("data-scene", "search");+ });++ it("uses the blank memo illustration for an unfiltered empty list", () => {+ filterContext.filters = [];+ renderList();++ expect(screen.getByTestId("placeholder-illustration")).toHaveAttribute("data-scene", "memo");});it("combines the selected Space filter with the memo list filter", () => {@@ -256,7 +264,7 @@ describe("<PagedMemoList>", () => {expect(screen.getByTestId("leading-content")).toBeInTheDocument();expect(screen.getByText("No data found.")).toBeInTheDocument();- expect(screen.getByTestId("placeholder-sprite")).toBeInTheDocument();+ expect(screen.getByTestId("placeholder-illustration")).toBeInTheDocument();});it("places leading content and the empty state in the first grid column", () => {diff --git a/web/tests/placeholder-component.test.tsx b/web/tests/placeholder-component.test.tsxindex f7ecdb19e..6bfd2315b 100644--- a/web/tests/placeholder-component.test.tsx+++ b/web/tests/placeholder-component.test.tsx@@ -1,85 +1,20 @@import { render, screen } from "@testing-library/react";import { describe, expect, it } from "vitest";import Placeholder from "@/components/Placeholder";-import { DEFAULT_MESSAGES } from "@/components/Placeholder/messages";describe("<Placeholder>", () => {- it("renders the default message for variant=empty", () => {- render(<Placeholder variant="empty" />);- expect(screen.getByText(DEFAULT_MESSAGES.empty)).toBeInTheDocument();- });-- it("renders the default message for variant=loading", () => {- render(<Placeholder variant="loading" />);- expect(screen.getByText(DEFAULT_MESSAGES.loading)).toBeInTheDocument();- });-- it("renders the default message for variant=noResults", () => {- render(<Placeholder variant="noResults" />);- expect(screen.getByText(DEFAULT_MESSAGES.noResults)).toBeInTheDocument();- });-- it("renders the default message for variant=notFound", () => {- render(<Placeholder variant="notFound" />);- expect(screen.getByText(DEFAULT_MESSAGES.notFound)).toBeInTheDocument();- });-- it("overrides the default message when `message` prop is passed", () => {- render(<Placeholder variant="empty" message="Custom copy goes here" />);- expect(screen.getByText("Custom copy goes here")).toBeInTheDocument();- expect(screen.queryByText(DEFAULT_MESSAGES.empty)).not.toBeInTheDocument();- });-- it("renders a 32px sprite tileset at a crisp 2x display scale", () => {- const { container } = render(<Placeholder variant="empty" />);- const viewport = screen.getByTestId("placeholder-sprite");- const strip = viewport.firstElementChild;-- expect(viewport).toHaveAttribute("aria-hidden", "true");- expect(viewport).toHaveStyle({- width: "64px",- height: "64px",- overflow: "hidden",- });- expect(strip).toHaveAttribute("src", expect.stringMatching(/(\.svg|data:image\/svg\+xml)/));- expect(strip).toHaveAttribute("width", expect.stringMatching(/^(128|160|192)$/));- expect(strip).toHaveAttribute("height", "32");- expect(["256px", "320px", "384px"]).toContain((strip as HTMLElement).style.width);- expect(["steps(4)", "steps(5)", "steps(6)"]).toContain((strip as HTMLElement).style.animationTimingFunction);- expect(strip).toHaveStyle({- height: "64px",- imageRendering: "pixelated",- });- expect(container.firstChild).toHaveClass("max-w-md");- });-- it("does not render registry credit strings in the UI", () => {- render(<Placeholder variant="empty" />);- expect(screen.queryByText(/Memos original ASCII art/i)).not.toBeInTheDocument();- expect(screen.queryByText(/jgs|Joan Stark/i)).not.toBeInTheDocument();- });-- it('applies role="status" and aria-live="polite" ONLY when variant=loading', () => {- const { rerender, container } = render(<Placeholder variant="empty" />);- expect(container.querySelector('[role="status"]')).toBeNull();-- rerender(<Placeholder variant="loading" />);- const live = container.querySelector('[role="status"]');- expect(live).not.toBeNull();- expect(live).toHaveAttribute("aria-live", "polite");- });+ it.each(["memo", "search", "inbox"] as const)("renders the %s scene as decorative artwork", (scene) => {+ render(<Placeholder scene={scene} message="No data found." />);- it("renders children below the message when provided", () => {- render(- <Placeholder variant="notFound">- <button type="button">Go home</button>- </Placeholder>,- );- expect(screen.getByRole("button", { name: "Go home" })).toBeInTheDocument();+ const illustration = screen.getByTestId("placeholder-illustration");+ expect(illustration).toHaveAttribute("data-scene", scene);+ expect(illustration).toHaveAttribute("aria-hidden", "true");+ expect(illustration).toHaveAttribute("viewBox", "0 0 560 280");+ expect(screen.getByText("No data found.")).toBeInTheDocument();});- it("merges a custom className onto the outer wrapper", () => {- const { container } = render(<Placeholder variant="empty" className="custom-test-class" />);- expect(container.firstChild).toHaveClass("custom-test-class");+ it("merges layout classes from its caller", () => {+ const { container } = render(<Placeholder scene="memo" message="Nothing here" className="w-full" />);+ expect(container.firstChild).toHaveClass("w-full");});});diff --git a/web/tests/placeholder-pool.test.ts b/web/tests/placeholder-pool.test.tsdeleted file mode 100644index 043494925..000000000--- a/web/tests/placeholder-pool.test.ts+++ /dev/null@@ -1,36 +0,0 @@-import { describe, expect, it } from "vitest";-import { DEFAULT_MESSAGES, type PlaceholderVariant } from "@/components/Placeholder/messages";-import { pickTileSprite, TILE_SPRITES } from "@/components/Placeholder/tileSprites";--describe("TILE_SPRITES integrity", () => {- it("registers 32px by 32px sprite strips with animation-specific frame counts", () => {- expect(TILE_SPRITES.map((sprite) => sprite.name)).toEqual(["OwlBlink", "EagleIdle", "ToucanIdle"]);- expect(TILE_SPRITES.map((sprite) => [sprite.name, sprite.frames])).toEqual([- ["OwlBlink", 5],- ["EagleIdle", 4],- ["ToucanIdle", 4],- ]);-- for (const sprite of TILE_SPRITES) {- expect(sprite.name).toMatch(/^[A-Z][A-Za-z]+(Idle|Hop|Blink|Drift|Flutter|Hover|Peck)$/);- expect(sprite.frameWidth).toBe(32);- expect(sprite.frameHeight).toBe(32);- expect(sprite.frames).toBeGreaterThanOrEqual(2);- expect(sprite.src).toMatch(/(\.svg|data:image\/svg\+xml)/);- }- });-- it("returns a registered tile sprite from the pool", () => {- const sprite = pickTileSprite();- expect(TILE_SPRITES).toContain(sprite);- });-});--describe("DEFAULT_MESSAGES", () => {- it("provides a non-empty message for every variant", () => {- for (const variant of Object.keys(DEFAULT_MESSAGES) as PlaceholderVariant[]) {- expect(DEFAULT_MESSAGES[variant], `variant=${variant}`).toBeTruthy();- expect(DEFAULT_MESSAGES[variant].trim().length).toBeGreaterThan(0);- }- });-});