You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: replace KolPopover with PopoverFC in components
- Updated the KolPopoverButton and KolSplitButton components to use the new PopoverFC functional component.
- Removed the legacy KolPopover component and its associated tests.
- Introduced PopoverController and popoverPropsConfig for managing popover state and props.
- Added align and show props for the new PopoverFC to control visibility and positioning.
- Updated documentation to reflect changes in naming conventions and component architecture.
Copy file name to clipboardExpand all lines: packages/components/src/components/_skeleton/ARC42.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,9 +72,22 @@ This modular layout is the backbone for the architectural patterns described in
72
72
-**Stencil** is used for authoring web components with **shadow: true** only (Shadow DOM enabled for style isolation).
73
73
- Components without Shadow DOM (`shadow: false`) are implemented as **Functional Components** instead of web components to avoid style conflicts and reduce maintainability burden.
74
74
- Components must compile to framework-agnostic Custom Elements.
75
-
- Public API properties use an underscored naming convention (e.g. `_name`) to separate external inputs from internal state.
75
+
-**Public API properties (Web Component Props/Attributes) use an underscored naming convention** (e.g. `_name`) to separate external inputs from internal state. This convention applies **only at the Web Component boundary** (Props in `@Prop()` decorators). Internally, controller state, render props, and functional component parameters do **not** use underscore prefixes — they use clear, self-describing names (`visible`, `count`, `label`). The underscore signals "this is a managed property exposed to HTML consumers," not "this is internal."
76
76
- Documentation and code follow the `KoliBri` casing and repository conventions.
77
77
78
+
### Naming Conventions Across Layers
79
+
80
+
The underscore naming convention is **scoped to the Web Component public API boundary**. Here's how naming changes across layers:
|**Web Component (Public API)**|`_name`, `_visible`, `_label`| Signals managed properties exposed to HTML consumers via `@Prop()`|
85
+
|**Controller (Internal State)**|`name`, `visible`, `label`, `count`| Clear, self-describing state names — no underscore prefix needed |
86
+
|**Functional Component (Render Props)**|`visible`, `align`, `count`| Parameters passed from controller — no underscore prefix |
87
+
|**Schema Helpers**|`nameProp`, `visibleProp`| Prop definitions for validation and normalization |
88
+
89
+
**Rule of thumb**: Use underscore (`_`) **only** where consumers interact with the component via HTML (Web Component `@Prop()` decorators). Everywhere else — controllers, state, derived values, render props — use natural, descriptive names.
90
+
78
91
## 3. Context and Scope
79
92
80
93
The skeleton lives inside `packages/components` and does not depend on runtime frameworks. External consumers interact through HTML attributes or DOM APIs.
@@ -85,7 +98,7 @@ The skeleton lives inside `packages/components` and does not depend on runtime f
85
98
-**Encapsulation**: Components maintain consistent appearance regardless of host environment
Components that historically did not use Shadow DOM (`shadow: false`) are being migrated to **Functional Components** instead, which can be composed into other components without Shadow DOM overhead while maintaining clean architectural separation.
101
+
**Shadow DOM is mandatory for all KoliBri Web Components.** Components with `shadow: false` (historically suffixed `-wc`) are considered legacy and will be fully replaced and removed. The migration target is the Skeleton Pattern: each such component is rewritten as a proper Shadow DOM Web Component paired with a Functional Component for internal composition. No new `shadow: false` components will be introduced. The `-wc` variants are not a supported architecture going forward.
| Felddeklaration `_name!: string`|**Ja** — via `ComponentProps<T>` in `WebComponentInterface`| compile error |
12
-
|`@Prop()` Decorator |**Nein**| kein Attribut-Binding, silent runtime bug |
13
-
|`@Watch('_name')` Decorator |**Nein** (`watchName()` Methode wird erzwungen, aber nicht der Decorator) | Stencil ruft Methode nie auf, silent runtime bug |
14
-
| Forwarding in `componentWillLoad()`|**Nein**| Prop-Wert kommt nie im Controller an |
9
+
| Teil | Type-erzwungen? | Was passiert bei Fehlen|
| Felddeklaration `_name!: string`|**Ja** — via `ComponentProps<T>` in `WebComponentInterface`| compile error|
12
+
|`@Prop()` Decorator |**Nein**| kein Attribut-Binding, silent runtime bug|
13
+
|`@Watch('_name')` Decorator |**Nein** (`watchName()` Methode wird erzwungen, aber nicht der Decorator) | Stencil ruft Methode nie auf, silent runtime bug |
14
+
| Forwarding in `componentWillLoad()`|**Nein**| Prop-Wert kommt nie im Controller an|
15
15
16
16
## Aktueller Stand
17
17
18
-
`implements WebComponentInterface<SkeletonApi>` ist korrekt und schon vorhanden — es deckt alles ab, was TypeScript abdecken *kann*. Die Lücke ist Stencil-spezifisch: Stencil-Decorators sind reine Metadaten und für das TypeScript-Typsystem unsichtbar.
18
+
`implements WebComponentInterface<SkeletonApi>` ist korrekt und schon vorhanden — es deckt alles ab, was TypeScript abdecken _kann_. Die Lücke ist Stencil-spezifisch: Stencil-Decorators sind reine Metadaten und für das TypeScript-Typsystem unsichtbar.
@@ -83,39 +83,11 @@ export class KolPopoverButton implements PopoverButtonProps {
83
83
// Reset the flag after the event loop tick.
84
84
this.justClosed=false;
85
85
},10);// timeout of 0 should be sufficient but doesn't work in Safari Mobile (needs further investigation).
86
-
}else{
87
-
if(this.refPopover){
88
-
/**
89
-
* Avoid "flicker" by hiding the element until the position is set in the `toggle` event handler. `alignFloatingElements` is responsible for setting the visibility back to 'visible'.
0 commit comments