Skip to content

Improve UI design: color tokens, accessibility, and UX#35

Merged
hackerwins merged 1 commit into
mainfrom
ui-design-improvements
Mar 15, 2026
Merged

Improve UI design: color tokens, accessibility, and UX#35
hackerwins merged 1 commit into
mainfrom
ui-design-improvements

Conversation

@hackerwins

@hackerwins hackerwins commented Mar 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Consolidate hardcoded homepage colors (stone-, amber-) into 9 CSS variable design tokens for maintainability
  • Improve accessibility: ARIA attributes, keyboard support for editable title, focus-visible rings, dynamic avatar initials
  • Add hover/focus effects to homepage cards, buttons, badges, and links
  • Add delete confirmation dialog to prevent accidental document deletion
  • Add retry button to document list error state

Test plan

  • Homepage (/): verify hover effects on feature cards, CTA buttons, code cards, badges, footer link
  • Homepage: toggle dark/light mode via footer — all sections should adapt correctly
  • Homepage: resize browser to mobile width — hero buttons should stack vertically
  • Document list: click → Delete — confirmation dialog should appear
  • Document list: simulate network error — retry button should appear and work
  • App header: Tab to editable document title — focus ring should be visible, Enter/Space opens edit mode
  • Sidebar: check avatar fallback shows user initials instead of "CN"

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Delete confirmation dialogs before removing documents
    • Retry button on error screens
    • Avatar now shows dynamic user initials
  • UI & Accessibility Improvements

    • Homepage dark theme tokens and refreshed color/hover styles
    • Improved focus states, keyboard interactions, and accessible icons
    • Loading spinner and visual polish across home/demo sections
    • Updated hero, footer, nav, and feature card layouts for consistency
  • Documentation

    • Added phased UI design improvements checklist with progress markers

@coderabbitai

coderabbitai Bot commented Mar 15, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9997924e-f9ad-46e8-a42f-8c43a1fa39f4

📥 Commits

Reviewing files that changed from the base of the PR and between a814400 and b88f4ab.

📒 Files selected for processing (13)
  • docs/tasks/active/20260315-ui-design-improvements-todo.md
  • packages/frontend/src/app/documents/document-list.tsx
  • packages/frontend/src/app/documents/page.tsx
  • packages/frontend/src/app/home/demo-section.tsx
  • packages/frontend/src/app/home/developer-section.tsx
  • packages/frontend/src/app/home/features-section.tsx
  • packages/frontend/src/app/home/footer.tsx
  • packages/frontend/src/app/home/hero-section.tsx
  • packages/frontend/src/app/home/nav-bar.tsx
  • packages/frontend/src/app/home/opensource-section.tsx
  • packages/frontend/src/components/nav-user.tsx
  • packages/frontend/src/components/site-header.tsx
  • packages/frontend/src/index.css

📝 Walkthrough

Walkthrough

Adds UI/UX changes: a delete confirmation flow for documents, retry on documents page, improved loading spinner, homepage dark-theme token consolidation and styling updates, accessibility/focus improvements, and avatar initials generation.

Changes

Cohort / File(s) Summary
Document Management
packages/frontend/src/app/documents/document-list.tsx
Replaces immediate delete with two-step flow: store deletingDoc in local state, show confirmation dialog, call delete mutation on confirm; cancel clears state.
Documents Page: Error & Retry
packages/frontend/src/app/documents/page.tsx
Adds refetch handling and a Retry button (with icon) that calls refetch; updates error copy and spacing.
Loading Placeholder
packages/frontend/src/app/home/demo-section.tsx
Replaces text-only loading placeholder with spinner + text inside a vertical stack.
Homepage Styling / Theme Tokens
packages/frontend/src/app/home/developer-section.tsx, packages/frontend/src/app/home/features-section.tsx, packages/frontend/src/app/home/footer.tsx, packages/frontend/src/app/home/hero-section.tsx, packages/frontend/src/app/home/nav-bar.tsx, packages/frontend/src/app/home/opensource-section.tsx, packages/frontend/src/index.css
Introduces homepage-dark color tokens and CTA variables; updates many homepage components to use new tokens, hover/focus styles, transitions, and adjusted layout sizes.
Accessibility & Avatars
packages/frontend/src/components/site-header.tsx, packages/frontend/src/components/nav-user.tsx
Adds keyboard/ARIA support and focus-visible styles for editable header title; computes and uses dynamic avatar initials instead of hardcoded fallback.
Docs / Roadmap
docs/tasks/active/20260315-ui-design-improvements-todo.md
Adds phased UI improvements checklist documenting color token consolidation, accessibility fixes, visual polish, and UX items (including delete dialog and error retry).

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant UI as DocumentList UI
  participant Dialog as ConfirmDialog
  participant API as Backend API
  participant Query as Documents Query Cache

  User->>UI: Click "Delete" in actions menu
  UI->>UI: set deletingDoc (id, title) -> open Dialog
  User->>Dialog: Click "Confirm Delete"
  Dialog->>API: deleteDocumentMutation(id)
  API-->>Dialog: 200 OK
  Dialog->>Query: invalidate/refetch documents
  Query-->>UI: updated documents list
  Dialog->>UI: clear deletingDoc -> close
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A hop, a click, a soft confirm,

