Skip to content

Tests: follow Compare chat into the More submenu in the Playwright chat UI driver - #6153

Merged
danielhanchen merged 2 commits into
mainfrom
fix/playwright-compare-chat-submenu
Jun 10, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
fix/playwright-compare-chat-submenu

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Chat UI Tests has been red on every PR since this morning (for example #6146 and #6148, whose diffs touch unrelated code) with:

AssertionError: [ui] FAIL: composer + menu: 'Compare chat' item not found

Root cause: the plus-menu declutter (#6140) moved the Compare chat item into a nested "More" submenu (DropdownMenuSub in thread.tsx and shared-composer.tsx), and the Playwright driver still looked for it at the top level of the plus menu. The UI itself is fine for users; this is driver-vs-UI drift.

Change

After opening the plus menu, if Compare chat is not directly present, open the "More" sub-trigger (hover first, click as a fallback for environments where hover does not expand Radix submenus) and look again. The direct lookup stays first, so the driver keeps passing if the item ever moves back to the top level.

Testing

py_compile passes; the real verification is this PR's own Chat UI Tests check, which exercises the driver against the built UI. Note the same runs also confirmed the b9585 prebuilt installs and validates in CI ("prebuilt installed and validated"), so once this lands the Chat UI lane should be fully green again.

Related

The other repo-wide red (Core HF=latest) is the transformers v5 strict-config break in unsloth_zoo's use_cache tests, fixed separately in unslothai/unsloth-zoo#746.

shimmyshimmer and others added 2 commits June 10, 2026 14:52
The plus-menu declutter moved the Compare chat item into a More
submenu (DropdownMenuSub in thread.tsx / shared-composer.tsx), so the
Playwright driver stopped finding it at the top level and Chat UI Tests
went red on every PR regardless of its diff. Open the More sub-trigger
(hover, then click as a fallback) before asserting the item; the direct
lookup stays first so the driver still passes if the item moves back.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Playwright chat UI tests to handle a decluttered plus menu where the 'Compare chat' option is now nested under a 'More' submenu. The feedback suggests simplifying the fallback logic by leveraging Playwright's lazy locators, which makes re-assigning the 'compare_item' locator multiple times redundant.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +1103 to +1114
if compare_item.count() == 0:
# The plus menu was decluttered: Compare chat now lives in the
# "More" submenu; hover (then click as fallback) to open it.
more_trigger = page.get_by_role("menuitem", name = re.compile(r"^More$", re.I)).first
if more_trigger.count() > 0:
more_trigger.hover()
page.wait_for_timeout(400)
compare_item = page.get_by_role(
"menuitem", name = re.compile(r"Compare chat", re.I)
).first
if compare_item.count() == 0:
more_trigger.click(force = True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In Playwright, locators are lazy and represent a query formulation rather than a static element reference. Calling .count() or any other action/query on compare_item will automatically re-evaluate the locator against the current DOM. Re-assigning compare_item = page.get_by_role(...) multiple times is redundant and can be safely removed to simplify the code.

Suggested change
if compare_item.count() == 0:
# The plus menu was decluttered: Compare chat now lives in the
# "More" submenu; hover (then click as fallback) to open it.
more_trigger = page.get_by_role("menuitem", name = re.compile(r"^More$", re.I)).first
if more_trigger.count() > 0:
more_trigger.hover()
page.wait_for_timeout(400)
compare_item = page.get_by_role(
"menuitem", name = re.compile(r"Compare chat", re.I)
).first
if compare_item.count() == 0:
more_trigger.click(force = True)
if compare_item.count() == 0:
# The plus menu was decluttered: Compare chat now lives in the
# "More" submenu; hover (then click as fallback) to open it.
more_trigger = page.get_by_role("menuitem", name = re.compile(r"^More$", re.I)).first
if more_trigger.count() > 0:
more_trigger.hover()
page.wait_for_timeout(400)
if compare_item.count() == 0:
more_trigger.click(force = True)
page.wait_for_timeout(400)

@danielhanchen
danielhanchen merged commit 2599f9f into main Jun 10, 2026
17 of 21 checks passed
@danielhanchen
danielhanchen deleted the fix/playwright-compare-chat-submenu branch June 10, 2026 15:05
danielhanchen pushed a commit to oobabooga/unsloth that referenced this pull request Jun 10, 2026
Brings the Playwright chat UI driver fix (unslothai#6153) that follows Compare
chat into the More submenu; the previous merge predated it, which is
why Chat UI Tests failed on this branch with 'Compare chat item not
found'.
danielhanchen added a commit that referenced this pull request Jun 11, 2026
PR #6153 taught the chat UI driver to find Compare chat inside the
decluttered plus menu (#6140) but the extra UI driver kept looking for
the old top-level item, so all three Studio UI CI workflows have been
red on main since (Compare nav not found). Mirror the same
hover-then-click More fallback here.
danielhanchen added a commit that referenced this pull request Jun 11, 2026
…er (#6177)

PR #6153 taught the chat UI driver to find Compare chat inside the
decluttered plus menu (#6140) but the extra UI driver kept looking for
the old top-level item, so all three Studio UI CI workflows have been
red on main since (Compare nav not found). Mirror the same
hover-then-click More fallback here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants