Skip to content

Fix frontend not respecting ADMIN_EDIT config#2001

Merged
umputun merged 1 commit intomasterfrom
fix/admin-edit-frontend-1986
Feb 11, 2026
Merged

Fix frontend not respecting ADMIN_EDIT config#2001
umputun merged 1 commit intomasterfrom
fix/admin-edit-frontend-1986

Conversation

@paskal
Copy link
Collaborator

@paskal paskal commented Feb 10, 2026

Summary

The backend correctly allows admins unlimited edit time when ADMIN_EDIT=true, but the frontend doesn't use the admin_edit config value from /api/v1/config. This means the edit button disappears for admins after the normal edit window expires, even though the backend would accept the edit.

Changes:

  • Add admin_edit: boolean to frontend Config types (app + API package)
  • Set editDeadline = Infinity for admin users when admin_edit is enabled
  • Allow admins to edit comments that already have replies (when admin_edit is on)
  • Hide the countdown timer when editDeadline is Infinity

Fixes #1986

Add admin_edit field to frontend Config types and use it in
comment component to give admins unlimited edit time and allow
editing comments with replies. Hide countdown timer when
editDeadline is Infinity. Fixes #1986
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.92%. Comparing base (41b75eb) to head (a1215d8).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2001      +/-   ##
==========================================
+ Coverage   64.88%   64.92%   +0.03%     
==========================================
  Files         140      140              
  Lines        3258     3264       +6     
  Branches      815      827      +12     
==========================================
+ Hits         2114     2119       +5     
- Misses       1030     1031       +1     
  Partials      114      114              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

size-limit report 📦

Path Size
public/embed.mjs 2.03 KB (0%)
public/remark.mjs 73.95 KB (+0.06% 🔺)
public/remark.css 8.26 KB (0%)
public/last-comments.mjs 36.21 KB (+0.13% 🔺)
public/last-comments.css 3.75 KB (0%)
public/deleteme.mjs 12.45 KB (+0.04% 🔺)
public/counter.mjs 751 B (0%)

@paskal paskal marked this pull request as ready for review February 11, 2026 00:18
@paskal paskal requested a review from umputun as a code owner February 11, 2026 00:18
Copy link
Owner

@umputun umputun left a comment

Choose a reason for hiding this comment

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

lgtm, thx

@umputun umputun merged commit d6d53ff into master Feb 11, 2026
12 checks passed
@umputun umputun deleted the fix/admin-edit-frontend-1986 branch February 11, 2026 04:51
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.

ADMIN_EDIT

2 participants