Skip to content

feat(characters): archivage réversible des personnages (#125) - #172

Merged
RebelliousSmile merged 2 commits into
mainfrom
claude/plan-derniere-issue-l94t6x
Jul 26, 2026
Merged

feat(characters): archivage réversible des personnages (#125)#172
RebelliousSmile merged 2 commits into
mainfrom
claude/plan-derniere-issue-l94t6x

Conversation

@RebelliousSmile

Copy link
Copy Markdown
Owner

Ferme #125. Ajoute une bascule d'archivage réversible : masquer un personnage des surfaces publiques sans le détruire. La suppression définitive existante reste une action distincte.

Ce qui est ajouté

  • Modèle : Character.is_archived BooleanField (default False) + index — migration characters/0025_character_is_archived_and_more.py.
  • Services : build_character_queryset filtre is_archived=False (découverte/recherche) ; archive_character / unarchive_character (creator-only) ; owned_archived_characters pour la section restauration.
  • Vues : character_archive / character_unarchive@require_POST + @login_required, creator-only (404 sinon), messages Django ; routes characters:archive / characters:unarchive.
  • UI : bouton « Archiver » sur la carte personnage (creator-only, _list_results.html) + section « Archivés » repliable avec « Restaurer » (list.html).
  • i18n : 9 chaînes FR (.po + .mo recompilé).
  • Tests : tests/characters/test_archive.py — 7 tests (queryset masqué, archive/restore, non-créateur 404, GET 405, garde lien PENDING, section liste).

Décisions (points « à trancher » de l'issue)

  • Fédération silencieuse : aucun Delete/Update AP émis à l'archivage — c'est une bascule de visibilité locale et réversible.
  • Liens actifs : archivage interdit tant qu'un LinkRequest PENDING/QUEUED cible le personnage (le créateur doit résoudre/annuler d'abord).

Vérification

manage.py check OK · makemigrations --check = No changes · ruff check/format clean · mypy suddenly/ clean · design lint 0 warning · suite tests/characters/ 157 passed (dont les 7 nouveaux) · i18n 11 passed.

Note de contexte

Le profil ne liste plus les personnages depuis #154 — la surface de gestion (bouton Archiver + section Archivés) vit sur characters:list.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 2 commits July 26, 2026 22:26
Add a soft-hide toggle so a character can be removed from public
surfaces without destroying it, reversibly — the hard delete stays a
distinct action.

- Character.is_archived BooleanField + index (migration 0025)
- build_character_queryset filters archived out (discovery/search)
- archive_character / unarchive_character services (creator-only),
  refusing while a PENDING/QUEUED link request targets the character
- owned_archived_characters for the restore section
- character_archive / character_unarchive views (@require_POST,
  @login_required, creator-only) + routes
- "Archive" button on the character card + collapsible "Archived"
  section with "Restore" on the list page
- FR translations (.po/.mo)
- tests/characters/test_archive.py (7 tests)

Federation-silent: no AP Delete/Update is emitted — archival is a
local, reversible visibility toggle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBRFVUtmBW3YSP8Yd2uNpB
CI installs ruff via `pip install -e ".[dev]"` with an unpinned
`ruff>=0.2`, so it pulls a ruff newer than the uv.lock pin (0.15.20).
That newer ruff reformats 14 files under `ruff format --check .` —
including files untouched by this branch (activitypub/tasks.py,
docs/translations.md) — turning main's CI red on an unchanged tree.

Pin ruff to the lockfile version so CI and the local dev env agree and
`ruff format --check` is deterministic, and apply 0.15.20 formatting to
tests/characters/test_archive.py.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBRFVUtmBW3YSP8Yd2uNpB
@RebelliousSmile
RebelliousSmile merged commit ad180b1 into main Jul 26, 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