Spinners twirl where demos turn,
Initials peek where faces hide,
Focus rings bloom, accessibility's pride,
Our burrow gleams—designs refined! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: color token consolidation, accessibility improvements, and UX enhancements across the homepage and document management features.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ui-design-improvements
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Mar 15, 2026

Copy link
Copy Markdown
Contributor

Verification: verify:self

Result: ✅ PASS in 98.4s

Lane Status Duration
sheet:build ✅ pass 13.7s
verify:fast ✅ pass 48.6s
frontend:build ✅ pass 14.1s
verify:frontend:chunks ✅ pass 0.3s
backend:build ✅ pass 4.6s
cli:build ✅ pass 1.8s
verify:entropy ✅ pass 15.2s

Verification: verify:integration

Result: ✅ PASS

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (2)
docs/tasks/active/20260315-ui-design-improvements-todo.md (1)

24-28: Consider adding a short “Verification” note before marking all items complete.

A brief section with validation status (and later archive status) will make task closure auditable.

Based on learnings, "Before marking a task done: (1) Update docs/design/ if architecture changed, (2) Run pnpm verify:fast and confirm pass, (3) Archive with pnpm tasks:archive && pnpm tasks:index."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/tasks/active/20260315-ui-design-improvements-todo.md` around lines 24 -
28, Add a short "Verification" subsection to the Phase 4 checklist that must be
completed before checking off all items: list the steps to (1) update
docs/design/ if any architecture changed (reference docs/design/), (2) run and
confirm passing of pnpm verify:fast, and (3) archive and reindex via pnpm
tasks:archive && pnpm tasks:index; ensure the verification note appears above
the completed checklist items and requires confirmation before marking the phase
complete.
packages/frontend/src/app/home/footer.tsx (1)

16-20: Set an explicit button type for the theme toggle.

Line [16] should declare type="button" to prevent accidental form submissions in reused layouts.

🔧 Suggested fix
           <button
+            type="button"
             onClick={toggleTheme}
             aria-label={`Switch to ${resolvedTheme === "dark" ? "light" : "dark"} mode`}
             className="relative bg-homepage-dark-card border-0 rounded-full w-11 h-6 cursor-pointer"
           >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/frontend/src/app/home/footer.tsx` around lines 16 - 20, The theme
