Skip to content

Convert the send box buttons to CSS modules - #6044

Merged
Eugene (OEvgeny) merged 10 commits into
mainfrom
OEvgeny/fix-css-modules-send-box-buttons
Nov 12, 2026
Merged

Eugene (OEvgeny) merged 10 commits into
mainfrom
OEvgeny/fix-css-modules-send-box-buttons

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Continues the CSS Modules migration (#6024, #6028, #6030, #6031, #6032, #6036) with the send box buttons.

Changelog Entry

Changed

  • Converted the send box buttons to CSS Modules with webchat__ class names and their style options to custom properties, in PR #6044, by @OEvgeny

Removed

  • 💥 Deprecated the microphoneButton, sendBoxButton and uploadButton style set entries, which no longer affect rendering, in PR #6044, by @OEvgeny

Description

The send box icon, upload and microphone buttons and the attachment icon move from emotion to CSS Modules without snapshot changes. Their 18 style options become custom properties; 3 style set entries are deprecated.

Design

  • One custom property per option rather than grouped state colors; an unset state option falls back to the base option through var(), as emotion did. The button size reuses the send box height property.
  • Every webchat__ class stays; the send box grid places the upload and send buttons with module classes.
  • Dropped rules that matched nothing: the upload button's .icon > svg fills, gridTemplateArea (not a CSS property) and __checkmark-icon.

Specific Changes

  • SendBox/SendBox.module.css: icon button, upload button, attachment icon and microphone button regions
  • CSSCustomPropertiesContainer.tsx, CustomPropertyNames.ts: 18 new properties
  • IconButton, SendButton, MicrophoneButton, UploadButton, AttachmentIcon: useStyles()
  • createStyleSet.ts, 3 StyleSet/*.ts: @deprecated
  • styleOptions/sendBoxButton.undefined.html: snapshots 1–5, base colors in every state but hover (same before)
  • styleOptions/microphoneButton.html (+ .undefined): dictating icon color, set and not set (same before)
  • I have added tests and executed them locally
  • I have added .changelog/<PR#>-<slug>.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Copilot AI 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.

🔵 Needs a closer look

Human browser verification is needed for snapshot parity, keyboard focus indicators, and forced-colors dictation styling because the dependency-free review environment cannot run the Selenium/HTML suite.

No open issues 🎉

What changed in this PR

Continues the CSS Modules migration by moving send box buttons and attachment icons off Emotion style sets while retaining their public webchat__ classes.

Changes:

  • Moves button styling into CSS Modules and maps 18 style options to custom properties.
  • Deprecates three legacy style set entries that no longer affect rendering.
  • Adds visual tests for unset button-state options and microphone dictation colors.
File Description
packages/​component/​src/​Styles/​StyleSet/​UploadButton.ts Documents upload style set deprecation.
packages/​component/​src/​Styles/​StyleSet/​SendBoxButton.ts Documents button style set deprecation.
packages/​component/​src/​Styles/​StyleSet/​MicrophoneButton.ts Documents microphone style set deprecation.
packages/​component/​src/​Styles/​CustomPropertyNames.ts Defines 18 button custom property names.
packages/​component/​src/​Styles/​CSSCustomPropertiesContainer.tsx Maps button options to custom properties.
packages/​component/​src/​Styles/​createStyleSet.ts Marks three legacy entries deprecated.
packages/​component/​src/​SendBoxToolbar/​UploadButton.tsx Applies module classes to the upload control.
packages/​component/​src/​SendBoxToolbar/​Assets/​AttachmentIcon.tsx Migrates attachment styling and removes unused rules.
packages/​component/​src/​SendBox/​SendButton.tsx Uses a module class for send-button placement.
packages/​component/​src/​SendBox/​SendBox.module.css Adds button, attachment, and microphone styles.
packages/​component/​src/​SendBox/​MicrophoneButton.tsx Applies module classes to microphone states.
packages/​component/​src/​SendBox/​IconButton.tsx Migrates shared button and focus-indicator classes.
.changelog/​6044-fix-css-modules-send-box-buttons.md Records the migration and deprecations.
__tests__/​html2/​styleOptions/​sendBoxButton.undefined.html Covers unset state colors and button sizing.
__tests__/​html2/​styleOptions/​microphoneButton.undefined.html Runs the unset dictation-color variant.
__tests__/​html2/​styleOptions/​microphoneButton.html Covers explicit and unset dictation colors.

Review effort: Balanced

@OEvgeny
Eugene (OEvgeny) merged commit 644cee4 into main Nov 12, 2026
45 of 46 checks passed
@OEvgeny
Eugene (OEvgeny) deleted the OEvgeny/fix-css-modules-send-box-buttons branch November 12, 2026 23:29
Eugene (OEvgeny) added a commit that referenced this pull request Nov 14, 2026
…es (#6050)

* Test the scroll to end button and file attachment style options

New pages, with snapshots written on main (before the conversion):

- styleOptions/transcriptOverlayButton: every scroll to end button option,
  idle, focused, focused and hovered, hovered.
- styleOptions/transcriptOverlayButton.undefined: undefined focus and hover
  options fall back to the hover background or the base colors.
- styleOptions/fileContent: padding, font, accent and bubble text color on a
  downloadable file and a file without a URL, idle and with the link focused.
- rtl/fileContent: the download icon on the left in right-to-left.
- scrollToEndButton/forcedColors: the button border in forced colors.

* Convert the scroll to end button and the file attachment to CSS modules

Moves the scrollToEndButton and fileContent style set entries to
ScrollToEndButton.module.css and FileContent.module.css, with the webchat__
class names (useStyles with webChatPrefixedClassName).

- scrollToEndButtonFontSize becomes --webchat__font-size--scroll-to-end-button
  (numbers get px through toLength()); the other options reuse existing
  custom properties.
- The hover and focus backgrounds of the transcript overlay button are unset
  when not set, so the button falls back to the hover or base background as
  the emotion rules did. A focus:hover rule keeps the hover background when
  the focus background is not set.
- The 2 entries are @deprecated (removal on or after 2028-10-16).

* Use a logical margin for the file download icon in right-to-left

The download icon gets margin-inline-start instead of margin-left, or
margin-right with the webchat__fileContent__downloadIcon--rtl class, so
FileContent no longer needs useDirection(). Same pixels (rtl/fileContent).

* Update the Fluent snapshots that show a file attachment

With the Fluent theme, the file attachment now uses Fluent's padding token
(8 pixels instead of 10) for itself and its download icon, so the
attachment is 4 pixels shorter (8 with a download icon) and the transcript
above it moves by the same amount. Fluent's font token also applies, which
renders the same in the test browser.

- attachment/file.noName.fluent: snapshot 1
- side-by-side/transcript.navigation.fluent(.dark): snapshots 1-9

* Say which scroll to end button snapshots repeat the previous one

* Say the forced colors scroll to end button border is outset

* Use orUnset() for the transcript overlay button hover and focus backgrounds

#6044 added orUnset() while this branch wrote the same fallback inline as
`|| 'unset'`. Same output (an unset option still becomes `unset`, so the
module's var() fallback applies), one helper for every state option.

* Add the changelog fragment

* Add the Changed entry to the changelog fragment

* Re-take the side-by-side snapshots for the 4 px shorter Fluent file attachment

---------

Co-authored-by: Eugene Olonov <eugeneolonov@microsoft.com>
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.

3 participants