Skip to content

Center table Actions as icon buttons with tooltips - #17

Merged
rqms40 merged 1 commit into
mainfrom
fm/gridgo-web-table-actions
Aug 13, 2026
Merged

rqms40 merged 1 commit into
mainfrom
fm/gridgo-web-table-actions

Conversation

@rqms40

@rqms40 rqms40 commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

Dense queues were a right-aligned column of full “Suspend” / “Make live” / “Restore” outline buttons. Actions are now centered icon buttons with the old verb as the accessible name and tooltip.

What changed

  • DataTable Actions header and cells are text-center (sticky right column stays).
  • New DataTableRowAction: Button size="icon" + lucide icon + shadcn Tooltip. Destructive stays variant="danger" (outlined icon, not a red text pill).
  • Every rowActions={ call site uses the helper. Confirm dialogs are unchanged — the icon opens the same confirm.
  • Mobile cards show the verb next to the icon so a tight card is never a mystery glyph.

What I cut

The repeated full-width text outline buttons in every queue row. They were the same verb twice (header + cell) and turned dense tables into a second button column.

Verify

  • npm run typecheck, lint, test, build clean.
  • Browser (own port 3011): Super Admin → Accreditation → Service lines. Icon cluster is centered under Actions; hover/focus shows “Suspend” / “Make live”; Suspend still opens the existing confirm. Light and dark.

Summary by CodeRabbit

  • New Features

    • Added consistent row actions across admin, operations, and supplier tables.
    • Desktop tables now show compact icon actions with tooltips, while mobile displays visible action labels.
    • Added accessible labels, pressed states, disabled states, links, and danger styling for row actions.
    • Centered table action columns for improved alignment.
  • Tests

    • Expanded coverage for row-action accessibility, responsive rendering, tooltips, and styling.

Dense queues were a right-aligned stack of full “Suspend” / “Make live”
outline buttons. DataTable now centers the Actions column and call sites
use DataTableRowAction: a 44×44 icon, the old verb as aria-label and
tooltip, danger still an outlined icon rather than a red text pill.
Mobile cards keep the verb visible so the control is never a mystery glyph.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds responsive DataTableRowAction controls with accessible labels, tooltips, icons, links, and state support. Admin, operations, and supplier tables replace secondary buttons and links while preserving existing handlers and state transitions.

Changes

Shared row-action foundation

Layer / File(s) Summary
Row-action contract and rendering
src/components/ui/data-table.tsx, src/components/ui/__tests__/data-table.test.tsx, AGENTS.md
Adds DataTableRowAction with responsive labels, tooltips, icons, links, variants, disabled state, click handlers, and pressed state. Centers action columns. Adds tests and usage guidance.

Admin table action migration

Layer / File(s) Summary
Admin row actions
src/app/admin/catalogue/page.tsx, src/app/admin/roles/page.tsx, src/app/admin/verification/page.tsx, src/app/admin/zones/page.tsx
Replaces edit, role, and service-state buttons with icon-based DataTableRowAction controls. Existing callbacks, confirmation flow, and state behavior remain unchanged.

Operations table action migration

Layer / File(s) Summary
Operations row actions
src/app/ops/claims/page.tsx, src/app/ops/dispatch/page.tsx, src/app/ops/matching/page.tsx, src/app/ops/payments/page.tsx, src/app/ops/qa/page.tsx, src/app/ops/recovery/page.tsx
Migrates claim, dispatch, matching, payment, QA, and recovery controls to DataTableRowAction. Page-specific conditions, destinations, handlers, and selection state remain in place.

Supplier table action migration

Layer / File(s) Summary
Supplier row actions
src/app/supplier/capacity/page.tsx, src/app/supplier/catalogue/page.tsx, src/app/supplier/jobs/page.tsx
Migrates job navigation and catalogue actions to icon-based row actions. Existing links, handlers, disabled states, and withdrawal flow remain intact.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: 🔵 Low · up to 250a3

The PR replaces table text actions with centered icon buttons while preserving accessible names, tooltips, and existing confirmations. The destructive Hold payout action lacks the matching danger styling, which may reduce warning clarity; the change is otherwise mergeable with explicit owner follow-up.

Possibly related PRs

  • rqms40/gridgo-web#4: Modifies the same Operations page components, including claims, dispatch, matching, and recovery.
  • rqms40/gridgo-web#8: Modifies overlapping roles, verification, claims, and supplier catalogue row controls.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change: centering table Actions and replacing text buttons with icon buttons that use tooltips.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fm/gridgo-web-table-actions

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

@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: 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 `@src/app/ops/claims/page.tsx`:
- Around line 332-336: Update the Hold payout DataTableRowAction in the claims
page to include variant="danger", matching the confirmation action’s destructive
styling while preserving its existing label, icon, and onClick behavior.
🪄 Autofix

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: 139dbce4-b4f9-4b38-b8b7-80664ddb830e

📥 Commits

Reviewing files that changed from the base of the PR and between 37cc6a6 and 250a382.

📒 Files selected for processing (16)
  • AGENTS.md
  • src/app/admin/catalogue/page.tsx
  • src/app/admin/roles/page.tsx
  • src/app/admin/verification/page.tsx
  • src/app/admin/zones/page.tsx
  • src/app/ops/claims/page.tsx
  • src/app/ops/dispatch/page.tsx
  • src/app/ops/matching/page.tsx
  • src/app/ops/payments/page.tsx
  • src/app/ops/qa/page.tsx
  • src/app/ops/recovery/page.tsx
  • src/app/supplier/capacity/page.tsx
  • src/app/supplier/catalogue/page.tsx
  • src/app/supplier/jobs/page.tsx
  • src/components/ui/__tests__/data-table.test.tsx
  • src/components/ui/data-table.tsx

Comment on lines +332 to +336
<DataTableRowAction
label="Hold payout"
icon={CirclePause}
onClick={() => openDialog({ type: "hold", claim: c })}
>
Hold payout
</Button>
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Retain destructive styling for Hold payout.

Hold payout blocks supplier payment. The confirmation action already uses variant="danger". Set the row action to variant="danger" too.

Proposed fix
 <DataTableRowAction
   label="Hold payout"
   icon={CirclePause}
+  variant="danger"
   onClick={() => openDialog({ type: "hold", claim: c })}
 />
📝 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
<DataTableRowAction
label="Hold payout"
icon={CirclePause}
onClick={() => openDialog({ type: "hold", claim: c })}
>
Hold payout
</Button>
/>
<DataTableRowAction
label="Hold payout"
icon={CirclePause}
variant="danger"
onClick={() => openDialog({ type: "hold", claim: c })}
/>
🤖 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 `@src/app/ops/claims/page.tsx` around lines 332 - 336, Update the Hold payout
DataTableRowAction in the claims page to include variant="danger", matching the
confirmation action’s destructive styling while preserving its existing label,
icon, and onClick behavior.

@rqms40
rqms40 merged commit 6fdbf2e into main Aug 13, 2026
7 checks passed
@rqms40
rqms40 deleted the fm/gridgo-web-table-actions branch August 13, 2026 03:19
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