demo(10): add list item with action demo#4
demo(10): add list item with action demo#4dan-snelson wants to merge 2 commits intoswiftDialog:mainfrom
Conversation
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).
There was a problem hiding this comment.
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
|| trueto|| exit 0to 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.
| # --- 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 |
There was a problem hiding this comment.
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.
Summary
Next →/Skip/|| exit 0so the demo flows into the new section# --- List item with action ---section demonstrating theaction=modifier, which opens a URL in the browser when a list item is clickedTest plan
zsh -n demos/10_list_items.zshpasses silently (run as repo owner)