Skip to content

feat(admin): clickable rows, email column, category badge, kanban default#19

Merged
anshayea merged 1 commit intomainfrom
claude/improve-email-card-design-eEauI
Apr 27, 2026
Merged

feat(admin): clickable rows, email column, category badge, kanban default#19
anshayea merged 1 commit intomainfrom
claude/improve-email-card-design-eEauI

Conversation

@anshayea
Copy link
Copy Markdown
Contributor

@anshayea anshayea commented Apr 27, 2026

Summary

Addresses four UX gaps on the /admin submissions list:

  • Email had no header: previously stacked under the name with dir="ltr", which made it look like an orphan column. Now it gets a dedicated البريد column.
  • Category was hard to scan: introduced CategoryBadge with a deterministic per-key color (8-color palette hashed from the category key, since form_categories has no color column). Used in both the table and the kanban card.
  • Only the reference link was clickable in the table: the entire row is now clickable (router push), with the checkbox cell isolated via stopPropagation so multi-select still works.
  • Default view was table: kanban (لوحة) is now the default. Switching to table sets ?view=table; switching back to kanban clears it.

Changes

  • src/app/admin/page.tsx — flip default view to kanban
  • src/components/admin/ViewToggle.tsx — mirror the default change in the URL writer
  • src/components/admin/CategoryBadge.tsx (new) — colored pill keyed off category.key
  • src/components/admin/SubmissionsTable.tsx — split name/email into two columns, add البريد header, clickable <tr>, use CategoryBadge, bump min-w to 900px
  • src/components/admin/KanbanBoard.tsx — use CategoryBadge on the card

Test plan

  • /admin loads with the kanban board by default
  • Clicking جدول switches to the table and stays there on refresh (?view=table); clicking بطاقات returns to kanban with no view param
  • Table shows a البريد column with the email rendered LTR; the previous "floating email" is gone
  • Categories render as colored badges, with the same color reused for the same category across rows and across the table/kanban views
  • Clicking anywhere on a table row navigates to /admin/submissions/[id]
  • Clicking the row checkbox toggles selection without navigating; bulk-archive still works
  • Kanban cards still navigate on click and still drag-drop between status columns

https://claude.ai/code/session_01YRQjMxioKWrxdBq5TGhraG


Generated by Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added email column to submissions table for improved contact visibility.
    • Submissions table now supports row-level navigation—click any row to view details.
    • Category information now displays as styled badges across both views for enhanced visual organization.
  • Updates

    • Default admin view switched to Kanban board.

…an default

- Make kanban (board) the default admin view; '?view=table' opts back into table
- Add a dedicated البريد column to the submissions table so the email no longer floats below the name without a header
- Introduce CategoryBadge with a deterministic per-key color and use it in both the table and kanban card
- Make entire table rows clickable to open the submission, while keeping the row checkbox isolated

https://claude.ai/code/session_01YRQjMxioKWrxdBq5TGhraG
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crm Ready Ready Preview, Comment Apr 27, 2026 8:35am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fab05a90-7ac0-4d9c-bd03-72f4b79bbe44

📥 Commits

Reviewing files that changed from the base of the PR and between cd8cab3 and ebf8f96.

📒 Files selected for processing (5)
  • src/app/admin/page.tsx
  • src/components/admin/CategoryBadge.tsx
  • src/components/admin/KanbanBoard.tsx
  • src/components/admin/SubmissionsTable.tsx
  • src/components/admin/ViewToggle.tsx

📝 Walkthrough

Walkthrough

This PR introduces a new CategoryBadge component for consistent category display across the admin interface, changes the default admin view from table to kanban, refactors SubmissionsTable to use row-level navigation instead of cell-level links, and inverts the view toggle logic to make kanban the default state.

Changes

Cohort / File(s) Summary
View Selection & Toggle Logic
src/app/admin/page.tsx, src/components/admin/ViewToggle.tsx
Changed default admin view from 'table' to 'kanban'. Inverted toggle logic so 'kanban' is now the default when view param is absent, and only explicitly passing 'table' selects table view.
Category Badge System
src/components/admin/CategoryBadge.tsx, src/components/admin/KanbanBoard.tsx, src/components/admin/SubmissionsTable.tsx
Added new CategoryBadge component that derives color deterministically from category key via hash modulo. Updated KanbanBoard and SubmissionsTable to render categories using the badge component instead of plain text.
Submissions Table Navigation Refactor
src/components/admin/SubmissionsTable.tsx
Replaced per-cell Link-based navigation with row-level useRouter().push navigation. Added cursor-pointer styling and onClick handlers to table rows while preventing propagation on checkbox cells. Updated column structure with new "البريد" column and adjusted styling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A new badge hops into sight,
With colors derived just right,
Kanban boards bounce and play,
Navigation flows the rabbit way,
Categories wear their finest dress! 🎨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/improve-email-card-design-eEauI

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.

@anshayea anshayea marked this pull request as ready for review April 27, 2026 12:03
@anshayea anshayea merged commit 19c1909 into main Apr 27, 2026
6 checks passed
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.

2 participants