Skip to content

fix(group): #326 normalize panel slowMode and preserve permissions - #326

Merged
moonrailgun merged 1 commit into
masterfrom
moonrailgun/the-panel-for-setting-viewing-permissions-for-al
Nov 25, 2026
Merged

moonrailgun merged 1 commit into
masterfrom
moonrailgun/the-panel-for-setting-viewing-permissions-for-al

Conversation

@moonrailgun

@moonrailgun moonrailgun commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes #322

Summary by CodeRabbit

  • Bug Fixes
    • Editing a group panel’s name or other fields no longer drops its permissions or valid slow-mode settings.
    • Slow-mode settings are now consistently validated and saved. Empty or null values are treated as unset, extra fields are discarded, and invalid settings or slow mode on non-text panels are rejected.
    • Changing or clearing slow mode resets its counters; editing a panel’s name alone does not.

@netlify

netlify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for tailchat-nightly ready!

Name Link
🔨 Latest commit 0993031
🔍 Latest deploy log https://app.netlify.com/projects/tailchat-nightly/deploys/6b06fe7a93b966696695298e
😎 Deploy Preview https://deploy-preview-326--tailchat-nightly.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The panel form now manages permission fields separately from general metadata. Client helpers prepare slow-mode values for submission. The group service normalizes slow-mode metadata during group and panel creation or modification.

Changes: Group panel updates

Layer / File(s) Summary
Prepare panel values for form submission
client/web/src/components/modals/GroupPanel/helper.ts, client/web/src/components/modals/GroupPanel/__tests__/helper.spec.ts
The helper initializes slowMode as undefined when absent and includes it in metadata only when it is valid for a text panel. Tests cover valid and invalid values, and preservation of unrelated fields.
Separate form state from permissions
client/web/src/components/modals/GroupPanel/ModifyGroupPanel.tsx, client/web/src/components/modals/GroupPanel/__tests__/ModifyGroupPanel.spec.tsx
The modal renders an extracted form after panel data loads. The form excludes permissionMap and fallbackPermissions from general form state. Tests check permission retention and slow-mode submission.
Normalize slow-mode metadata on writes
server/services/core/group/group.service.ts, server/test/integration/group/panelSlowMode.spec.ts
Group and panel writes store normalized metadata. Empty slow-mode values are removed, invalid values are rejected, and extra slow-mode fields are removed. Tests also check counter resets when slow-mode settings change.

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

Change: Bug fix

Possibly related issues

  • msgbyte/tailchat#322 — The issue reports that saving panel permissions with slow mode unset fails. The changes cover that save path by excluding empty slow-mode values and preserving permission fields.
Merge Risk: Minimal · up to 09930

This change keeps panel permissions intact when other panel fields are edited, and it cleans up empty or invalid slow-mode values on both the client and the server. No concrete merge-blocking risk was found. The new tests cover the main cases.

Pre-merge checks: Passed 4

Check name Status Explanation
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix area (group panel), the main behavior change (slowMode normalization), and the permission preservation fix. The changeset matches: slowMode normalization in group.service.ts an…
Full details: Title check

Explanation

The title names the fix area (group panel), the main behavior change (slowMode normalization), and the permission preservation fix. The changeset matches: slowMode normalization in group.service.ts and helper.ts, and permissions kept out of the form's metadata in ModifyGroupPanel. The title is specific and on topic, with the issue number as a minor extra detail.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ad819d58-606c-4f1d-bc5a-e59124877558
Commits

Reviewing files that changed from the base of the PR and between dee3553 and 0993031.

Files selected for processing: 6

  • client/web/src/components/modals/GroupPanel/ModifyGroupPanel.tsx
  • client/web/src/components/modals/GroupPanel/__tests__/ModifyGroupPanel.spec.tsx
  • client/web/src/components/modals/GroupPanel/__tests__/helper.spec.ts
  • client/web/src/components/modals/GroupPanel/helper.ts
  • server/services/core/group/group.service.ts
  • server/test/integration/group/panelSlowMode.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@moonrailgun moonrailgun changed the title fix(group): normalize panel slowMode and preserve permissions fix(group): #326 normalize panel slowMode and preserve permissions Nov 25, 2026
@moonrailgun
moonrailgun merged commit 7842a5c into master Nov 25, 2026
8 of 9 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

1 participant