Add Cancel button to character-creation Revise flows

Clicking Revise on basic records, techniques, or J/Q/K assignment now
offers a Cancel button that throws away any edits made since Revise and
restores the previously-saved values. Basic-records cancel is a pure
client-side toggle; techniques/face cancel re-submit a snapshot taken at
Revise time (since Revise immediately unsubmits/unassigns server-side).
Also added Cancel to the recruit-creation basic-records revise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-14 09:09:24 -07:00
parent 45fefc0c71
commit 5a9d712c95
3 changed files with 88 additions and 3 deletions

View File

@@ -56,6 +56,11 @@
editingBasic = true;
}
// Discard any edits made since clicking Revise and return to the saved view.
function cancelReviseBasic() {
editingBasic = false;
}
$: basicComplete = !!(me.avatar_look && me.avatar_smell && me.first_words && me.good_at_math);
$: likeDone = !me.other_like_from_player_id || !!me.other_like;
$: hateDone = !me.other_hate_from_player_id || !!me.other_hate;
@@ -191,7 +196,12 @@
{#if devMode}<button type="button" class="btn btn-secondary btn-small" on:click={() => basicDetails.good_at_math = getSuggestion('good_at_math')}>Suggest</button>{/if}
</div>
</div>
<button type="submit" class="btn btn-primary btn-full" disabled={savingBasic}>Save Records</button>
<div class="input-row mt-4">
<button type="submit" class="btn btn-primary btn-full" disabled={savingBasic}>Save Records</button>
{#if basicComplete}
<button type="button" class="btn btn-secondary" disabled={savingBasic} on:click={cancelReviseBasic}>Cancel</button>
{/if}
</div>
</form>
{/if}
</div>