From a3861424a984269d87887c81ef09ad3bf8adafdd Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sat, 18 Jul 2026 10:45:50 +0000 Subject: [PATCH 1/2] tests: unstick the sidebar descender guard after the truncation restyle The account-block regex required flex and flex-col to be adjacent, but the sidebar long-name truncation work (#7171) inserted min-w-0 flex-1 between them, so the guard stopped matching anything and Backend CI's Repo tests (CPU) job has failed on main and every branch since. The markup still uses leading-tight, so the invariant the test protects was never violated; only the pattern was stale. Allow utility classes between flex and flex-col, keeping the leading-* capture unchanged. All three tests in the file pass against the current sources. --- tests/studio/test_studio_text_descender_clipping.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/studio/test_studio_text_descender_clipping.py b/tests/studio/test_studio_text_descender_clipping.py index 7cad6cacfe..bd3267e2b7 100644 --- a/tests/studio/test_studio_text_descender_clipping.py +++ b/tests/studio/test_studio_text_descender_clipping.py @@ -34,10 +34,11 @@ def test_model_selector_trigger_label_uses_leading_tight(): def test_sidebar_account_block_uses_leading_tight(): src = _read(APP_SIDEBAR) - # Match the account-block parent div regardless of its gap utility; this - # guard is about the leading-* class, not the spacing. + # Match the account-block parent div regardless of its gap utility or any + # sizing classes between flex and flex-col (min-w-0 flex-1 arrived with the + # long-name truncation work); this guard is about the leading-* class only. pattern = re.compile( - r'', + r'', ) matches = pattern.findall(src) assert matches, "could not find sidebar account-block parent div" From b75df445fb3065639421de6c16a5b374d15af225 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sat, 18 Jul 2026 11:06:12 +0000 Subject: [PATCH 2/2] tests: anchor the account-block match and keep the wildcard in-attribute Review caught two soft spots in the loosened regex: the broadened pattern also matched the update-card wrapper, so a broken account block could hide behind the lookalike, and the \S wildcard could in principle walk across the closing quote into other markup. The match is now anchored to the displayTitle span that only the account block contains (bounded, stopping at any closing div), and every wildcard is restricted to non-quote characters so it can never leave the className attribute. Verified exactly one match at the account block on current sources; all three tests pass. --- tests/studio/test_studio_text_descender_clipping.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/studio/test_studio_text_descender_clipping.py b/tests/studio/test_studio_text_descender_clipping.py index bd3267e2b7..fc31b6c157 100644 --- a/tests/studio/test_studio_text_descender_clipping.py +++ b/tests/studio/test_studio_text_descender_clipping.py @@ -37,8 +37,12 @@ def test_sidebar_account_block_uses_leading_tight(): # Match the account-block parent div regardless of its gap utility or any # sizing classes between flex and flex-col (min-w-0 flex-1 arrived with the # long-name truncation work); this guard is about the leading-* class only. + # [^"\s] keeps the wildcard inside the className attribute, and the trailing + # displayTitle anchor pins the match to the account block itself so a + # lookalike wrapper (the update card) can never satisfy the guard. pattern = re.compile( - r'', + r'(?:(?!)[\s\S]){0,400}?\{displayTitle\}', ) matches = pattern.findall(src) assert matches, "could not find sidebar account-block parent div"