PICK SKY DEL: server purge of seat Character + race guards stop the btn from re-injecting; readonly opacity bump (0.6 → 0.85) — TDD
Two related Sky Select bugs the old DEL flow couldn't address. (1) DEL btn lingered after a clear because an in-flight schedulePreview's .then() could resolve AFTER the OK callback ran, calling _ensureDelBtn() against a freshly-cleared wheel-col. (2) Sky data rehydrated on refresh because clicking SAVE SKY confirms a Character row on the seat — the DEL handler only purged localStorage & in-memory state, leaving the durable Character row to drive subsequent renders.
Server: new epic.sky_delete(room_id) view (POST → JsonResponse {deleted:True}) deletes every Character on the requesting gamer's seat where retired_at is null — drafts (confirmed_at NULL) and confirmed rows alike. 405 on GET, 403 for outsiders, never touches User.sky_chart_data (Dashsky/My Sky applet's DEL owns that side).
JS (_sky_overlay.html): DEL OK callback now (a) bumps a _fetchSeq counter so any in-flight schedulePreview .then()/.catch() short-circuits when its captured seq != current — kills the re-injection race; (b) clearTimeout-s _chartDebounce + _placeDebounce so a typed-just-before-DEL keystroke can't fire schedulePreview after the clear; (c) POSTs to DELETE_URL (overlay.dataset.deleteUrl wired via {% url 'epic:sky_delete' room.id %}) so the seat's Character row is dropped server-side; (d) clears LS + DOM state as before.
SCSS: .sky-field input[readonly] opacity 0.6 → 0.85, & dropped the redundant .sky-coords > div input { opacity:0.6 } that was previously winning the cascade by virtue of being declared later. The browser's default ::placeholder is ~0.54, so 0.85 × 0.54 ≈ 0.46 — close to the birth-place placeholder's ~0.54 effective opacity per the user's "appreciably higher tho not opacity 1" target. Values land at 0.85 (clearly readable but still de-emphasized vs. the editable place input).
Tests: 4 new ITs in PickSkyRenderingTest cover (a) POST clears confirmed Character, returns JSON {deleted:True}; (b) 405 on GET; (c) 403 for non-seat-owner; (d) User.sky_chart_data untouched by in-room DEL. PickSkyDelTest FT picks up an extra assertion: id_sky_delete_btn must be absent from DOM after OK (the bug-1 regression guard). 55-test sky suite green.
Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -209,6 +209,7 @@ html.sky-open .sky-modal-wrap {
|
||||
max-width: 100%;
|
||||
background-color: rgba(var(--priUser), 1);
|
||||
color: rgba(var(--secUser), 1);
|
||||
font-weight: 700;
|
||||
border: 0.1rem solid rgba(var(--secUser), 0.5);
|
||||
--_pad-v: 0.5rem;
|
||||
padding: var(--_pad-v) 0.75rem;
|
||||
@@ -229,10 +230,20 @@ html.sky-open .sky-modal-wrap {
|
||||
outline: none;
|
||||
border-color: rgba(var(--terUser), 0.75);
|
||||
box-shadow: 0 0 0.75rem rgba(var(--terUser), 0.5);
|
||||
color: rgba(var(--terUser), 1);
|
||||
}
|
||||
|
||||
&[readonly] {
|
||||
opacity: 0.6;
|
||||
// Match the birth-place placeholder's effective opacity. The
|
||||
// browser's default ::placeholder pseudo-element is ~0.54; the
|
||||
// lat/lon/tz fields used to sit at the input-element-level
|
||||
// opacity:0.6, which compounded with that to ~0.32 — making
|
||||
// placeholders almost invisible. Bumping to 0.85 keeps the
|
||||
// readonly fields visually de-emphasized vs. the editable ones
|
||||
// while leaving the placeholder copy clearly readable
|
||||
// (0.85 × 0.54 ≈ 0.46, parity w. birth-place's ~0.54).
|
||||
opacity: 0.85;
|
||||
color: inherit;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
@@ -316,8 +327,9 @@ html.sky-open .sky-modal-wrap {
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
opacity: 0.6;
|
||||
cursor: default;
|
||||
// opacity is inherited from the .sky-field input[readonly] rule
|
||||
// above (0.85) — keep this block lean so the readonly-styling
|
||||
// single source of truth doesn't drift.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user