toggle button lacks an explicit type, which can cause accidental form
submissions; update the JSX button element that uses onClick={toggleTheme} and
aria-label referencing resolvedTheme to include type="button" so the <button
...> in the component (where toggleTheme and resolvedTheme are used) will not
act as a submit button when placed inside forms.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/tasks/active/20260315-ui-design-improvements-todo.md`:
- Around line 1-28: The task file
docs/tasks/active/20260315-ui-design-improvements-todo.md is missing its
required paired lessons file; create
docs/tasks/active/20260315-ui-design-improvements-lessons.md containing a brief
summary of what was done, key implementation decisions (e.g., token
consolidation, ARIA/focus changes, AvatarFallback change), accessibility/UX
outcomes, unresolved/deferred items, links to related PRs/commits, and the
author/reviewer and date so future maintainers can trace why choices in
functions/components like AvatarFallback, site-header/footer updates, and
CTA/feature-card changes were made.

In `@packages/frontend/src/app/documents/document-list.tsx`:
- Around line 529-533: The delete success callback currently calls
setDeletingDoc(null) unconditionally and can clear a newly opened dialog if the
earlier delete resolves late; update the deleteDocumentMutation.mutate call (and
its callbacks) to only clear deletingDoc when the mutation's finished response
corresponds to the same doc id (compare the id passed to mutate with
deletingDoc?.id or capture the id in mutation variables/context), and add an
onError handler to surface failure feedback (e.g., show a toast or set an error
state) instead of silently failing; reference deletingDoc,
deleteDocumentMutation.mutate, setDeletingDoc, and the mutation callbacks when
implementing this fix.

In `@packages/frontend/src/app/home/features-section.tsx`:
- Line 46: The icon container currently has conflicting semantics (role="img"
with aria-hidden="true"); in the FeaturesSection component remove the role="img"
from the <div className="text-3xl mb-3">{f.icon}</div> if the icon is decorative
so it remains aria-hidden, otherwise if the icon conveys meaning keep role="img"
and add an accessible label (aria-label or aria-labelledby) derived from the
feature text (e.g., f.title or a generated id) to make the image discoverable to
screen readers.

In `@packages/frontend/src/components/nav-user.tsx`:
- Around line 26-33: getInitials can return an empty string for empty or
delimiter-only names; update the function (getInitials) to trim the input, split
on /[\s_-]+/, filter out empty tokens, and pick up to two token initials safely
(guarding token[0] exists). If that still yields nothing, fall back to taking
the first up to two non-whitespace characters from the original trimmed name (if
any), otherwise return a fixed placeholder like "?" so the avatar fallback is
never blank.

In `@packages/frontend/src/components/site-header.tsx`:
- Around line 69-81: The heading currently loses semantic role by assigning
role="button" and keyboard handlers directly on the <h1>; remove role, tabIndex
and onKeyDown from the heading and keep it purely semantic, then add a nested
<button> (or an adjacent inline <button>) that uses the same focus/hover classes
and calls setEditing(true) on click and Enter/Space, and set its aria-label to
`Rename "${title}"`; transfer the cursor/hover/focus styles and aria-label from
the heading to that button so editable, setEditing, title and the existing
onClick logic are preserved but applied to a real <button> element instead of
the <h1>.

---

Nitpick comments:
In `@docs/tasks/active/20260315-ui-design-improvements-todo.md`:
- Around line 24-28: Add a short "Verification" subsection to the Phase 4
checklist that must be completed before checking off all items: list the steps
to (1) update docs/design/ if any architecture changed (reference docs/design/),
(2) run and confirm passing of pnpm verify:fast, and (3) archive and reindex via
pnpm tasks:archive && pnpm tasks:index; ensure the verification note appears
above the completed checklist items and requires confirmation before marking the
phase complete.

In `@packages/frontend/src/app/home/footer.tsx`:
- Around line 16-20: The theme toggle button lacks an explicit type, which can
cause accidental form submissions; update the JSX button element that uses
onClick={toggleTheme} and aria-label referencing resolvedTheme to include
type="button" so the <button ...> in the component (where toggleTheme and
resolvedTheme are used) will not act as a submit button when placed inside
forms.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 91648159-300f-428c-b7d5-82535f830e1e

📥 Commits

Reviewing files that changed from the base of the PR and between 1177361 and a814400.

📒 Files selected for processing (13)
  • docs/tasks/active/20260315-ui-design-improvements-todo.md
  • packages/frontend/src/app/documents/document-list.tsx
  • packages/frontend/src/app/documents/page.tsx
  • packages/frontend/src/app/home/demo-section.tsx
  • packages/frontend/src/app/home/developer-section.tsx
  • packages/frontend/src/app/home/features-section.tsx
  • packages/frontend/src/app/home/footer.tsx
  • packages/frontend/src/app/home/hero-section.tsx
  • packages/frontend/src/app/home/nav-bar.tsx
  • packages/frontend/src/app/home/opensource-section.tsx
  • packages/frontend/src/components/nav-user.tsx
  • packages/frontend/src/components/site-header.tsx
  • packages/frontend/src/index.css

Comment on lines +1 to +28
# UI Design Improvements

## Phase 1: Color Token Consolidation
- [x] Add homepage dark-section tokens to index.css
- [x] Update footer.tsx to use design tokens
- [x] Update developer-section.tsx to use design tokens
- [x] Update opensource-section.tsx to use design tokens
- [x] Verify dark/light mode consistency

## Phase 2: Accessibility
- [x] Fix missing ARIA labels and roles (site-header, footer)
- [x] Fix focus states (outline-none → focus-visible ring)
- [x] Fix AvatarFallback hardcoded "CN" → user initials
- [x] Add hover/focus states to homepage CTA buttons

## Phase 3: Homepage Visual Polish
- [x] Add hover effects to feature cards
- [x] Add hover ring to developer code cards
- [x] Add hover to open-source badges and footer links
- [x] Make hero CTA buttons stack vertically on mobile
- [x] Unify max-width to 960px across sections
- [x] Add spinner to demo loading state

## Phase 4: UX Improvements
- [x] Add delete confirmation dialog for documents
- [x] Add error retry button on documents page
- [ ] ~~Loading skeleton~~ (already implemented)
- [ ] ~~Truncated text tooltips~~ (deferred — low impact)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
fd '20260315-ui-design-improvements-(todo|lessons)\.md' docs/tasks/active -t f | sort

Repository: wafflebase/wafflebase

Length of output: 122


Create the paired lessons file for this task.

The matching 20260315-ui-design-improvements-lessons.md file is missing. Per coding guidelines, non-trivial tasks must maintain paired task files in docs/tasks/active/ with both YYYYMMDD-<slug>-todo.md and YYYYMMDD-<slug>-lessons.md files.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/tasks/active/20260315-ui-design-improvements-todo.md` around lines 1 -
28, The task file docs/tasks/active/20260315-ui-design-improvements-todo.md is
missing its required paired lessons file; create
docs/tasks/active/20260315-ui-design-improvements-lessons.md containing a brief
summary of what was done, key implementation decisions (e.g., token
consolidation, ARIA/focus changes, AvatarFallback change), accessibility/UX
outcomes, unresolved/deferred items, links to related PRs/commits, and the
author/reviewer and date so future maintainers can trace why choices in
functions/components like AvatarFallback, site-header/footer updates, and
CTA/feature-card changes were made.

