Skip to content

perry/ui: no Alert/Confirm dialog primitive (modal yes/no) #708

@proggeramlug

Description

@proggeramlug

Gap

The dialog surface in perry/ui only exposes file/folder pickers — there is no system Alert / Confirm primitive for modal yes/no prompts.

Current dialog API:

openFileDialog, openFolderDialog, saveFileDialog

No equivalent of UIAlertController / NSAlert / window.confirm.

Use case

Destructive or attention-needing confirmations: "Are you sure you want to delete this item?", "Activate vacation mode (your shares/wishes will be hidden)?", "Sign out?". These need a blocking modal that returns a boolean (or selected button index), and that uses the OS-native presentation so users get familiar styling, dismissal gestures, and accessibility.

Workaround

Either:

  1. Skip the confirmation entirely (what we did for Urlaubsmodus — Angular shows a confirm dialog before activating, Perry just applies immediately and relies on the toggle's visible state).
  2. Hand-roll a full-screen overlay using widget primitives (Spacer / VStack / Button). Loses native presentation/animation/a11y.

Suggested API

showAlert(
  title: string,
  message: string,
  buttons: string[],            // e.g. ["Cancel", "Delete"]
  destructiveIndex: number,     // -1 if none
  cancelIndex: number,          // -1 if none
  callback: (chosenIndex: number) => void,
): void;

Maps to UIAlertController (.alert style) on iOS, NSAlert on macOS.

Encountered in

sharity-app port — Urlaubsmodus toggle on Profile screen (Angular has a confirm-dialog gate that Perry can't reproduce).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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