Skip to content

Deprecate style set entries that are no longer used for rendering - #5881

Merged
Eugene (OEvgeny) merged 5 commits into
mainfrom
OEvgeny/dev-note-unused-style-sets
Oct 17, 2026
Merged

Eugene (OEvgeny) merged 5 commits into
mainfrom
OEvgeny/dev-note-unused-style-sets

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog Entry

Deprecated

  • Style set entries that are no longer used for rendering since 4.19.0 are being deprecated, in PR #5881, by @OEvgeny. They will be removed on or after 2028-10-16
    • activityButton, activityCopyButton, basicTranscript, bubble, carouselFilmStrip, carouselFilmStripAttachment, carouselFlipper, citationModalDialog, linkDefinitions, renderMarkdown, sendStatus, stackedLayout, textContent, and thumbButton
    • Full bundle: adaptiveCardRenderer, animationCardAttachment, and audioCardAttachment
    • Customizing these entries has no effect, please use style options instead

Description

Since components moved to CSS modules in 4.19.0, 17 style set entries no longer style anything, but they are still part of createStyleSet() and look live. Developers who customize them see no change, and contributors were sent to files like CarouselFlipper.ts while the live styles were in CarouselLayout.module.css.

This PR deprecates these entries. Each one is marked @deprecated with since when it is not used for rendering, where the live styles are, and the removal date. Nothing is removed from the public API, so code that reads or sets these entries does not break.

Design

A style set entry counts as unused when no component reads it from useStyleSet(). useStyleSet() is the only way components read the style set, and every call destructures named entries. All PRs below shipped in 4.19.0 (paths relative to each package's src/):

Since Style set entries Live styles
#5506 stackedLayout Activity/StackedLayout.module.css
#5553 basicTranscript Transcript/TranscriptFocus/TranscriptFocus.module.css
#5666 full bundle: adaptiveCardRenderer, animationCardAttachment, audioCardAttachment adaptiveCards/Attachment/*.module.css
#5668 bubble, carouselFilmStrip, carouselFilmStripAttachment, carouselFlipper Activity/*.module.css (flippers: CarouselLayout.module.css)
#5669 sendStatus, thumbButton ActivityStatus/ActivityStatus.module.css, ActivityFeedback/private/ThumbButton.module.css
#5670 activityButton, activityCopyButton, citationModalDialog, linkDefinitions, renderMarkdown, textContent Attachment/Text/**/*.module.css, LinkDefinition/LinkDefinitions.module.css, hooks/RenderMarkdown.module.css

The deprecation follows the existing convention: @deprecated ... will be removed on or after YYYY-MM-DD, about 2 years after the deprecation, as for useSuggestedActions() (packages/api/src/hooks/useSuggestedActions.ts) and avatarMiddleware (packages/api/src/hooks/Composer.tsx).

  • @deprecated is on the entries of createStyleSet() and on the AdaptiveCardsStyleSet type, so TypeScript and VS Code (also for JavaScript) strike them through for developers.
  • useStyleSet() now returns a mapped type over createStyleSet() instead of Record<>, so the deprecation also shows on the hook result. Keys and mutability are unchanged.
  • The note in each style set file is now a @deprecated JSDoc on its factory function, so contributors do not edit the wrong file.
  • CodeBlock.ts, CodeBlockCopyButton.ts, and ViewCodeDialog.ts are deleted. They are not public and nothing imports them since fix: allow focusing code block contents #5575 removed them from createStyleSet().
  • No runtime warning is added. Style options warn once via warnOnce() in normalizeStyleOptions(), but a styleSet prop always contains every entry (developers start from createStyleSet()), so detecting a customized entry would need a deep comparison with the defaults. This can be added later if needed.

Follow-up: sample 02.branding-styling-and-customization/b.idiosyncratic-manual-styles customizes styleSet.textContent, which has no effect since 4.19.0. It should move to a style option (e.g. primaryFont) or another entry in a separate PR.

Specific Changes

  • Added @deprecated with the removal date (2028-10-16) to 14 entries in packages/component/src/Styles/createStyleSet.ts and 3 properties of packages/bundle/src/adaptiveCards/AdaptiveCardsStyleSet.ts

  • Replaced the note in each of the 17 style set files with a @deprecated JSDoc on the factory function

  • Changed the return type of useStyleSet() from Record<> to a mapped type, so @deprecated carries over

  • Deleted CodeBlock.ts, CodeBlockCopyButton.ts, and ViewCodeDialog.ts under packages/component/src/Styles/StyleSet/

  • Added a ### Deprecated entry to CHANGELOG.md

  • I have added tests and executed them locally

  • I have updated CHANGELOG.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)

