Skip to content

demo(10): add list item with action demo#4

Open
dan-snelson wants to merge 2 commits intoswiftDialog:mainfrom
dan-snelson:demo/10-list-items
Open

demo(10): add list item with action demo#4
dan-snelson wants to merge 2 commits intoswiftDialog:mainfrom
dan-snelson:demo/10-list-items

Conversation

@dan-snelson
Copy link
Contributor

Summary

  • Updates the Selectable List section to use Next → / Skip / || exit 0 so the demo flows into the new section
  • Adds a new # --- List item with action --- section demonstrating the action= modifier, which opens a URL in the browser when a list item is clicked

Test plan

  • zsh -n demos/10_list_items.zsh passes silently (run as repo owner)
  • Run the demo; confirm Selectable List output is printed and Skip exits cleanly
  • Confirm the action section displays three clickable items; clicking each opens the correct URL
  • Confirm "Done ✓" closes the demo cleanly

Signed-off-by: Dan K. Snelson <24623109+dan-snelson@users.noreply.github.com>
The header listed 'with action' but no listitem ever used an action
modifier. Adds a new '--- List item with action ---' section showing
URL-triggered actions on click.

Also promotes selectable list to a mid-flow step (Next → / Skip) so
the action demo becomes the final step (Done ✓ / || true).
Copilot AI review requested due to automatic review settings February 25, 2026 11:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the list items demo by adding a new section demonstrating the action modifier, which allows list items to open URLs when clicked. The changes also improve the flow between demo sections by updating button labels and exit behavior.

Changes:

  • Modified the Selectable List section to use "Next →" / "Skip" buttons instead of "Done ✓" for better flow
  • Updated exit behavior from || true to || exit 0 to cleanly exit when Skip is pressed
  • Added new "List Item Actions" demo section showing clickable list items that open URLs in the browser
  • Added .gitignore file with standard macOS and zsh ignore patterns

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
demos/10_list_items.zsh Updated selectable list section flow and added new list item action demo
.gitignore Added standard macOS, zsh, and project-specific ignore patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +165 to +177
# --- List item with action ---
"$DIALOG" \
--title "List Item Actions" \
--message "The \`action\` modifier opens a URL when its list item is clicked.\n\nTry clicking any item below — it will open the linked URL in your browser." \
--icon "SF=link.circle.fill,colour=#007AFF" \
--listitem "swiftDialog GitHub,action=https://github.com/swiftDialog/swiftDialog" \
--listitem "SF Symbols,action=https://developer.apple.com/sf-symbols/" \
--listitem "swiftDialog Wiki,action=https://github.com/swiftDialog/swiftDialog/wiki" \
--button1text "Done ✓" \
--moveable \
--width 700 \
--height 350 \
--json || true
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README.md file should be updated to reflect this new demo section. Line 38 of README.md currently lists the features as --listitem (status, statustext, custom SF symbols) but should include action in this list to document the new functionality being demonstrated here.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants