[PR #1135] [MERGED] fix: dialog close on refresh #1419

Closed
opened 2026-02-26 19:33:10 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1135
Author: @dguyen
Created: 5/1/2024
Status: Merged
Merged: 8/27/2024
Merged by: @Mythie

Base: mainHead: fix/prevent-dialog-close-on-refresh


📝 Commits (5)

📊 Changes

19 files changed (+1057 additions, -966 deletions)

View changed files

📝 apps/web/src/app/(dashboard)/admin/documents/[id]/recipient-item.tsx (+48 -44)
📝 apps/web/src/app/(dashboard)/admin/documents/document-results.tsx (+84 -72)
📝 apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx (+60 -55)
📝 apps/web/src/app/(dashboard)/documents/[id]/logs/document-logs-data-table.tsx (+62 -55)
📝 apps/web/src/app/(dashboard)/documents/data-table.tsx (+54 -49)
📝 apps/web/src/app/(dashboard)/settings/security/activity/user-security-activity-data-table.tsx (+55 -48)
📝 apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table.tsx (+37 -30)
📝 apps/web/src/app/(dashboard)/templates/data-table-templates.tsx (+113 -108)
📝 apps/web/src/components/(teams)/tables/current-user-teams-data-table.tsx (+69 -62)
📝 apps/web/src/components/(teams)/tables/pending-user-teams-data-table.tsx (+37 -32)
📝 apps/web/src/components/(teams)/tables/team-billing-invoices-data-table.tsx (+71 -64)
📝 apps/web/src/components/(teams)/tables/team-member-invites-data-table.tsx (+73 -66)
📝 apps/web/src/components/(teams)/tables/team-members-data-table.tsx (+99 -92)
📝 packages/app-tests/e2e/teams/team-members.spec.ts (+5 -1)
📝 packages/lib/translations/de/common.po (+3 -3)
📝 packages/lib/translations/de/web.po (+91 -91)
📝 packages/lib/translations/en/common.po (+3 -3)
📝 packages/lib/translations/en/web.po (+91 -91)
📝 packages/ui/primitives/data-table.tsx (+2 -0)

📄 Description

Description

This is an example demo of the issue, looking for suggestions and discussions.

Currently any open dialogs nested into a table column will close when the page is focused due to us running router.refresh() whenever onFocus callback is triggered.

This appears to be caused by the columns prop getting replaced, which causes the columns to get rerendered.

There are a few ways to go about this, this commit is a dirty example which prevents this from happening.

Another option is to add a stableColumn prop, which we then assume never change so we use the initial value only.

Summary by CodeRabbit

  • New Features

    • Enhanced data tables across various components with optimized column definitions using useMemo, improving performance and maintainability.
    • Added tooltips for template types in the TemplatesDataTable for better user experience.
  • Bug Fixes

    • Ensured consistent data structure in AdminDocumentResults even when no documents are found.
  • Documentation

    • Updated type definitions for data table columns to improve clarity and type safety.
  • Chores

    • Minor updates to line references in translation files for improved localization accuracy.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1135 **Author:** [@dguyen](https://github.com/dguyen) **Created:** 5/1/2024 **Status:** ✅ Merged **Merged:** 8/27/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `fix/prevent-dialog-close-on-refresh` --- ### 📝 Commits (5) - [`b09a572`](https://github.com/documenso/documenso/commit/b09a5723109c76446243075fcce0ef23dd630240) fix: demo - [`8d98753`](https://github.com/documenso/documenso/commit/8d987532069311a7419147c842acebc8e80216df) chore: extract translations - [`c0394c3`](https://github.com/documenso/documenso/commit/c0394c311eb5f0154d39320b40f3270d1e122dbd) fix: stabilise columns - [`8dfd1e9`](https://github.com/documenso/documenso/commit/8dfd1e9bbb03c4f47d0e14d57fd2ecd29345d1f8) chore: update failing test - [`6943a21`](https://github.com/documenso/documenso/commit/6943a21694eef80adc68a910ef1dcc4fc34c8db6) chore: update translations ### 📊 Changes **19 files changed** (+1057 additions, -966 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/app/(dashboard)/admin/documents/[id]/recipient-item.tsx` (+48 -44) 📝 `apps/web/src/app/(dashboard)/admin/documents/document-results.tsx` (+84 -72) 📝 `apps/web/src/app/(dashboard)/admin/users/data-table-users.tsx` (+60 -55) 📝 `apps/web/src/app/(dashboard)/documents/[id]/logs/document-logs-data-table.tsx` (+62 -55) 📝 `apps/web/src/app/(dashboard)/documents/data-table.tsx` (+54 -49) 📝 `apps/web/src/app/(dashboard)/settings/security/activity/user-security-activity-data-table.tsx` (+55 -48) 📝 `apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table.tsx` (+37 -30) 📝 `apps/web/src/app/(dashboard)/templates/data-table-templates.tsx` (+113 -108) 📝 `apps/web/src/components/(teams)/tables/current-user-teams-data-table.tsx` (+69 -62) 📝 `apps/web/src/components/(teams)/tables/pending-user-teams-data-table.tsx` (+37 -32) 📝 `apps/web/src/components/(teams)/tables/team-billing-invoices-data-table.tsx` (+71 -64) 📝 `apps/web/src/components/(teams)/tables/team-member-invites-data-table.tsx` (+73 -66) 📝 `apps/web/src/components/(teams)/tables/team-members-data-table.tsx` (+99 -92) 📝 `packages/app-tests/e2e/teams/team-members.spec.ts` (+5 -1) 📝 `packages/lib/translations/de/common.po` (+3 -3) 📝 `packages/lib/translations/de/web.po` (+91 -91) 📝 `packages/lib/translations/en/common.po` (+3 -3) 📝 `packages/lib/translations/en/web.po` (+91 -91) 📝 `packages/ui/primitives/data-table.tsx` (+2 -0) </details> ### 📄 Description ## Description This is an example demo of the issue, looking for suggestions and discussions. Currently any open dialogs nested into a table column will close when the page is focused due to us running `router.refresh()` whenever `onFocus` callback is triggered. This appears to be caused by the columns prop getting replaced, which causes the columns to get rerendered. There are a few ways to go about this, this commit is a dirty example which prevents this from happening. Another option is to add a stableColumn prop, which we then assume never change so we use the initial value only. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced data tables across various components with optimized column definitions using `useMemo`, improving performance and maintainability. - Added tooltips for template types in the `TemplatesDataTable` for better user experience. - **Bug Fixes** - Ensured consistent data structure in `AdminDocumentResults` even when no documents are found. - **Documentation** - Updated type definitions for data table columns to improve clarity and type safety. - **Chores** - Minor updates to line references in translation files for improved localization accuracy. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:10 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1419
No description provided.