Skip to content

Extract dialog helpers to shared module #1632

Description

@SorraTheOrc

Summary: Follow-up work item to extract private dialog helpers into a shared module (src/tui/components/dialog-helpers.ts) and reconcile with the modal dialog base (WL-0MNU782BD004HO2W).

Dependencies

  • Parent modal abstraction: WL-0MNU782BD004HO2W (design must be considered prior to extraction)

Acceptance Criteria

  • New module planned with public signatures documented and migration steps outlined.
  • A mapping is produced showing which helpers in DialogsComponent map to exported functions/classes.
  • A dependency link to WL-0MNU782BD004HO2W is included in the description.

Mapping: DialogsComponent Private Helpers → Extracted Public API

1. →

  • Current: Private method in DialogsComponent (line ~470)

  • Purpose: Creates a configured Blessed List with sensible defaults for dialogs

  • Proposed Public Signature:

  • Migration: Replace calls with

2. →

  • Current: Private method in DialogsComponent (line ~485)

  • Purpose: Creates a configured Blessed Textarea with sensible defaults

  • Proposed Public Signature:

  • Migration: Replace calls with

3. →

  • Current: Private method in DialogsComponent (line ~500)

  • Purpose: Creates a label box used as section headers inside dialogs

  • Proposed Public Signature:

  • Migration: Replace calls with

Migration Steps (to be executed in child work items)

  1. Create shared dialog-helpers module (WL-0MO5SBA2C0011DXJ)

    • Create
    • Export type definitions for options interfaces
    • Implement , ,
    • Re-export common types (BlessedBox, BlessedList, BlessedTextarea)
  2. Migrate DialogsComponent to use helpers (WL-0MO5SBPQW006ZZ3Q)

    • Import helpers from dialog-helpers.ts
    • Replace private method implementations with imports
    • Ensure all existing functionality preserved
  3. Integration & compatibility

    • Modal base interop (WL-0MO5SBWCA0027QKV)
    • Test verification (WL-0MO5SBZ3U0007M40)

Compatibility Notes

  • All functions maintain backward-compatible parameter shapes
  • No breaking changes to Widget lifecycle (create/destroy)
  • Theme integration preserved via existing import
  • Tests must pass after migration to verify behavioral parity

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions