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

Definition of a "control"? #81

Open
dandclark opened this issue May 1, 2020 · 9 comments · Fixed by #97
Open

Definition of a "control"? #81

dandclark opened this issue May 1, 2020 · 9 comments · Fixed by #97

Comments

@dandclark
Copy link
Collaborator

Would it be useful to include a more-or-less formal definition of a "control" somewhere in the docs? The select Editor's Draft uses the term but I'm not sure whether there's actually a formal definition. If nothing else this could help clarify the Charter regarding which kinds of widgets fall under the purview of OpenUI.

One way to attempt a definition would be to describe what a control does, e.g.:

A control is an HTMLElement with these properties:

  1. Maintains a value that is reflected in the value property. Fires input and change events corresponding to changes in the control's value.*
  2. Has a common set of APIs for validation of its value (validity, validationMessage, willValidate, checkValidity(), reportValidity(), the invalid event, and others that are specific to particular control types).
  3. Participates in <form>s and form submission.
  4. Has some user interface that allows a user to interact with the control to view and/or change its value.*

* Partial exception: <input type=”button”> and <input type=”submit”> don’t fire input/change events and their value cannot be changed by user interaction, only viewed (as button text).

@matthewp
Copy link
Contributor

matthewp commented May 2, 2020

I agree. The table example doesn't fall under that definition of a control, so it seems there's at least a couple of types of elements open UI is interested in:

  1. Interactive elements - elements with more than one state. States can be changed through user interaction.
  2. A subset of (1) that participate in forms (is this a control?)

@matthewp
Copy link
Contributor

matthewp commented May 2, 2020

Terms I see used in the site:

  • Component
  • Interactive element
  • Control

Are these all the same thing? Are they different? We should define and consolidate on usage.

One I didn't see but has historic usage:

  • Widget

@gregwhitworth
Copy link
Member

It is important to note that Open UI is not solely about controls although I do like creating a definition for a control. Looking at WHATWG this doesn't seem to be define their either. I think Widget is an overloaded term however in that it encapsulates both components and controls. We use the term component through the charter and contribution docs and likewise a component can technically be a control or contain controls as well. So I like defining both of them. What about:

Components

A component is an encapsulation of one or more concepts that fulfills a specific task within an application. A component may contain other components, these are referred to as composite components. This allows the consumer of the component to leverage the functionality that the component provides without needing to re-create the entire component.

Controls

Controls are a specific type of component that allow for end user input to facilitate an action based on that input.

@gregwhitworth
Copy link
Member

I was just speaking with Bo, and I think in addition we should probably try to define the model overall of a control in addition to just the definition of a control (which I know you're looking into @dandclark). For example, parts have a special meaning to the control and more important to how they are handled by the "controller" code and modify the state of the control's model.

@gregwhitworth
Copy link
Member

gregwhitworth commented Oct 12, 2020

Updated proposal: A control is a UI component that manages user interaction. The control has controller code that manages changes in its state and its model based on user interaction with its parts.

This was discussed on a call between the CSSWG & Open UI and there was a desire to re-discuss this. As such I've pasted the latest thinking above and reopening this issue.

@boazsender
Copy link
Contributor

I think it would be more accessible to define this term without using MVC terminology. I also think it would be possible to take the word "component", and still be clear. How about something like:

A control is a piece of user interface that manages user interaction, including changes to its own state and data.

or even

A control is a piece of user interface that manages changes to its own state and data.

@no-identd
Copy link

no-identd commented Aug 7, 2021

https://www.iso.org/obp/ui/#iso:std:iso-iec:2382:ed-1:v1:en even ISO doesn't dare define the terms 'control' & 'component', albeit they do define quite a few related/relatable terms.

@github-actions
Copy link

There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

@bkardell
Copy link
Collaborator

Not stale really, this is currently actively being discussed in the discord in a way

@bkardell bkardell removed the stale label Mar 21, 2024
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 a pull request may close this issue.

6 participants