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

Add documentation for the "command" and "commandfor" attributes, and "command" event. #30829

Merged
merged 21 commits into from
Oct 24, 2024

Conversation

keithamus
Copy link
Contributor

@keithamus keithamus commented Dec 6, 2023

Description

This PR drafts up the documentation for "Invokers" (OpenUI explainer). This is a new experimental API for enabling buttons to control interactive elements.

Motivation

As this feature is starting to land (flagged) in 3 major browsers, it seems right to start documenting the featureset.

Additional details

Related issues and pull requests

@keithamus keithamus requested review from a team as code owners December 6, 2023 11:02
@keithamus keithamus requested review from Elchi3 and chrisdavidmills and removed request for a team December 6, 2023 11:02
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs Content:WebAPI Web API docs labels Dec 6, 2023
@teoli2003 teoli2003 marked this pull request as draft December 6, 2023 11:04
@teoli2003
Copy link
Contributor

(Converted to draft so that nobody review this, yet)

Copy link
Contributor

github-actions bot commented Dec 6, 2023

Preview URLs (9 pages)
Flaws (2)

Note! 7 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/API/Invoker_Commands_API
Title: Invoker Commands API
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.HTMLButtonElement.commandForElement

URL: /en-US/docs/Web/API/HTMLButtonElement/commandForElement
Title: HTMLButtonElement: commandForElement property
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: api.HTMLButtonElement.commandForElement

(comment last updated: 2024-10-17 19:46:10)

files/en-us/web/api/invokeevent/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/invokeevent/index.md Outdated Show resolved Hide resolved
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@bsmth bsmth added the waiting for implementations Waiting for feature to be implemented in browsers label Jul 15, 2024
@Elchi3 Elchi3 removed their request for review July 23, 2024 13:02
@github-actions github-actions bot added the size/m [PR only] 51-500 LoC changed label Sep 6, 2024
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

Thanks; I have a lot of nits proposed, but I think this looks good already.

files/en-us/web/api/commandevent/command/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/commandevent/commandevent/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/commandevent/commandevent/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/htmlbuttonelement/command/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/commandevent/source/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/invoker_commands_api/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/invoker_commands_api/index.md Outdated Show resolved Hide resolved
files/en-us/web/html/element/button/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/invoker_commands_api/index.md Outdated Show resolved Hide resolved
files/en-us/web/api/invoker_commands_api/index.md Outdated Show resolved Hide resolved
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
@Josh-Cena
Copy link
Member

Should I wait for the other reviewers to make a final pass?

@keithamus
Copy link
Contributor Author

keithamus commented Sep 26, 2024

Given it's been three days since your comment perhaps the "waiting for other reviewers" has passed anyway? (Not a judgement btw).

@Josh-Cena
Copy link
Member

I'll merge this some time next week.


{{DefaultAPISidebar("Invoker Commands API")}}

The **Invoker Commands API** provides a way to declaratively assign behaviors to buttons, allowing control of interactive elements when the button is enacted (clicked or invoked via a keypress, such as the spacebar or return key).
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps "enacted" could be replaced with another word. It doesn't quite read naturally to me. Maybe "activated", idk what the normal word mdn uses is.

@lukewarlow
Copy link
Contributor

The preview suggests there's issues with the browser compat data is that expected?

@lukewarlow
Copy link
Contributor

Is it worth mentioning the requirements around explicit type attribute when inside a form?

@Josh-Cena
Copy link
Member

The preview suggests there's issues with the browser compat data is that expected?

I think the only issue is that there's no spec URL, which is kind of expected given that whatwg/html#9841 is still open. @keithamus if you want to make an issue to BCD to keep it in the backlog it would be great.

@Josh-Cena
Copy link
Member

@keithamus Just waiting on the last bits of reviews to be addressed

Co-authored-by: Luke Warlow <luke@warlow.dev>
@keithamus
Copy link
Contributor Author

The preview suggests there's issues with the browser compat data is that expected?

I think the only issue is that there's no spec URL, which is kind of expected given that whatwg/html#9841 is still open. @keithamus if you want to make an issue to BCD to keep it in the backlog it would be great.

mdn/browser-compat-data#24739

keithamus and others added 2 commits October 17, 2024 20:39
Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
@Josh-Cena
Copy link
Member

@lukewarlow Let me know when this is good to merge

@lukewarlow
Copy link
Contributor

lukewarlow commented Oct 24, 2024

Lgtm! @keithamus do we want to wait for the html pr?

@keithamus
Copy link
Contributor Author

It doesn't seem necessary to me to wait but if people would like to I don't mind.

@Josh-Cena
Copy link
Member

Thanks for all the work everyone; since we have BCD already, I think this meets the documentation criteria and we can merge it.

@Josh-Cena Josh-Cena merged commit 3556f7a into mdn:main Oct 24, 2024
9 checks passed
@keithamus keithamus deleted the draft-invokers-api-docs branch October 25, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs Content:WebAPI Web API docs size/l [PR only] 501-1000 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants