Skip to content

fix: pagination reset after saving a group - #79

Draft
BIA3IA wants to merge 2 commits into
mainfrom
bianca/fix_tables
Draft

fix: pagination reset after saving a group#79
BIA3IA wants to merge 2 commits into
mainfrom
bianca/fix_tables

Conversation

@BIA3IA

@BIA3IA BIA3IA commented Sep 10, 2026

Copy link
Copy Markdown
Contributor
  • Fixes Groups table pagination resets after saving #78: saving a group (editing labels, visibility, or WhatsApp group data) no longer resets the table back to page 1. router.invalidate() reloads the route data with a new array reference on every save, which previously triggered TanStack Table's default pagination reset even though the row count hadn't changed.
  • Sets autoResetPageIndex: false on all three group tables (Telegram, WhatsApp, combined) and clamps the current page back only when the row count actually shrinks past it (e.g. filtering/search), instead of always jumping to page 1.
  • Redesigns the action column in all three tables to icon-only controls (invite link, visibility toggle, edit labels), replacing the previous whole-row click for editing labels with a dedicated button.
  • Extracts the repeated invite-link/visibility-toggle/edit-labels buttons into src/components/group-action-buttons.tsx to remove duplicated JSX.

closes #78

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: edaa205a-4702-40e2-805a-6a1b560d826d

📥 Commits

Reviewing files that changed from the base of the PR and between d108832 and 8800f04.

📒 Files selected for processing (6)
  • src/components/group-action-buttons.tsx
  • src/features/groups-by-label/combined-groups-table.tsx
  • src/features/telegram/groups-table.tsx
  • src/features/telegram/users-page.tsx
  • src/features/whatsapp/create-edit-group-dialog.tsx
  • src/features/whatsapp/whatsapp-groups-page.tsx

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The change adds shared group action buttons, replaces inline table controls, removes row-level label editing, preserves pagination after row-count changes, and updates related action styling.

Changes

Group table actions

Layer / File(s) Summary
Shared group action buttons
src/components/group-action-buttons.tsx
Adds reusable invite-link, visibility-toggle, and label-edit buttons with accessibility states and labels.
Group table action integration
src/features/groups-by-label/combined-groups-table.tsx, src/features/telegram/groups-table.tsx, src/features/whatsapp/whatsapp-groups-page.tsx
Replaces inline controls and invite columns with shared actions. Removes row-level label editing. Memoizes derived rows and clamps pagination when row counts shrink.
Related control presentation
src/features/telegram/users-page.tsx, src/features/whatsapp/create-edit-group-dialog.tsx
Right-aligns the Telegram users actions column and applies emerald styling to the WhatsApp edit trigger.

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 8800f

The pagination and action-control updates do not show an actionable current risk.

🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The pull request includes unrelated UI changes, including new shared action components, action redesigns, removal of row-level editing, users-table styling, and dialog-trigger styling. These changes a… Move the unrelated UI changes into separate pull requests, or link issues that explicitly require them and document their scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 6 files. 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 clearly describes the primary change: preventing pagination from resetting after saving a group.
Linked Issues check ✅ Passed The changes satisfy issue #78 by disabling automatic page resets and clamping the page only when the row count decreases below the current page.
Full details: Out of Scope Changes check

Explanation

The pull request includes unrelated UI changes, including new shared action components, action redesigns, removal of row-level editing, users-table styling, and dialog-trigger styling. These changes are not required by issue #78.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

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.

Groups table pagination resets after saving

1 participant