Comment on lines +529 to +533
onClick={() => {
if (deletingDoc) {
deleteDocumentMutation.mutate(deletingDoc.id, {
onSuccess: () => setDeletingDoc(null),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Prevent stale delete callbacks from clearing a newer dialog state.

If a delete request resolves after the user has reopened the dialog for another doc, the old success callback can still call setDeletingDoc(null) and close the current dialog unexpectedly. Also, this path has no failure feedback.

Suggested safe callback handling + error feedback
             <Button
               variant="destructive"
               disabled={deleteDocumentMutation.isPending}
               onClick={() => {
                 if (deletingDoc) {
+                  const deletingId = deletingDoc.id;
                   deleteDocumentMutation.mutate(deletingDoc.id, {
-                    onSuccess: () => setDeletingDoc(null),
+                    onSuccess: () =>
+                      setDeletingDoc((current) =>
+                        current?.id === deletingId ? null : current,
+                      ),
+                    onError: () => {
+                      toast.error("Failed to delete document");
+                    },
                   });
                 }
               }}
             >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/frontend/src/app/documents/document-list.tsx` around lines 529 -
533, The delete success callback currently calls setDeletingDoc(null)
unconditionally and can clear a newly opened dialog if the earlier delete
resolves late; update the deleteDocumentMutation.mutate call (and its callbacks)
to only clear deletingDoc when the mutation's finished response corresponds to
the same doc id (compare the id passed to mutate with deletingDoc?.id or capture
the id in mutation variables/context), and add an onError handler to surface
failure feedback (e.g., show a toast or set an error state) instead of silently
failing; reference deletingDoc, deleteDocumentMutation.mutate, setDeletingDoc,
and the mutation callbacks when implementing this fix.

<div key={f.title} className="bg-homepage-bg border border-homepage-accent/30 rounded-xl p-7">
<div className="text-3xl mb-3">{f.icon}</div>
<div key={f.title} className="bg-homepage-bg border border-homepage-accent/30 rounded-xl p-6 hover:border-homepage-accent/60 hover:shadow-md transition-all duration-200">
<div className="text-3xl mb-3" role="img" aria-hidden="true">{f.icon}</div>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove conflicting accessibility semantics on the icon container.

Line [46] sets role="img" and aria-hidden="true" together. If decorative, keep aria-hidden and drop role; if meaningful, keep role="img" and add an accessible label.

♿ Suggested fix (decorative icon)
-            <div className="text-3xl mb-3" role="img" aria-hidden="true">{f.icon}</div>
+            <div className="text-3xl mb-3" aria-hidden="true">{f.icon}</div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="text-3xl mb-3" role="img" aria-hidden="true">{f.icon}</div>
<div className="text-3xl mb-3" aria-hidden="true">{f.icon}</div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/frontend/src/app/home/features-section.tsx` at line 46, The icon
container currently has conflicting semantics (role="img" with
aria-hidden="true"); in the FeaturesSection component remove the role="img" from
the <div className="text-3xl mb-3">{f.icon}</div> if the icon is decorative so
it remains aria-hidden, otherwise if the icon conveys meaning keep role="img"
and add an accessible label (aria-label or aria-labelledby) derived from the
feature text (e.g., f.title or a generated id) to make the image discoverable to
screen readers.

Comment on lines +26 to +33
function getInitials(name: string): string {
return name
.split(/[\s_-]+/)
.slice(0, 2)
.map((w) => w[0])
.join("")
.toUpperCase();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Handle empty/whitespace usernames in getInitials.

Right now an empty or delimiter-only username yields an empty fallback. Provide a safe default so avatar fallback is never blank.

Suggested hardening
 function getInitials(name: string): string {
-  return name
-    .split(/[\s_-]+/)
+  return (
+    name
+      .trim()
+      .split(/[\s_-]+/)
+      .filter(Boolean)
     .slice(0, 2)
     .map((w) => w[0])
     .join("")
-    .toUpperCase();
+      .toUpperCase() || "U"
+  );
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function getInitials(name: string): string {
return name
.split(/[\s_-]+/)
.slice(0, 2)
.map((w) => w[0])
.join("")
.toUpperCase();
}
function getInitials(name: string): string {
return (
name
.trim()
.split(/[\s_-]+/)
.filter(Boolean)
.slice(0, 2)
.map((w) => w[0])
.join("")
.toUpperCase() || "U"
);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/frontend/src/components/nav-user.tsx` around lines 26 - 33,
getInitials can return an empty string for empty or delimiter-only names; update
the function (getInitials) to trim the input, split on /[\s_-]+/, filter out
empty tokens, and pick up to two token initials safely (guarding token[0]
exists). If that still yields nothing, fall back to taking the first up to two
non-whitespace characters from the original trimmed name (if any), otherwise
return a fixed placeholder like "?" so the avatar fallback is never blank.

Comment on lines +69 to +81
className={`text-base font-medium ${editable ? "cursor-pointer hover:bg-muted/50 px-1 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : ""}`}
onClick={() => {
if (editable) setEditing(true);
}}
title={editable ? "Click to rename" : undefined}
onKeyDown={(e) => {
if (editable && (e.key === "Enter" || e.key === " ")) {
e.preventDefault();
setEditing(true);
}
}}
role={editable ? "button" : undefined}
tabIndex={editable ? 0 : undefined}
aria-label={editable ? `Rename "${title}"` : undefined}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n packages/frontend/src/components/site-header.tsx | sed -n '60,90p'

Repository: wafflebase/wafflebase

Length of output: 1465


🏁 Script executed:

wc -l packages/frontend/src/components/site-header.tsx

Repository: wafflebase/wafflebase

Length of output: 116


🏁 Script executed:

rg -i "role.*button.*h[1-6]|h[1-6].*role.*button" packages/frontend/src --type tsx --type ts -A 2 -B 2

Repository: wafflebase/wafflebase

Length of output: 92


🏁 Script executed:

rg "editable.*heading|editable.*title" packages/frontend/src --type tsx --type ts -i

Repository: wafflebase/wafflebase

Length of output: 92


🏁 Script executed:

fd -e tsx -e ts packages/frontend/src -x grep -l "button" {} \; | head -10 | xargs rg "type=\"button\"" -A 3

Repository: wafflebase/wafflebase

Length of output: 19753


🏁 Script executed:

rg "setEditing|setEditing\(" packages/frontend/src -B 5 -A 5 | head -100

Repository: wafflebase/wafflebase

Length of output: 7517


🏁 Script executed:

rg "role.*button" packages/frontend/src --max-count=5 -B 2 -A 2

Repository: wafflebase/wafflebase

Length of output: 517


Preserve heading semantics; avoid role="button" on <h1>.

Line 79 assigns role="button" to the heading, which removes heading semantics for screen readers and other assistive technologies. Keep <h1> as a semantic heading and use a nested <button> for edit interactions instead. This also aligns with the codebase pattern of using real button elements throughout.

♿ Suggested semantic fix
-            <h1
-              className={`text-base font-medium ${editable ? "cursor-pointer hover:bg-muted/50 px-1 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : ""}`}
-              onClick={() => {
-                if (editable) setEditing(true);
-              }}
-              onKeyDown={(e) => {
-                if (editable && (e.key === "Enter" || e.key === " ")) {
-                  e.preventDefault();
-                  setEditing(true);
-                }
-              }}
-              role={editable ? "button" : undefined}
-              tabIndex={editable ? 0 : undefined}
-              aria-label={editable ? `Rename "${title}"` : undefined}
-            >
-              {title}
-            </h1>
+            <h1 className="text-base font-medium">
+              {editable ? (
+                <button
+                  type="button"
+                  className="cursor-pointer hover:bg-muted/50 px-1 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring text-left"
+                  onClick={() => setEditing(true)}
+                  aria-label={`Rename "${title}"`}
+                >
+                  {title}
+                </button>
+              ) : (
+                title
+              )}
+            </h1>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
className={`text-base font-medium ${editable ? "cursor-pointer hover:bg-muted/50 px-1 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" : ""}`}
onClick={() => {
if (editable) setEditing(true);
}}
title={editable ? "Click to rename" : undefined}
onKeyDown={(e) => {
if (editable && (e.key === "Enter" || e.key === " ")) {
e.preventDefault();
setEditing(true);
}
}}
role={editable ? "button" : undefined}
tabIndex={editable ? 0 : undefined}
aria-label={editable ? `Rename "${title}"` : undefined}
<h1 className="text-base font-medium">
{editable ? (
<button
type="button"
className="cursor-pointer hover:bg-muted/50 px-1 rounded transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring text-left"
onClick={() => setEditing(true)}
aria-label={`Rename "${title}"`}
>
{title}
</button>
) : (
title
)}
</h1>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/frontend/src/components/site-header.tsx` around lines 69 - 81, The
heading currently loses semantic role by assigning role="button" and keyboard
handlers directly on the <h1>; remove role, tabIndex and onKeyDown from the
heading and keep it purely semantic, then add a nested <button> (or an adjacent
inline <button>) that uses the same focus/hover classes and calls
setEditing(true) on click and Enter/Space, and set its aria-label to `Rename
"${title}"`; transfer the cursor/hover/focus styles and aria-label from the
heading to that button so editable, setEditing, title and the existing onClick
logic are preserved but applied to a real <button> element instead of the <h1>.

- Consolidate hardcoded homepage colors (stone-*, amber-*) into
  CSS variable design tokens for centralized theme management
- Improve accessibility: ARIA attributes on editable title,
  focus-visible rings, keyboard support, dynamic avatar initials
- Add hover/focus effects to homepage cards, buttons, badges,
  code blocks, and footer links
- Make hero CTA buttons stack vertically on mobile screens
- Add delete confirmation dialog to prevent accidental deletion
- Add retry button to document list error state
- Add loading spinner to demo section

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@hackerwins
hackerwins force-pushed the ui-design-improvements branch from a814400 to b88f4ab Compare March 15, 2026 08:13
@hackerwins
hackerwins merged commit 0391eb1 into main Mar 15, 2026
1 check passed
@hackerwins
hackerwins deleted the ui-design-improvements branch March 15, 2026 08:14
hackerwins added a commit that referenced this pull request Mar 15, 2026
Move cli and cli-oauth-login task files to archive after completion
in recent PRs (#34, #35). Update task index accordingly.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant