Skip to content

feat(platform): entity count footer and delete dialog fix#829

Merged
Israeltheminer merged 2 commits into
mainfrom
feat/entity-count-footer-and-delete-dialog-fix
Mar 21, 2026
Merged

feat(platform): entity count footer and delete dialog fix#829
Israeltheminer merged 2 commits into
mainfrom
feat/entity-count-footer-and-delete-dialog-fix

Conversation

@Israeltheminer
Copy link
Copy Markdown
Collaborator

@Israeltheminer Israeltheminer commented Mar 21, 2026

Summary

  • Add sticky "Showing all X {entity}" footer to entity data tables (websites, products, customers, vendors) that displays total counts as data loads
  • Show "Showing X of Y {entity}" when filters reduce the visible count
  • Fix document delete dialog long filename overflow with middle truncation and hover tooltip

Test plan

  • Navigate to websites/products/customers/vendors pages — verify sticky count footer is visible at bottom
  • Apply filters on entity pages — verify footer shows filtered vs total count
  • Check documents page — verify it still shows "No more items to load" (no entity footer)
  • Open delete dialog for a document with a long filename — verify truncation and tooltip

Summary by CodeRabbit

  • New Features

    • Data tables now display entity count footer showing filtered and total item counts.
    • Enhanced pagination messages distinguishing between "showing all" and filtered views.
  • Improvements

    • Long entity names in confirmation dialogs are now truncated with ellipsis for improved readability.

… dialog overflow

Add sticky "Showing all X {entity}" footer to entity tables (websites,
products, customers, vendors) so users can see total counts at a glance.
The footer updates live as data loads and shows filtered counts when
filters are active.

Also fix the document delete dialog where long filenames overflow the
dialog by middle-truncating names over 38 characters with a tooltip
showing the full name on hover.
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 21, 2026

📝 Walkthrough

Walkthrough

This PR extends the data table infinite scroll functionality to support entity labels and total counts. Multiple table components (customers, products, vendors, websites) are updated to pass an entityLabel derived from localized titles to the useListPage hook. The hook is modified to pass-through the entityLabel and conditionally set totalCount to the data length. A new sticky footer is added to the data table that displays filtered count or "showing all" messages when an entityLabel is provided. Additionally, the document delete dialog truncates long display names with ellipsis. Two new i18n messages are added for pagination display states.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: adding an entity count footer to data tables and fixing the delete dialog display issue.

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

✨ 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 feat/entity-count-footer-and-delete-dialog-fix

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@services/platform/app/features/documents/components/document-delete-dialog.tsx`:
- Around line 43-45: The title prop is being set unconditionally on the filename
anchor so short names get useless tooltips; update the JSX in
document-delete-dialog's rendering of the filename (the element that currently
uses <strong title={displayName}>{truncatedName}</strong>) to only set title
when the name is actually truncated (i.e., when index < parts.length - 1 or an
explicit isTruncated condition). In practice, compute a boolean like isTruncated
= index < parts.length - 1 (or reuse an existing truncated check) and change the
title to be conditional (title={isTruncated ? displayName : undefined}) so
tooltips only appear for truncated names.

In `@services/platform/app/hooks/use-list-page.ts`:
- Around line 331-333: Add a brief clarifying comment near the object returning
entityLabel and totalCount in use-list-page (where totalCount is set to
rawData.length) explaining that totalCount reflects the server-side/unfiltered
result set as returned from the backend (and therefore already includes
server-side filters like status/source/locale from URL params) while client-side
search may reduce the visible row count; reference the variables rawData and
totalCount and mention that client-side filtering is applied separately so
"Showing X of Y" displays X as the post-search visible count and Y as
rawData.length.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 119dec87-547c-4ab1-880d-869ab97c055d

📥 Commits

Reviewing files that changed from the base of the PR and between 7b282f1 and 8d30490.

⛔ Files ignored due to path filters (2)
  • services/platform/convex/_generated/api.d.ts is excluded by !**/_generated/**
  • services/platform/convex/betterAuth/_generated/component.ts is excluded by !**/_generated/**
📒 Files selected for processing (8)
  • services/platform/app/components/ui/data-table/data-table.tsx
  • services/platform/app/features/customers/components/customers-table.tsx
  • services/platform/app/features/documents/components/document-delete-dialog.tsx
  • services/platform/app/features/products/components/products-table.tsx
  • services/platform/app/features/vendors/components/vendors-table.tsx
  • services/platform/app/features/websites/components/websites-table.tsx
  • services/platform/app/hooks/use-list-page.ts
  • services/platform/messages/en.json

Comment on lines +43 to +45
{index < parts.length - 1 && (
<strong title={displayName}>{truncatedName}</strong>
)}
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

Show tooltip only when the filename is actually truncated.

Line 44 sets title unconditionally, so short names get redundant tooltips too. Gate it to truncated cases only.

✂️ Proposed fix
-            {index < parts.length - 1 && (
-              <strong title={displayName}>{truncatedName}</strong>
-            )}
+            {index < parts.length - 1 && (
+              <strong title={truncatedName !== displayName ? displayName : undefined}>
+                {truncatedName}
+              </strong>
+            )}
📝 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
{index < parts.length - 1 && (
<strong title={displayName}>{truncatedName}</strong>
)}
{index < parts.length - 1 && (
<strong title={truncatedName !== displayName ? displayName : undefined}>
{truncatedName}
</strong>
)}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@services/platform/app/features/documents/components/document-delete-dialog.tsx`
around lines 43 - 45, The title prop is being set unconditionally on the
filename anchor so short names get useless tooltips; update the JSX in
document-delete-dialog's rendering of the filename (the element that currently
uses <strong title={displayName}>{truncatedName}</strong>) to only set title
when the name is actually truncated (i.e., when index < parts.length - 1 or an
explicit isTruncated condition). In practice, compute a boolean like isTruncated
= index < parts.length - 1 (or reuse an existing truncated check) and change the
title to be conditional (title={isTruncated ? displayName : undefined}) so
tooltips only appear for truncated names.

Comment on lines +331 to 333
entityLabel,
totalCount: entityLabel ? rawData.length : 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.

🧹 Nitpick | 🔵 Trivial

Clarify the totalCount semantics for filtered vs unfiltered counts.

The current implementation sets totalCount to rawData.length, which represents all items loaded from the backend (before client-side search filtering). This means:

  • The "Showing X of Y" message appears when client-side search reduces the visible count
  • Server-side filters (status, source, locale via URL params) are already reflected in rawData, so those won't show as "filtered"

This behavior seems intentional for distinguishing client-side search from server-side filtering, but consider adding a brief comment to clarify this distinction for future maintainers.

📝 Suggested clarifying comment
         entityLabel,
+        // totalCount reflects items loaded from backend (post server-side filter),
+        // enabling "Showing X of Y" when client-side search further reduces the set
         totalCount: entityLabel ? rawData.length : undefined,
📝 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
entityLabel,
totalCount: entityLabel ? rawData.length : undefined,
},
entityLabel,
// totalCount reflects items loaded from backend (post server-side filter),
// enabling "Showing X of Y" when client-side search further reduces the set
totalCount: entityLabel ? rawData.length : undefined,
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@services/platform/app/hooks/use-list-page.ts` around lines 331 - 333, Add a
brief clarifying comment near the object returning entityLabel and totalCount in
use-list-page (where totalCount is set to rawData.length) explaining that
totalCount reflects the server-side/unfiltered result set as returned from the
backend (and therefore already includes server-side filters like
status/source/locale from URL params) while client-side search may reduce the
visible row count; reference the variables rawData and totalCount and mention
that client-side filtering is applied separately so "Showing X of Y" displays X
as the post-search visible count and Y as rawData.length.

Only show title tooltip on truncated filenames and add clarifying
comment for totalCount semantics.
@Israeltheminer Israeltheminer merged commit 96bc45d into main Mar 21, 2026
17 checks passed
@Israeltheminer Israeltheminer deleted the feat/entity-count-footer-and-delete-dialog-fix branch March 21, 2026 11:36
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