-
Notifications
You must be signed in to change notification settings - Fork 1
feat(core): Standardize API for named text areas/zones across CardBase, Slider, and Elbow (multi-zone system) #321
Copy link
Copy link
Closed
2 / 22 of 2 issues completedClosed
2 / 22 of 2 issues completed
Copy link
Labels
core-textRelated to text fieldsRelated to text fieldslcards-buttonRelated to lcards-button cardRelated to lcards-button cardlcards-elbowRelated to lcards-elbow cardRelated to lcards-elbow cardlcards-sliderRelated to lcards-slider cardRelated to lcards-slider card
Milestone
Description
Motivation
- Multiple card types (slider, elbow, button SVG presets) now want named text zones for text field routing (e.g., left border, right border, vertical/horizontal arm in elbows, center area, etc).
- The current implementation only supports named text areas in sliders (zones), and component SVG presets in buttons (via
componentTextAreas). There's no unified API at theLCARdSCardbase.
Proposal
1. Extend LCARdSCard base class with zone support
- Add a
_zones: Mapproperty (empty by default) toLCARdSCard. - Add a common
_injectTextFieldsToElement()supporting text area routing by zone. - Define new interface method:
_calculateZones(width, height)(to be implemented by concrete subclasses if support is desired).
2. Implement named zones by card type
- Slider:
- Populate
_zonesusing same border/center logic as now, migrated to the base interface.
- Populate
- Elbow:
- Add
_calculateZonesFromElbowGeometry(width, height)to define zones for horizontal/vertical arms, outer/inner segmented bars, body, etc. - Zones:
horizontal_bar,vertical_bar,outer_horizontal_bar,inner_vertical_bar,body, etc., as per geometry.
- Add
- Button (component SVG presets):
- Migrate current
componentTextAreasto populate_zones, so text area routing is consistent.
- Migrate current
3. Routing and Editor
- All cards with zones expose them as
text_areadropdowns for each text field in the editor. - Only valid/present zones for the current config are enabled in the editor UI.
- Default to
body(central area) if unspecified.
4. Consistency and Extensibility
- All zone routing uses the same property/interface (
text_area) and naming conventions, for DRY code and user consistency. - Later, custom user-defined zones can be added to the API (not initial scope).
5. Documentation
- Update dev docs to cover new zone system, example zone maps for each card type, migration paths, and how to add zones for third-party cards.
Benefits
- Unified, extensible multi-text placement system for all LCARS card types
- Zones become a first-class citizen; easy extensibility for future features
- Consistent WYSIWYG routing and predictability for users; visually aligned text between cards
- Path to user-defined custom zones in the future
Reference: see #317 for slider text area overhaul.
/cc @snootched
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
core-textRelated to text fieldsRelated to text fieldslcards-buttonRelated to lcards-button cardRelated to lcards-button cardlcards-elbowRelated to lcards-elbow cardRelated to lcards-elbow cardlcards-sliderRelated to lcards-slider cardRelated to lcards-slider card