stage #4592 onto master (v0.51.555) — keep per-turn question-jump button discoverable on desktop (#2246 follow-up)
santastabber: desktop ≥641px keeps the jump-to-question affordance visible (it's navigation) while timestamp/actions chrome stays hover/focus-only, via :has(.msg-question-jump-btn) selectors. CSS+test only. Co-authored-by: santastabber <santastabber@users.noreply.github.com>
This commit is contained in:
parent
3aaeea881b
commit
382856e170
2 changed files with 54 additions and 0 deletions
|
|
@ -5127,6 +5127,38 @@ main.main > #mainPlugin{display:none;}
|
|||
.msg-row[data-role="assistant"]:hover .msg-foot,
|
||||
.assistant-turn:hover .msg-foot,
|
||||
.assistant-turn:focus-within .msg-foot { opacity: 1; }
|
||||
/* Desktop/tablet keeps the per-turn jump affordance discoverable without
|
||||
exposing the quieter timestamp/action chrome until hover or keyboard focus. */
|
||||
@media (min-width: 641px) {
|
||||
.msg-row[data-role="assistant"] .msg-foot:has(.msg-question-jump-btn),
|
||||
.assistant-turn .msg-foot:has(.msg-question-jump-btn) {
|
||||
opacity: 1;
|
||||
}
|
||||
.msg-row[data-role="assistant"] .msg-foot:has(.msg-question-jump-btn) .msg-time,
|
||||
.msg-row[data-role="assistant"] .msg-foot:has(.msg-question-jump-btn) .msg-actions,
|
||||
.assistant-turn .msg-foot:has(.msg-question-jump-btn) .msg-time,
|
||||
.assistant-turn .msg-foot:has(.msg-question-jump-btn) .msg-actions {
|
||||
opacity: 0;
|
||||
transition: opacity .15s;
|
||||
}
|
||||
.msg-row[data-role="assistant"] .msg-foot:has(.msg-question-jump-btn) .msg-time,
|
||||
.msg-row[data-role="assistant"] .msg-foot:has(.msg-question-jump-btn) .msg-actions,
|
||||
.assistant-turn .msg-foot:has(.msg-question-jump-btn) .msg-time,
|
||||
.assistant-turn .msg-foot:has(.msg-question-jump-btn) .msg-actions {
|
||||
pointer-events: none;
|
||||
}
|
||||
.msg-row[data-role="assistant"]:hover .msg-foot:has(.msg-question-jump-btn) .msg-time,
|
||||
.msg-row[data-role="assistant"]:hover .msg-foot:has(.msg-question-jump-btn) .msg-actions,
|
||||
.msg-row[data-role="assistant"]:focus-within .msg-foot:has(.msg-question-jump-btn) .msg-time,
|
||||
.msg-row[data-role="assistant"]:focus-within .msg-foot:has(.msg-question-jump-btn) .msg-actions,
|
||||
.assistant-turn:hover .msg-foot:has(.msg-question-jump-btn) .msg-time,
|
||||
.assistant-turn:hover .msg-foot:has(.msg-question-jump-btn) .msg-actions,
|
||||
.assistant-turn:focus-within .msg-foot:has(.msg-question-jump-btn) .msg-time,
|
||||
.assistant-turn:focus-within .msg-foot:has(.msg-question-jump-btn) .msg-actions {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
}
|
||||
.assistant-turn .msg-foot-with-usage,
|
||||
.msg-row[data-role="assistant"] .msg-foot-with-usage {
|
||||
opacity: 1;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,28 @@ def test_question_jump_button_matches_bottom_button_size_on_mobile():
|
|||
assert ".msg-question-jump-btn span:last-child { display: none; }" in STYLE_CSS
|
||||
|
||||
|
||||
def test_question_jump_footer_is_discoverable_on_desktop_without_exposing_actions():
|
||||
# Desktop cannot rely on the mobile always-visible footer override, but the
|
||||
# per-turn jump affordance is navigation, not quiet action chrome. Keep only
|
||||
# the jump button discoverable at rest; reveal timestamp/actions on hover or
|
||||
# keyboard focus.
|
||||
block_anchor = "Desktop/tablet keeps the per-turn jump affordance discoverable"
|
||||
block_start = STYLE_CSS.index(block_anchor)
|
||||
block_end = STYLE_CSS.index(".assistant-turn .msg-foot-with-usage", block_start)
|
||||
desktop_jump_block = STYLE_CSS[block_start:block_end]
|
||||
|
||||
assert "@media (min-width: 641px)" in desktop_jump_block
|
||||
|
||||
assert ".assistant-turn .msg-foot:has(.msg-question-jump-btn)" in desktop_jump_block
|
||||
assert "opacity: 1;" in desktop_jump_block
|
||||
assert ".msg-foot:has(.msg-question-jump-btn) .msg-time" in desktop_jump_block
|
||||
assert ".msg-foot:has(.msg-question-jump-btn) .msg-actions" in desktop_jump_block
|
||||
assert "pointer-events: none;" in desktop_jump_block
|
||||
assert ".assistant-turn:hover .msg-foot:has(.msg-question-jump-btn) .msg-actions" in desktop_jump_block
|
||||
assert ".assistant-turn:focus-within .msg-foot:has(.msg-question-jump-btn) .msg-actions" in desktop_jump_block
|
||||
assert "pointer-events: auto;" in desktop_jump_block
|
||||
|
||||
|
||||
def test_question_jump_text_is_localized():
|
||||
for key in ("jump_to_question", "jump_to_question_label"):
|
||||
assert I18N_JS.count(f"{key}:") >= 12
|
||||
|
|
|
|||
Loading…
Reference in a new issue