mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-03 11:42:23 +01:00
fix(ui): keep the confirm dialog's OK button in line with the others (#6782)
* fix(ui): keep the confirm dialog's OK button in line with the others #styled-confirm-ok was moved down 2px (position: relative; top: 2px), so the OK button sat 2px below Cancel and the alternate button in every styledConfirm dialog. Its label, and the alternate button's, now sit in a span nudged the same way as the Cancel label, so the text keeps its place and no button moves. Stylesheets and app.js get a new cache-bust token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(ui): build confirm labels inline and share the Cancel nudge rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(cache): keep upstream's service worker cache name format dev's editor tests require CACHE_NAME to match odysseus-v<N>-pr40-editor-precache, so keep the version bump and use that suffix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
682662d36f
commit
77964b0025
@@ -58,6 +58,24 @@ def test_styled_confirm_cancel_or_close_label_is_shifted_without_moving_button()
|
||||
assert "top:2px;" in rule
|
||||
|
||||
|
||||
def test_styled_confirm_ok_and_alternate_labels_shift_without_moving_buttons():
|
||||
# Moving #styled-confirm-ok itself (position:relative; top:2px) left it 2px
|
||||
# below Cancel and the alternate button. The OK and alternate labels get the
|
||||
# same label nudge as Cancel instead, and no rule moves a footer button.
|
||||
css = app_css()
|
||||
|
||||
assert "okBtn.replaceChildren(btnLabel(" in _UI
|
||||
assert "altBtn.replaceChildren(btnLabel(" in _UI
|
||||
rule_start = css.index("#styled-confirm-ok .styled-confirm-btn-label")
|
||||
rule = css[rule_start:css.index("}", rule_start)]
|
||||
assert "#styled-confirm-alt .styled-confirm-btn-label" in rule
|
||||
assert "position:relative;" in rule and "top:2px;" in rule
|
||||
for selector in ("#styled-confirm-ok {", "#styled-confirm-alt {", "#styled-confirm-cancel {"):
|
||||
if selector in css:
|
||||
block = css[css.index(selector):].split("}", 1)[0]
|
||||
assert "top:" not in block.replace(" ", ""), selector
|
||||
|
||||
|
||||
def test_styled_confirm_buttons_grow_to_fit_wrapped_labels():
|
||||
# The global `button { height:32px }` held a two-line label (e.g.
|
||||
# "Delete chat and images") to one line's height, so its second line
|
||||
|
||||
Reference in New Issue
Block a user