Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(split-button): make downloadable and linkable #11520

Merged
merged 4 commits into from
Feb 12, 2025

Conversation

josercarcamo
Copy link
Contributor

Related Issue: #9126

Summary

Implemented ability to make the primary part of a split button into a downloadable link or an href link.

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Feb 11, 2025
@josercarcamo josercarcamo added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Feb 11, 2025
@josercarcamo josercarcamo changed the title fix(split-button): set downloadable and href for links fix(split-button): make downloadable and link Feb 11, 2025
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗
🔗⏯️🔗🔗🔗⏯️🔗🔗⏯️⏯️🔗🔗⏯️⏯️⏯️🔗🔗⏯️⏯️⏯️🔗⏯️⏯️⏯️⏯️🔗⏯️🔗
🔗⏯️⏯️🔗🔗⏯️🔗⏯️🔗🔗⏯️🔗🔗⏯️🔗🔗⏯️🔗🔗🔗🔗⏯️🔗🔗🔗🔗⏯️🔗
🔗⏯️🔗⏯️🔗⏯️🔗⏯️🔗🔗⏯️🔗🔗⏯️🔗🔗⏯️🔗🔗🔗🔗⏯️⏯️⏯️🔗🔗⏯️🔗
🔗⏯️🔗🔗⏯️⏯️🔗⏯️🔗🔗⏯️🔗🔗⏯️🔗🔗⏯️🔗🔗🔗🔗⏯️🔗🔗🔗🔗🔗🔗
🔗⏯️🔗🔗🔗⏯️🔗🔗⏯️⏯️🔗🔗⏯️⏯️⏯️🔗🔗⏯️⏯️⏯️🔗⏯️⏯️⏯️⏯️🔗⏯️🔗
🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗🔗

Once comments are addressed, this should be good to merge!

@@ -21,6 +21,22 @@ describe("calcite-split-button", () => {
propertyName: "placement",
defaultValue: "bottom-end",
},
{
Copy link
Member

Choose a reason for hiding this comment

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

Awesome! Can you also add reflects tests for these new props?

@@ -287,3 +287,35 @@ export const appearanceAndKindCombinations_TestOnly = (): string => html`
`;

export const loadingAndDisabled_TestOnly = (): string => html`<calcite-button loading disabled>Test</calcite-button>`;

export const primaryAsALink_TestOnly = (): string =>
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove the _TestOnly suffixes? These were required at some point, but aren't anymore. We'll be updating story names with #9085, but omitting them now avoids the screenshot test diff the rename will produce.

const page = await newE2EPage();
await page.setContent(`<calcite-split-button href="/">Continue</calcite-split-button>`);

const elementAsLink = await page.find("calcite-split-button >>> a");
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: Since this relies on calcite-button’s internal implementation, the test could be simplified to assert that the internal button receives the expected props. This also avoids coupling to its implementation details.

@jcfranco
Copy link
Member

Looking at the title and implementation, I think this could use the feat commit type (PR title).

Also, minor suggestion for consistency: make downloadable and linkable or add support for downloads and links?

@jcfranco
Copy link
Member

@ashetland @SkyeSeitz Can you take a look at the new screenshots? This is pretty similar to button, so there shouldn't be any surprises.

@ashetland
Copy link
Contributor

Looks good to me! Super nitpick: should the new stories be at medium scale like the rest of them? Truly hesitated to even ask this one 🤣.

@josercarcamo josercarcamo changed the title fix(split-button): make downloadable and link feat(split-button): make downloadable and linkable Feb 12, 2025
@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Feb 12, 2025
@josercarcamo josercarcamo added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. labels Feb 12, 2025
@josercarcamo josercarcamo added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Feb 12, 2025
@josercarcamo josercarcamo merged commit f87097f into dev Feb 12, 2025
17 checks passed
@josercarcamo josercarcamo deleted the josercarcamo/9126-split-button-href branch February 12, 2025 23:27
@github-actions github-actions bot added this to the 2025-02-25 - Feb Milestone milestone Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants