Skip to content

Make ending a character hard to do by accident - #164

Merged
XxFran10xX merged 2 commits into
mainfrom
fix/safer-end-character
Nov 21, 2026
Merged

XxFran10xX merged 2 commits into
mainfrom
fix/safer-end-character

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Status record

  • Reviewed: Fable 5.2 (medium) APPROVE at 7b8560c, 3 minor findings; 2 fixed in daa3be5 (equal button widths, dead-character check before the delay), 1 left (the 1.5 s counts from when the server sends the page, inherent)
  • Second opinion: CodeRabbit APPROVED at 7b8560c, no findings (approval auto-dismissed by the minor-fix push)
  • Dev-tested: PASS at daa3be5 (CI jar on TFMCDev01, bot ~/end-char-test/test.js 15/15: chest Confirm shows "Kill ?", selection layout, clues page, [Back][End for good], repeat click lands on Back, instant End for good asks again, End after the delay works; no new RPCharacters errors)
  • Local tests: changed classes pass at daa3be5, 0 missed lines in changed classes (Windows-only fsync failures in persistence tests, unrelated)

Why

On 2026-11-20 a player on Main lost their character while checking their clues in the character selection room after their game froze. The server recorded the selection screen's two-step "End character" (cause: CHARACTER_MENU). In that screen:

  • "Clues" (hover only, clicking did nothing) sat right next to the clickable "End character" link on one line.
  • Both confirm steps put the kill button in the same spot ("End character", then "End for good"), so a double click, or clicks a frozen client delivers in a burst, went straight through.

The old Character Info chest menu had a smaller version: Kill and Switch both open the same "Confirm Action" screen with nothing saying which action is being confirmed.

Changes

Selection screen (CharacterSelectView):

  • "End character" moves off the Background • Traits • Clues line to its own line at the bottom of the screen, below Memorials.
  • "Clues" is now a link that opens a clues page (Back returns), like Background. The hover still shows the clues.
  • The final step shows [Back] [End for good]: Back takes the spot End character had, so a repeated click steps back.
  • End for good ignores clicks for 1.5 s after the final page opens and asks again ("Take a moment. Press End for good again to confirm.").

Old chest menu (InventoryManager.confirmView):

  • The Confirm Action screen shows an item between Confirm and Cancel: "Kill ?" (axe), "Switch to ?" (emerald) or "Revive ?" (totem). Title and slots are unchanged, so the click handling is untouched.

No change to when a character can be ended, nor to saved data.

Tests

  • CharacterSelectViewTest: new layout, clues page, swapped buttons, the 1.5 s guard (early click asks again, then confirms), and a double click on the first step's spot landing on Back.
  • InventoryManagerViewsTest / PlayerManagerEventsTest: confirm subject for each action, colour-stripped and missing names.

🤖 Generated with Claude Code

Selection screen: End character moves off the Background/Traits/Clues line
to its own line at the bottom; Clues opens its own page. The final step puts
Back where End character was and ignores End for good for 1.5 s after it
opens, so a double click or clicks a frozen client sends at once can't run
through both steps.

Old Character Info menu: the Confirm Action screen now shows what Confirm
does and to whom (Kill/Switch to/Revive <name>?).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c3d250f-a96c-4ab6-b9d1-b26226f48aa0

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Character details now show clues on a dedicated page, with the option to open it separately from the character’s other information.
    • Confirmation screens for ending, switching, or reviving a character now include action-specific prompts and character details.
  • Bug Fixes
    • The option to end a character is displayed separately from character details, and ending is blocked briefly after the final confirmation page opens.

Character selection now has a dedicated clues page, separates the end-character link from card extras, and delays final ending confirmation by 1,500 ms. Kill, revive, and switch confirmation views now show a subject prompt based on the action type and character.

Changes: Character selection and ending

Layer / File(s) Summary
Character card details and clues page
src/main/java/net/tfminecraft/rpcharacters/body/CharacterSelectView.java, src/test/java/net/tfminecraft/rpcharacters/body/CharacterSelectViewTest.java
Character cards place the end-character link separately from extras. Clues open on a dedicated page, which returns to the roster if the character is missing or no longer alive. Tests cover the page, card layout, and empty extras.
Delayed character-ending confirmation
src/main/java/net/tfminecraft/rpcharacters/body/CharacterSelectView.java, src/test/java/net/tfminecraft/rpcharacters/body/CharacterSelectViewTest.java
The final confirmation records when it opens and rejects confirmation clicks made before 1,500 ms. The final page places Back before End for good. Tests cover early and boundary-time clicks, as well as existing ending outcomes.

Action-specific confirmation views

Layer / File(s) Summary
Action-specific prompts and flow integration
src/main/java/net/tfminecraft/rpcharacters/managers/InventoryManager.java, src/main/java/net/tfminecraft/rpcharacters/managers/PlayerManager.java, src/test/java/net/tfminecraft/rpcharacters/managers/InventoryManagerViewsTest.java, src/test/java/net/tfminecraft/rpcharacters/managers/PlayerManagerEventsTest.java
The confirmation view displays a prompt for the action type and character. Kill, revive, and switch flows pass that information to the view. Tests cover prompt text, character names, and flow arguments.

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

Change: Feature

Suggested reviewers: ryanbarlow97

Merge Risk: Minimal · previous review 7b856

This change adds a delay and clearer prompts to make ending a character harder to do by accident. No concrete defect was found, and it appears safe to merge.

- [ ] 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: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 154000c9-b1ca-46e5-9cfb-53ba3ad3c73c
Commits

Reviewing files that changed from the base of the PR and between 1dd19f4 and 7b8560c.

Files selected for processing: 6

  • src/main/java/net/tfminecraft/rpcharacters/body/CharacterSelectView.java
  • src/main/java/net/tfminecraft/rpcharacters/managers/InventoryManager.java
  • src/main/java/net/tfminecraft/rpcharacters/managers/PlayerManager.java
  • src/test/java/net/tfminecraft/rpcharacters/body/CharacterSelectViewTest.java
  • src/test/java/net/tfminecraft/rpcharacters/managers/InventoryManagerViewsTest.java
  • src/test/java/net/tfminecraft/rpcharacters/managers/PlayerManagerEventsTest.java

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

@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@github-actions github-actions Bot added the size:L 100-499 effective changed lines (tests excluded in mixed PRs). label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…ore too soon

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 21, 2026
@XxFran10xX
XxFran10xX merged commit febfedb into main Nov 21, 2026
3 checks passed
@XxFran10xX
XxFran10xX deleted the fix/safer-end-character branch November 21, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant