feat(characters): archivage réversible des personnages (#125) - #172
Merged
Conversation
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
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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é
Character.is_archivedBooleanField (default False) + index — migrationcharacters/0025_character_is_archived_and_more.py.build_character_querysetfiltreis_archived=False(découverte/recherche) ;archive_character/unarchive_character(creator-only) ;owned_archived_characterspour la section restauration.character_archive/character_unarchive—@require_POST+@login_required, creator-only (404 sinon), messages Django ; routescharacters:archive/characters:unarchive._list_results.html) + section « Archivés » repliable avec « Restaurer » (list.html)..po+.morecompilé).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)
Delete/UpdateAP émis à l'archivage — c'est une bascule de visibilité locale et réversible.LinkRequestPENDING/QUEUED cible le personnage (le créateur doit résoudre/annuler d'abord).Vérification
manage.py checkOK ·makemigrations --check= No changes ·ruff check/formatclean ·mypy suddenly/clean · design lint 0 warning · suitetests/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