Skip to content

Update comments : Refonte du système de commentaires — soft-delete, édition, unification des avatars - #47

Merged
raynaldlao merged 5 commits into
masterfrom
update-comments
Jul 21, 2026
Merged

Update comments : Refonte du système de commentaires — soft-delete, édition, unification des avatars#47
raynaldlao merged 5 commits into
masterfrom
update-comments

Conversation

@raynaldlao

Copy link
Copy Markdown
Owner

Contexte

Les commentaires utilisaient un hard-delete irréversible : un commentaire supprimé disparaissait complètement, arbre de réponses inclus. Les avatars sans photo avaient un affichage incohérent selon la page (fond blanc, variable non définie, lettre invisible). L'horodatage d'édition n'affichait que l'heure.

Changements

  • Soft-delete : les commentaires supprimés conservent leur contenu en base. L'affichage montre <em>Comment removed</em> avec le nom de l'auteur visible. L'arbre de réponses est préservé.
  • Édition : l'auteur (uniquement, pas l'admin) peut éditer son commentaire inline avec une textarea. Les commentaires édités affichent une date complète "21 juillet 2026 à 17:40".
  • Suppression admin : l'admin peut supprimer définitivement un commentaire déjà soft-deleté.
  • Avatars unifiés : les utilisateurs sans photo de profil ont désormais un cercle gris avec l'initiale de leur nom (même style que la page profile), cohérent sur la liste d'articles, le détail d'article et les commentaires.
  • Supprimés & anonymes uniformes : les commentaires supprimés (?), anonymes (A) et les initiales normales utilisent le même cercle gris. Fini le fond blanc dans le cercle pour les supprimés.
  • Liens séparés : l'avatar et le nom de l'auteur sont des liens indépendants.

…delete. Each comment stores is_deleted, deleted_at and edited_at. Authors/admins can soft‑delete, authors can edit inline and admins can permanently remove already‑deleted comments. Backend, templates, CSS, JS and tests are all updated
…arate meta links. When no avatar is present, a rounded fallback with the username initial is shown. Avatar and author name now link independently and comment avatar letters are centered inside their wrapper
…weight. The backend now formats edited_at with full date+time, tests are updated and the edited line uses the smaller body‑xs font to align with the main timestamp
…lder style. Letter‑initial circles now use the same surface/primary color tokens as profile avatars, with a visible border and bold initial. Applied to meta author, comment avatars (normal and deleted)
…ok. The dedicated deleted‑avatar rules are removed, so both deleted and no‑avatar states use the same unified gray circle with violet initial
@raynaldlao
raynaldlao requested a review from hlargitte July 21, 2026 17:05
@raynaldlao raynaldlao self-assigned this Jul 21, 2026

@hlargitte hlargitte left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM

@raynaldlao
raynaldlao merged commit 472017f into master Jul 21, 2026
1 check 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

Development

Successfully merging this pull request may close these issues.

2 participants