actions / actions/toolkit

Adding attributes to core.summary methods

Open
#1,164 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the enhancement
Adding an additional attributes parameter to all the methods in the Summary class that add an HTML element to the summary buffer. This attributes parameter would be used to add HTML attributes to customize the created HTML element.

Code Snippet

core.summary.addDetails("Summary", {open: true, style: "font-size:20px;"});

The above piece of code would create a details tag which is by default open and all the text in it has a font size of 20px

Additional information
It seems that this functionality is pretty much implemented by the private wrap method. We just have to add the attributes parameter to the public methods and pass it down to wrap. For addTable we can add the attributes as a field in SummaryTableCell instead.
Related issues: #1146, #1090

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 in packages/core/src/summary.ts, especially the private wrap method and the public Summary methods that add HTML elements. Trace addTable and SummaryTableCell as well. Done means the relevant public methods accept and pass attributes through, while table cells can provide attributes and the generated HTML supports the documented example.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.