Repository navigation
feat(web): static Danbooru-style frontend (home, gallery, post, upload) - #3
Conversation
A complete static UI on the React 19 + TanStack Router + Tailwind v4 stack (no backend yet; tag/post data is static fixtures). Pages - home: clean centered landing — banner placeholder, moe-counter post count, centered search + menu, login/sign-up - posts: masonry/classic gallery, sectioned tag sidebar (grouped + related), pagination, post-tags & tag popovers, autocomplete search - post detail (/posts/:id): image, grouped tags, info panel, comments - upload: file/URL, preview, tags, rating, source Popover system (Floating UI) — see docs/POPOVER.md - reusable hover popover + click DropdownMenu primitives - tag popover (related tags), post-tags popover, search autocomplete Gallery controls (Zustand-persisted) - Size menu: column count 1-7 - Options menu: show/hide score overlays + board mode - board mode: classic (uniform square) vs fluid (masonry) Theme - Light / Dark / Auto switcher; semantic color tokens flip in a .dark block toggled on <html> Tooling: zustand, lucide-react, @floating-ui/react; web dev server binds 0.0.0.0. typecheck passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 49 minutes and 43 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. 📝 WalkthroughWalkthroughThis PR boots the ChangesBunbooru Web App
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 15
🧹 Nitpick comments (1)
docs/POPOVER.md (1)
74-83: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueHTTP method syntax in API contract uses incorrect comment style.
The API contract uses
→arrows with inline#comments inside JSON-like structures. Line 79's# antecedent = matched aliasis not valid JSON and could confuse readers. Move the comment outside the code block or use a proper JSON format with a field description.GET /api/v1/tags/autocomplete?q=<prefix>&limit=10 - → [{ name, category, postCount, antecedent?: string }] # antecedent = matched alias + → [{ name, category, postCount, antecedent?: string }] + + `antecedent` is the matched alias when the query resolved via alias.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/POPOVER.md` around lines 74 - 83, The API contract in the documented examples uses invalid inline comment syntax inside the JSON-like payload, specifically the `GET /api/v1/tags/autocomplete` response in POPOVER.md; update the documentation around the response shape so the `antecedent` note is moved outside the code block or rewritten as valid JSON-style documentation, and keep the examples consistent with the other endpoints like `GET /api/v1/tags/:name` and `GET /api/v1/posts/:id`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/src/components/counter.tsx`:
- Around line 29-38: The counter component currently exposes each digit
separately through the <span> rendering in Counter, which makes screen reader
output noisy and repetitive. Update the Counter wrapper to provide one
accessible label for the full value, and mark the per-digit <img> glyphs as
hidden from the accessibility tree instead of using per-digit alt text. Keep the
visible rendering unchanged, but ensure the accessible name comes from the
container in Counter rather than from each digit image.
In `@apps/web/src/components/menu/dropdown-menu.tsx`:
- Around line 3-16: The dropdown popup is using menu semantics for content that
is just plain buttons and a checkbox, so update the `DropdownMenu`/`useRole`
setup in `dropdown-menu.tsx` to stop advertising `role="menu"` unless the
children are converted to real menu items. Keep the floating interactions, but
remove the menu role from the `useRole` call (or switch to appropriate
semantics) so the widget matches the actual `DropdownMenu` content and keyboard
model.
In `@apps/web/src/components/popover/post-tags-card.tsx`:
- Around line 17-21: The tag items in PostTagsCard are currently rendered as
anchor links pointing to a placeholder hash, which causes an unwanted scroll
jump in the popover. Update the mapping in post-tags-card.tsx so the tag names
are rendered as non-navigating text or buttons until real tag routing is
available, and remove the href="#" behavior from the existing anchor element in
the grouped.get(category) render path.
In `@apps/web/src/components/popover/search-box.tsx`:
- Around line 37-43: The SearchBox component currently renders an unlabeled
search input, so add an accessible name for screen readers. Update SearchBox to
pass either a visible <label> tied to the input or an aria-label using the
existing placeholder/className props, and make sure the underlying input in
SearchBox is the one receiving the accessible name. Keep the fix in SearchBox so
both posts and post-detail usages inherit it automatically.
In `@apps/web/src/components/popover/tag-popover-card.tsx`:
- Around line 27-30: The related-tag item in tag-popover-card currently uses an
anchor with href="#" which triggers hash navigation and page jumps. Update the
related-tag rendering in the tag-popover card to avoid a fake link: either
replace the <a> in the related tag list with a non-link element like a
button/span, or keep the anchor but prevent default behavior in its click
handler until real tag navigation exists. Refer to the related-tag JSX in
tag-popover-card and the TAG_TEXT_CLASS usage when making the change.
In `@apps/web/src/components/tags/tag-row.tsx`:
- Around line 13-20: Both actions in tag-row are using placeholder anchor
navigation, so the wiki trigger and tag label act like broken links. In the
tag-row component, update the two <a href="#"> elements to avoid default
navigation: either replace them with button-like controls or add click handling
that prevents the browser from jumping to the top until real destinations exist.
Keep the existing HoverPopover and TAG_TEXT_CLASS/tag.category behavior intact
while fixing the link semantics.
In `@apps/web/src/components/theme-switcher.tsx`:
- Around line 17-30: The theme toggle in the theme-switcher component only
signals the selected option with color, so assistive tech cannot identify the
active theme. Update the button rendering in the OPTIONS map to expose the
current selection using aria-pressed on each button, or switch the control to
proper radio-group semantics, and keep the active state tied to the existing
theme value and setTheme handler.
In `@apps/web/src/components/visitor-counter.tsx`:
- Around line 17-22: The mount effect in visitor-counter.tsx is not idempotent,
so under StrictMode it increments localStorage twice per app boot. Update the
visitor counter logic in the visitor-counter component to detect and ignore
duplicate mount executions for the same boot, using the existing STORAGE_KEY
state/read path and the useEffect initialization flow. Keep the increment/write
path in one place, but guard it so a single app start only advances the counter
once even when StrictMode re-runs the effect.
In `@apps/web/src/index.ts`:
- Around line 15-18: The serve configuration in the web entrypoint is forcing
Bun development mode for every startup path. Update the server setup in the
serve call so it does not hardcode development: true, and instead derives the
development flag from the runtime/environment used by the dev and start scripts
in apps/web/package.json. Keep the change localized to the server bootstrap in
the index entrypoint.
In `@apps/web/src/lib/tags.ts`:
- Around line 95-100: Normalize the input in postTags before using it to derive
TAG_NAMES indexes, since post-detail.tsx passes Number(id) directly and negative
or fractional values can produce invalid array access. Update postTags to coerce
id into a safe non-negative integer (or otherwise sanitize it) before computing
count and the TAG_NAMES lookup, so the helper always returns the expected number
of unique tags.
In `@apps/web/src/routes/__root.tsx`:
- Around line 11-20: The MENU entries in __root.tsx are using /posts as a
placeholder target for unrelated nav items like Comments, Notes, Artists, Tags,
Pools, Wiki, Forum, and More, which makes them look clickable but sends users to
the wrong screen. Update the MENU definition so only real routes remain active,
and either remove the placeholder items from the header or render them as
disabled/non-navigating placeholders until their routes exist; keep the Posts
item pointing to the actual posts route.
In `@apps/web/src/routes/home.tsx`:
- Around line 37-52: The landing-page search form in the home route is a dead
control because the current submit handler only calls preventDefault and ignores
the input value. Update the Home component’s form/input/button wiring so the
query is actually read and submitted into the posts flow, or explicitly disable
the search UI until that flow exists. Use the Home route’s form submit handler
and search input/button as the main symbols to locate and fix the behavior.
In `@apps/web/src/routes/post-detail.tsx`:
- Around line 9-13: The PostDetailPage route logic is coercing invalid or
zero-valued params to the first post via postId, which can make the URL and
rendered content disagree. Update PostDetailPage to validate the useParams value
from "/posts/$id" explicitly instead of falling back with Number(id) || 1, and
render a not-found or fallback state when the param is missing, non-numeric, or
otherwise invalid.
In `@apps/web/src/stores/theme.ts`:
- Around line 35-48: Bootstrap the theme before React mounts: the current
useApplyTheme hook in theme.ts applies html.dark too late because it runs in
useEffect, causing an initial light flash for persisted dark users. Move the
initial class setup into apps/web/src/index.html so it runs before the bundle
loads, and keep useApplyTheme only for runtime updates and media-query changes
via resolveDark and the existing theme store.
In `@docs/POPOVER.md`:
- Around line 32-40: The architecture section in POPOVER.md uses file names that
don’t match the current implementation, which can confuse the Phase 1 handoff.
Update the documented component list to reflect the actual symbols/files used in
the popover area, especially the entries for the preview card and autocomplete
dropdown, or add a short note explaining the naming change so readers can map
the design doc to the codebase accurately.
---
Nitpick comments:
In `@docs/POPOVER.md`:
- Around line 74-83: The API contract in the documented examples uses invalid
inline comment syntax inside the JSON-like payload, specifically the `GET
/api/v1/tags/autocomplete` response in POPOVER.md; update the documentation
around the response shape so the `antecedent` note is moved outside the code
block or rewritten as valid JSON-style documentation, and keep the examples
consistent with the other endpoints like `GET /api/v1/tags/:name` and `GET
/api/v1/posts/:id`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9602c0f6-6f38-4d5a-b498-f2a2e37e1a55
⛔ Files ignored due to path filters (12)
apps/web/src/assets/counters/0.gifis excluded by!**/*.gifapps/web/src/assets/counters/1.gifis excluded by!**/*.gifapps/web/src/assets/counters/2.gifis excluded by!**/*.gifapps/web/src/assets/counters/3.gifis excluded by!**/*.gifapps/web/src/assets/counters/4.gifis excluded by!**/*.gifapps/web/src/assets/counters/5.gifis excluded by!**/*.gifapps/web/src/assets/counters/6.gifis excluded by!**/*.gifapps/web/src/assets/counters/7.gifis excluded by!**/*.gifapps/web/src/assets/counters/8.gifis excluded by!**/*.gifapps/web/src/assets/counters/9.gifis excluded by!**/*.gifapps/web/src/favicon.svgis excluded by!**/*.svgbun.lockis excluded by!**/*.lock
📒 Files selected for processing (32)
.gitignoreapps/web/bunfig.tomlapps/web/package.jsonapps/web/src/assets.d.tsapps/web/src/components/counter.tsxapps/web/src/components/menu/dropdown-menu.tsxapps/web/src/components/popover/hover-popover.tsxapps/web/src/components/popover/post-tags-card.tsxapps/web/src/components/popover/search-box.tsxapps/web/src/components/popover/tag-popover-card.tsxapps/web/src/components/tags/tag-groups.tsxapps/web/src/components/tags/tag-row.tsxapps/web/src/components/theme-switcher.tsxapps/web/src/components/visitor-counter.tsxapps/web/src/index.htmlapps/web/src/index.tsapps/web/src/index.tsxapps/web/src/lib/post-fixtures.tsapps/web/src/lib/tags.tsapps/web/src/router.tsxapps/web/src/routes/__root.tsxapps/web/src/routes/home.tsxapps/web/src/routes/post-detail.tsxapps/web/src/routes/posts.tsxapps/web/src/routes/upload.tsxapps/web/src/stores/gallery.tsapps/web/src/stores/theme.tsapps/web/src/styles.cssapps/web/tsconfig.jsondocs/POPOVER.mdpackage.jsontsconfig.json
a11y - counter: one aria-label on the container; digit glyphs aria-hidden - search-box: aria-label on the input (inherited by all usages) - theme-switcher: aria-pressed on each option - dropdown-menu: drop misleading role=menu (plain buttons/checkbox) placeholder links (no fake href='#' navigation/scroll-jump) - post-tags-card / tag-popover-card: tags render as spans - tag-row: wiki + tag are focusable buttons (popover trigger keeps focus) - __root MENU: only Posts navigates; others are non-nav placeholders correctness - visitor-counter: guard StrictMode double-increment (count once per boot) - theme: bootstrap dark class in index.html (no light flash) - index.ts: derive dev mode from NODE_ENV (not hardcoded) - lib/tags postTags: sanitize id (NaN/negative/fractional safe) - post-detail: validate $id param, render not-found for invalid - home: search submit navigates to /posts (no longer a dead control) docs - POPOVER.md: component list matches implementation; antecedent note moved out of the code block
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/POPOVER.md`:
- Line 33: The fenced directory tree block in the popover docs is missing a
language specifier, so update the Markdown fence for that block to use the
appropriate language tag (the commented tree snippet in POPOVER.md) while
keeping the content unchanged. Use the existing fenced code block around the
directory listing and add the text language identifier so markdownlint passes
and the block remains accessible.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 27de2f51-b6fe-4c64-8885-bc6816374cf2
📒 Files selected for processing (15)
apps/web/src/components/counter.tsxapps/web/src/components/menu/dropdown-menu.tsxapps/web/src/components/popover/post-tags-card.tsxapps/web/src/components/popover/search-box.tsxapps/web/src/components/popover/tag-popover-card.tsxapps/web/src/components/tags/tag-row.tsxapps/web/src/components/theme-switcher.tsxapps/web/src/components/visitor-counter.tsxapps/web/src/index.htmlapps/web/src/index.tsapps/web/src/lib/tags.tsapps/web/src/routes/__root.tsxapps/web/src/routes/home.tsxapps/web/src/routes/post-detail.tsxdocs/POPOVER.md
🚧 Files skipped from review as they are similar to previous changes (13)
- apps/web/src/components/menu/dropdown-menu.tsx
- apps/web/src/components/popover/post-tags-card.tsx
- apps/web/src/components/popover/tag-popover-card.tsx
- apps/web/src/components/theme-switcher.tsx
- apps/web/src/components/tags/tag-row.tsx
- apps/web/src/components/visitor-counter.tsx
- apps/web/src/routes/home.tsx
- apps/web/src/index.ts
- apps/web/src/components/counter.tsx
- apps/web/src/routes/post-detail.tsx
- apps/web/src/lib/tags.ts
- apps/web/src/routes/__root.tsx
- apps/web/src/components/popover/search-box.tsx
Summary
A complete static booru UI (React 19 + TanStack Router + Tailwind v4). No backend yet — tag/post data are static fixtures; designed to swap to the Core API later (see docs/POPOVER.md).
Pages
/posts/:id) — image, grouped tags, info panel, comments.Popover system (Floating UI) — docs/POPOVER.md
DropdownMenuprimitives.Gallery controls (Zustand-persisted)
Theme
bg/surface/line/ink/muted) flip in a.darkblock toggled on<html>, so the whole UI re-themes from CSS variables.Tooling / notes
zustand,lucide-react,@floating-ui/react; web dev server binds0.0.0.0.bun run typecheck✓.Out of scope (Phase 1+)
Wiring fixtures to the Core tag/post API via Eden Treaty; backend endpoints.
Summary by CodeRabbit