microsoft / microsoft/AdaptiveCards

Control default styling for "style":"heading" via host config

Open
#5,627 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Breaking Change Epic Spec
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

This work tracks adding a host config setting to change the defaults for text blocks that have "style" : "heading".

This will be accomplished with the following changes:

  • textStyles will be added to host config. For this feature the only style supported will be heading as shown below with the default values set:
"textStyles": {
    "heading": {
        "size": "large",
        "weight": "bolder",
        "color": "default",
        "isSubtle": false,
        "fontType": "default"
    }
}
  • The headings host config previously introduced will be renamed as follows. The heading level is not included in the textStyle above directly because in the future textStyle may be applied to text other than TextBlock where headingLevel will not apply (TextRun, input labels, etc.). Configuration of per-style heading level is out of scope for this epic:
  "textBlock": {
      "headingLevel": 2
  }
  • The existing text styling host config class will be renamed to indicate that it is FactSet specific. This is a BREAKING CHANGE for the API surfaces.
  • A base text style config class covering size, weight, color, isSubtle, and fontType should be introduced, with the FactSet specific class inheriting from it.
  • The style property on TextBlock will be made nullable. If unset the default style will be applied. (In the future, a TextBlock with an unset style may inherit it's style from it's container. Such features are out of scope of this epic.)
  • The size, weight, color, isSubtle, and fontType properties on TextBlock will be made nullable. If these properties are unset, the TextBlock will be rendered using the values defined in the host config for the given style. If style is unset, the TextBlock will be rendered using the documented defaults for the property. This is a BREAKING CHANGE for the API surfaces.
  • The above properties will also be made nullable on TextRun. This both simplifies the implementation as those properties are inherited from a shared base class in several of our implementations, and allows for style on TextRun in the future. This is a BREAKING CHANGE for the API surfaces.
  • Adding style to TextRun is out of scope for this epic because the only style we currently support is heading, which doesn't make sense on a TextRun.
  • The existing paragraph style will be renamed default.
  • The ability to configure the default style and the introduction of any styles other than heading are out of scope for this epic, but may be added in the future.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the host config, TextBlock, TextRun, and existing FactSet-specific text styling definitions in the C# implementation. Trace how their properties are rendered and how API changes are tested; done means the heading defaults, nullable properties, renames, inheritance, and documented out-of-scope boundaries are represented consistently across the affected API surfaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.