openui / open-ui

Maintain an open standard for UI and promote its adherence and adoption.
https://open-ui.org
Other
3.54k stars 191 forks source link

Definition of a "control"? #81

Open dandclark opened 4 years ago

dandclark commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Terms I see used in the site:

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:

gregwhitworth commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 3 years ago

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[bot] commented 2 years ago

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 commented 6 months ago

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

github-actions[bot] commented 3 weeks ago

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.