Components moved to CSS modules (#5506, #5553, #5575, #5666, #5668, #5669,
#5670) but the old style set files still look live. Add a two-line comment to
each one saying since which PR it is unused and where the live styles are, so
readers do not edit the wrong file. Nothing is removed: `createStyleSet()`
still returns these entries.

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.

🟢 Approval recommended

The changes only add documentation comments, with no unresolved issues or runtime behavior changes.

No open issues 🎉

What changed in this PR

Documents legacy style sets so contributors can find the CSS modules that now control rendering. Runtime code and public APIs remain unchanged.

Changes:

  • Adds migration notes to 17 unused style set entries and 3 unimported files.
  • Points each file to its live styles and the relevant migration PR.
File Description
packages/​component/​src/​Styles/​StyleSet/​ViewCodeDialog.ts Notes removal and live dialog styles.
packages/​component/​src/​Styles/​StyleSet/​ThumbButton.ts Points to feedback button styles.
packages/​component/​src/​Styles/​StyleSet/​TextContent.ts Points to text content styles.
packages/​component/​src/​Styles/​StyleSet/​StackedLayout.ts Points to stacked layout styles.
packages/​component/​src/​Styles/​StyleSet/​SendStatus.ts Points to activity status styles.
packages/​component/​src/​Styles/​StyleSet/​RenderMarkdown.ts Points to Markdown styles.
packages/​component/​src/​Styles/​StyleSet/​LinkDefinitions.ts Points to link definition styles.
packages/​component/​src/​Styles/​StyleSet/​CodeBlockCopyButton.ts Notes removal and live copy button styles.
packages/​component/​src/​Styles/​StyleSet/​CodeBlock.ts Notes removal and live code block styles.
packages/​component/​src/​Styles/​StyleSet/​CitationModalDialog.ts Points to citation modal styles.
packages/​component/​src/​Styles/​StyleSet/​CarouselFlipper.ts Locates flipper styles in carousel layout.
packages/​component/​src/​Styles/​StyleSet/​CarouselFilmStripAttachment.ts Points to carousel attachment styles.
packages/​component/​src/​Styles/​StyleSet/​CarouselFilmStrip.ts Points to carousel filmstrip styles.
packages/​component/​src/​Styles/​StyleSet/​Bubble.ts Points to bubble styles.
packages/​component/​src/​Styles/​StyleSet/​BasicTranscript.ts Points to transcript focus styles.
packages/​component/​src/​Styles/​StyleSet/​ActivityCopyButton.ts Points to activity copy button styles.
packages/​component/​src/​Styles/​StyleSet/​ActivityButton.ts Points to activity button styles.
packages/​bundle/​src/​adaptiveCards/​Styles/​StyleSet/​AudioCardAttachment.js Points to audio and video content styles.
packages/​bundle/​src/​adaptiveCards/​Styles/​StyleSet/​AnimationCardAttachment.js Points to animation and sign-in styles.
packages/​bundle/​src/​adaptiveCards/​Styles/​StyleSet/​AdaptiveCardRenderer.ts Points to Adaptive Card renderer styles.

Review effort: Balanced

@OEvgeny

Copy link
Copy Markdown
Collaborator Author

This can be made even better

those style set should add deprecated, explain it is not used, and removed soon.

Per review, turn the notes into proper deprecations, following the existing
`@deprecated ... will be removed on or after YYYY-MM-DD` convention with the
usual 2-year window.

- Mark the 14 unused `createStyleSet()` entries and the 3 unused full-bundle
  entries (`AdaptiveCardsStyleSet`) `@deprecated`: not used for rendering since
  4.19.0, where the live styles are, removed on or after 2028-10-16
- Move the per-file note into a `@deprecated` JSDoc on each style factory
- Type `useStyleSet()` with a mapped type instead of `Record<>` so the
  deprecation also shows on the hook result (same keys, same mutability)
- Delete `CodeBlock.ts`, `CodeBlockCopyButton.ts`, and `ViewCodeDialog.ts`,
  which nothing imports since #5575 and are not public
- Add a `### Deprecated` changelog entry
@OEvgeny Eugene (OEvgeny) changed the title Note style sets that are no longer used for rendering Deprecate style set entries that are no longer used for rendering Oct 17, 2026
@OEvgeny

Eugene (OEvgeny) commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Done: the 17 entries are now @deprecated (visible on createStyleSet(), AdaptiveCardsStyleSet and useStyleSet()), each saying it is no longer used for rendering, where the live styles are, and removal on or after 2028-10-16 (the usual 2-year window, happy to shorten). Also added a ### Deprecated changelog entry and deleted the 3 files nothing imported.

Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Co-authored-by: William Wong <compulim@users.noreply.github.com>
Comment thread packages/component/src/hooks/useStyleSet.ts Outdated
@OEvgeny
Eugene (OEvgeny) enabled auto-merge (squash) October 17, 2026 06:42
@OEvgeny
Eugene (OEvgeny) merged commit 45d9da0 into main Oct 17, 2026
32 checks passed
@OEvgeny
Eugene (OEvgeny) deleted the OEvgeny/dev-note-unused-style-sets branch October 17, 2026 07:02
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