Skip to content

fix(chat-ao): use distinct Coworker icon for New chat button - #790

Open
yevheniia0831 wants to merge 16 commits into
mainfrom
ew-coworker-new-chat-icon
Open

yevheniia0831 wants to merge 16 commits into
mainfrom
ew-coworker-new-chat-icon

Conversation

@yevheniia0831

@yevheniia0831 yevheniia0831 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Yevheniia Severinovska and others added 4 commits September 29, 2026 16:44
Was reusing the generic 'add' icon shared with the attach-files
button. Adds S2_Icon_Coworker_20_N.svg (sourced from the AI Mark
asset Markus shared) and wires it into the New chat trigger only.

Fix adobe/da-live#1355

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A rejected promise from a module-scope 'const x = await loadHrefSvg(...)'
(as in chat-ao.js and whatsnew.js) fails the whole module's evaluation,
so customElements.define never runs and the component never upgrades.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Base

codeBase is set by the host (da-live) to its own origin, independent of
which nx2 branch is loaded via ?nx=. That's why the Coworker icon (which
only exists in da-nx, not yet published to da-live) 404'd and silently
fell back to the old '+' icon. ICONS_BASE resolves relative to nx2's own
import.meta.url, so it correctly follows an ?nx= branch override.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aem-code-sync

aem-code-sync Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
In case there are problems, just click the checkbox below to rerun the respective action.

  • Re-sync branch
Commits

Comment thread nx2/blocks/chat-ao/chat-ao.js Outdated
// Uses ICONS_BASE (nx2's own origin), not codeBase: codeBase is da-live's
// origin (see da-live/scripts/scripts.js), so an icon not yet published to
// da-live must be loaded from wherever this nx2 bundle itself is hosted.
const newChatIcon = (await loadHrefSvg(`${ICONS_BASE}S2_Icon_Coworker_20_N.svg`)) ?? icon('add');

@sharanyavinod sharanyavinod Oct 6, 2026 •

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.

Lets upload the coworker icon on da live content and use the same pattern as the other icons. I can help uploading if needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sharanyavinod, not sure I have CDN access. Can you tell me how to get it/upload the icon?

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.

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.

also please remove the comment. One const des not need 5 lines of comments :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

must have sneaked from copilot, sorry

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.

Yes, it happens for me as well. I think LLM likes long comments. We maybe should add this to Claude MD to make sure they keep the comments short.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's there, but it gets ignored.
Is adding a lint rule for this overengineering?

Comment thread docs/chat-ao-component.md Outdated
Comment on lines +789 to +807
## New chat icon

The "New chat" button uses a distinct Coworker icon
(`nx2/img/icons/S2_Icon_Coworker_20_N.svg`) instead of the shared `+` icon
used elsewhere, so it's visually distinguishable as starting a fresh
Coworker session rather than a generic add action. It's loaded via
`loadHrefSvg` (`nx2/utils/svg.js`) rather than the CDN `icon()` helper
because the asset isn't (yet) published to the shared icon CDN. If the
fetch fails for any reason, the button falls back to the old `+` icon
(`icon('add')`) rather than rendering blank.

It's fetched from `ICONS_BASE` (`nx2/utils/svg.js`), not `codeBase`.
`codeBase` is set by the host (e.g. da-live's `scripts/scripts.js`) to the
*host's own* origin, independent of which nx2 branch is loaded via `?nx=`
— existing CDN icons resolve through it only because they're already
published on the host's side. `ICONS_BASE` instead resolves relative to
wherever this nx2 bundle itself was loaded from, so it correctly follows
an `?nx=` branch override for icons that only exist in this repo.

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.

can you shorten this? reads more like a work log then a spec. maybe remove it the icon does not need extra docs.

Comment thread nx2/utils/svg.js Outdated
Comment on lines +11 to +13
// Never reject: a caller awaiting this at module top level (e.g. a
// module-scope `const icon = await loadHrefSvg(...)`) would otherwise
// fail the whole module's evaluation on a network hiccup.

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.

Same as the other file, please remove the long comments

Yevheniia Severinovska and others added 2 commits October 6, 2026 18:01
Icon is now published to da-live's shared icon CDN
(s2-icon-coworker-20-n.svg), so switch to the standard icon() pattern
used by every other icon instead of the ICONS_BASE/loadHrefSvg fallback.
Also trims verbose comments per review feedback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…arent one

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… Coworker product reference

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…agnostic naming

Same CDN asset (s2-icon-coworker-20-n.svg), but the internal icon key
no longer ties the UI to one backend. Addresses Sharanya's PR #790
concern that the chat UI is being extended to support CMA alongside
Coworker.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… glyph shape

Matches existing ICON_NAMES convention (keys describe the icon shape,
e.g. add/clear/close/send/stop/mic), not a product/backend name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Yevheniia Severinovska and others added 2 commits October 6, 2026 19:27
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…real product

Adds .nx-btn-ai modifier: full pill radius (--s2-corner-radius-800) and
a pink/orange/yellow pastel gradient background, matching the actual
Coworker app's New chat button (screenshot reference), using existing
design tokens so light/dark mode works automatically.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Real product's computed styles show a plain background-color (no
gradient property on the button), so the pastel look is a blurred
colored box-shadow glow around a plain pill, not a gradient fill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ence

Keep the pastel gradient fill matching the reference screenshot, and
pick up font-weight: 700 from the real button's own computed styles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
ew-coworker-new-chat-icon — cc0cb876 Deployed Oct 6, 2026 by aem-code-sync[bot]
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.

[ew] "New chat" button should use a distinct Coworker icon instead of generic "+"

3 participants