fix(desk): the heid code-review and bug-hunt panels on r2b merge 2, folded
The bug hunt (4/4) and code review (4/4) were both clean on mechanism.
Their shared catch was the one-sided minute check.
Dates:
- The date filters never raise. One clock outside the calendar's range
500'd the Desk for every booth, because every row renders in one
response. An unrenderable date now renders nothing.
- "Updated" shows whenever it differs from "created" by a minute or more,
either way. Copied content is often older than its folder.
- A clock ahead of now shows its date, never "just now".
- A day is 24h ("1d ago" never appeared).
The row:
- The controls are last in the markup, so the booth's name comes first in
tab order and wipe last. The cluster is placed over the strip from the
row's box.
The theme:
- A choice made in one tab moves the Booth's other open tabs.
- The theme mark goes only on ask fragments the embed mounted.
Tests, strengthened after the code review:
- the pill is visible at rest;
- keyboard focus reveals the controls;
- the controls act with scripts off;
- Reveal all reaches the doc page;
- the high-contrast check reads tokens that actually differ;
- the art-light extras are written from SVOS, not derived from the
copies;
- two overstated mutation rows are replaced (one was a runtime no-op, one
went red through a syntax error).
Contract amended.
r2b.toml 55/55 proved. 799 passed.
This commit is contained in:
+121
-19
@@ -311,18 +311,18 @@ label = "D1 the cluster stays in flow where a hover exists (it takes room)"
|
||||
file = "booth/templates/base.html"
|
||||
test = "tests/test_flow_browser.py::test_the_row_controls_take_no_room_where_a_hover_exists"
|
||||
old = '''
|
||||
.desk-acts{position:absolute;top:5px;right:5px;flex:none;gap:4px;padding:3px;'''
|
||||
.desk-acts{position:absolute;top:17px;left:calc(12px + 210px - 5px);transform:translateX(-100%);flex:none;gap:4px;padding:3px;'''
|
||||
new = '''
|
||||
.desk-acts{position:static;top:5px;right:5px;flex:none;gap:4px;padding:3px;'''
|
||||
.desk-acts{position:static;top:17px;left:calc(12px + 210px - 5px);transform:translateX(-100%);flex:none;gap:4px;padding:3px;'''
|
||||
|
||||
[[mutation]]
|
||||
label = "D1 hover-only everywhere (no controls at all on touch)"
|
||||
file = "booth/templates/base.html"
|
||||
test = "tests/test_flow_browser.py::test_on_touch_the_row_controls_are_visible_in_flow_and_at_least_28px"
|
||||
old = '''
|
||||
.desk-acts{order:99;flex:1 0 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}'''
|
||||
.desk-acts{flex:1 0 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}'''
|
||||
new = '''
|
||||
.desk-acts{order:99;flex:1 0 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px;opacity:0}'''
|
||||
.desk-acts{flex:1 0 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px;opacity:0}'''
|
||||
|
||||
[[mutation]]
|
||||
label = "D1 touch controls fall below the 28px floor"
|
||||
@@ -338,35 +338,33 @@ label = "D1 zip back in the middle"
|
||||
file = "booth/templates/index.html"
|
||||
test = "tests/test_flow_browser.py::test_the_row_controls_run_zip_keep_or_release_then_wipe"
|
||||
old = '''
|
||||
<a class="dl-link" href="/b/{{ b.name_url }}/?download=1" title="download this booth as a zip">⬇ zip</a>
|
||||
{%- if b.kept %}
|
||||
<form class="release"'''
|
||||
<a class="dl-link" href="/b/{{ b.name_url }}/?download=1" title="download this booth as a zip">⬇ zip</a>
|
||||
{%- if b.kept %}
|
||||
<form class="release"'''
|
||||
new = '''
|
||||
{%- if b.kept %}
|
||||
<a class="dl-link" href="/b/{{ b.name_url }}/?download=1" title="download this booth as a zip">⬇ zip</a>
|
||||
<form class="release"'''
|
||||
{%- if b.kept %}
|
||||
<a class="dl-link" href="/b/{{ b.name_url }}/?download=1" title="download this booth as a zip">⬇ zip</a>
|
||||
<form class="release"'''
|
||||
|
||||
[[mutation]]
|
||||
label = "D1 a held booth's pill reads as counting down"
|
||||
file = "booth/templates/index.html"
|
||||
test = "tests/test_flow.py::test_the_lifetime_pill_class_is_kept_held_or_counting"
|
||||
old = '''('life-held' if b.hold in ('open', 'unreadable') else 'life-count')'''
|
||||
new = ''''life-count\''''
|
||||
new = '''('life-held' if b.hold == 'never' else 'life-count')'''
|
||||
|
||||
[[mutation]]
|
||||
label = "D1b an unknown birth time renders a guess"
|
||||
file = "booth/templates/_dates.html"
|
||||
test = "tests/test_flow.py::test_created_and_updated_are_dated_facts_and_none_says_nothing"
|
||||
old = '''
|
||||
{%- if created_at %} · <time class="d-made" datetime="{{ created_at|iso }}" title="created {{ created_at|stamp }}">created {{ created_at|day(now) }}</time>{% endif -%}'''
|
||||
new = '''
|
||||
{%- set created_at = created_at or landed_at %}{%- if created_at %} · <time class="d-made" datetime="{{ created_at|iso }}" title="created {{ created_at|stamp }}">created {{ created_at|day(now) }}</time>{% endif -%}'''
|
||||
old = '''{% macro dates(created_at, landed_at, now) -%}'''
|
||||
new = '''{% macro dates(created_at, landed_at, now) -%}{%- set created_at = created_at or landed_at -%}'''
|
||||
|
||||
[[mutation]]
|
||||
label = "D1b updated is measured from the wrong clock"
|
||||
file = "booth/templates/_dates.html"
|
||||
test = "tests/test_flow.py::test_created_and_updated_are_dated_facts_and_none_says_nothing"
|
||||
old = '''updated {{ (now - landed_at)|ago }}'''
|
||||
old = '''updated {{ age|ago }}'''
|
||||
new = '''updated {{ (now - created_at)|ago }}'''
|
||||
|
||||
[[mutation]]
|
||||
@@ -418,13 +416,18 @@ new = '''
|
||||
if (c === 'system')'''
|
||||
|
||||
[[mutation]]
|
||||
label = "D3 the stored theme is read after the stylesheet (a flash)"
|
||||
label = "D3 a stylesheet precedes the stored-theme script (a flash)"
|
||||
file = "booth/templates/base.html"
|
||||
test = "tests/test_flow.py::test_a_forced_theme_is_applied_before_first_paint"
|
||||
old = '''
|
||||
var t = localStorage.getItem('booth.theme');'''
|
||||
<script>
|
||||
(function () {
|
||||
var d = document.documentElement, b = d.getAttribute('data-booth');'''
|
||||
new = '''
|
||||
var t = localStorage.getItem('booth.' + 'theme');'''
|
||||
<style></style>
|
||||
<script>
|
||||
(function () {
|
||||
var d = document.documentElement, b = d.getAttribute('data-booth');'''
|
||||
|
||||
[[mutation]]
|
||||
label = "D3 the ask chrome in a verbatim page ignores the choice"
|
||||
@@ -444,3 +447,102 @@ old = '''
|
||||
if (e.key === "booth.theme" || e.key === null) bkTheme();'''
|
||||
new = '''
|
||||
if (false) bkTheme();'''
|
||||
|
||||
# ---- merge-2 folds: heid bug-hunt ("GORE-7") and code-review ("STAGGER-3")
|
||||
# Not expressible as one replacement, so pinned by their tests directly: the
|
||||
# row's DOM tab order (read in order by the test), and a declaration dropped
|
||||
# from BOTH light copies (the expected set is now written from SVOS, not
|
||||
# derived from the copies).
|
||||
|
||||
[[mutation]]
|
||||
label = "a date the calendar cannot hold raises through the Desk"
|
||||
file = "booth/app.py"
|
||||
test = "tests/test_flow.py::test_a_date_no_calendar_can_hold_renders_nothing_and_never_500s"
|
||||
old = '''
|
||||
_BAD_DATE = (OverflowError, OSError, ValueError)'''
|
||||
new = '''
|
||||
_BAD_DATE = ()'''
|
||||
|
||||
[[mutation]]
|
||||
label = "updated is dropped for content older than its booth (one-sided gap)"
|
||||
file = "booth/templates/_dates.html"
|
||||
test = "tests/test_flow.py::test_updated_shows_whenever_it_differs_from_created_and_a_future_one_says_its_date"
|
||||
old = '''(landed_at - created_at)|abs >= 60'''
|
||||
new = '''(landed_at - created_at) >= 60'''
|
||||
|
||||
[[mutation]]
|
||||
label = "a content clock ahead of now reads as an age"
|
||||
file = "booth/templates/_dates.html"
|
||||
test = "tests/test_flow.py::test_updated_shows_whenever_it_differs_from_created_and_a_future_one_says_its_date"
|
||||
old = '''{%- if age < -60 %}'''
|
||||
new = '''{%- if false %}'''
|
||||
|
||||
[[mutation]]
|
||||
label = "hours run on to 47h (1d ago never appears)"
|
||||
file = "booth/app.py"
|
||||
test = "tests/test_flow.py::test_an_age_is_said_in_its_largest_whole_unit"
|
||||
old = '''
|
||||
if s < 86400:
|
||||
return f"{s // 3600}h ago"'''
|
||||
new = '''
|
||||
if s < 2 * 86400:
|
||||
return f"{s // 3600}h ago"'''
|
||||
|
||||
[[mutation]]
|
||||
label = "a theme chosen in one tab does not reach the Booth's other open tabs"
|
||||
file = "booth/templates/base.html"
|
||||
test = "tests/test_flow_browser.py::test_a_theme_chosen_in_one_tab_moves_the_others"
|
||||
old = '''
|
||||
if (e.key !== 'booth.theme' && e.key !== null) return;
|
||||
var t = null;'''
|
||||
new = '''
|
||||
return;
|
||||
var t = null;'''
|
||||
|
||||
[[mutation]]
|
||||
label = "the theme mark reaches the author's own .bk-ask"
|
||||
file = "booth/static/embed.js"
|
||||
test = "tests/test_flow_browser.py::test_the_theme_marks_only_the_ask_fragments_we_mounted"
|
||||
old = '''
|
||||
ours.forEach(function (root) {'''
|
||||
new = '''
|
||||
[document.body].forEach(function (root) {'''
|
||||
|
||||
[[mutation]]
|
||||
label = "keyboard focus no longer reveals the row's controls"
|
||||
file = "booth/templates/base.html"
|
||||
test = "tests/test_flow_browser.py::test_the_pill_shows_at_rest_and_focus_reveals_the_controls"
|
||||
old = '''
|
||||
.desk-row:hover .desk-acts,.desk-row:focus-within .desk-acts{opacity:1;pointer-events:auto}'''
|
||||
new = '''
|
||||
.desk-row:hover .desk-acts{opacity:1;pointer-events:auto}'''
|
||||
|
||||
[[mutation]]
|
||||
label = "the lifetime pill hides at rest"
|
||||
file = "booth/templates/base.html"
|
||||
test = "tests/test_flow_browser.py::test_the_pill_shows_at_rest_and_focus_reveals_the_controls"
|
||||
old = '''
|
||||
.life-count::before{content:"◷"}'''
|
||||
new = '''
|
||||
.life-count::before{content:"◷"}
|
||||
.life{opacity:0}'''
|
||||
|
||||
[[mutation]]
|
||||
label = "high contrast never applies (dark-hc block gone)"
|
||||
file = "booth/templates/_svos_tokens.css"
|
||||
test = "tests/test_flow_browser.py::test_a_forced_theme_follows_high_contrast"
|
||||
old = '''
|
||||
/* dark high contrast: whenever dark is in effect (light, below, outranks it) */
|
||||
@media (prefers-contrast: more) {'''
|
||||
new = '''
|
||||
/* dark high contrast: whenever dark is in effect (light, below, outranks it) */
|
||||
@media (prefers-contrast: less) {'''
|
||||
|
||||
[[mutation]]
|
||||
label = "Reveal all does not reach a blurred doc's own page"
|
||||
file = "booth/templates/doc.html"
|
||||
test = "tests/test_flow_browser.py::test_reveal_all_lifts_the_doc_page_it_reaches"
|
||||
old = '''
|
||||
.reveal-all .docbody.is-blurred .markdown-body,.reveal-all .docbody.is-blurred .textview{filter:none}'''
|
||||
new = '''
|
||||
.reveal-all-OFF .docbody.is-blurred .markdown-body,.reveal-all .docbody.is-blurred .textview{filter:none}'''
|
||||
|
||||
Reference in New Issue
Block a user