demo(04): add --helpmessage section; correct header#2
demo(04): add --helpmessage section; correct header#2dan-snelson wants to merge 4 commits intoswiftDialog:mainfrom
Conversation
Signed-off-by: Dan K. Snelson <24623109+dan-snelson@users.noreply.github.com>
The header listed --helpsheetbuttontext but it was never demonstrated. Adds a new '--- Help sheet button text ---' section showing how to customise the help trigger button label alongside --helpmessage. Also repoints the preceding dialog to --button1text "Next →" / || exit 0 so the new dialog becomes the final step with || true.
Signed-off-by: Dan K. Snelson <24623109+dan-snelson@users.noreply.github.com>
Replaced the placeholder --helpsheetbuttontext reference in the header with the real --helpmessage option. Added a dedicated section that demonstrates the help popover. Added trailing newline.
There was a problem hiding this comment.
Pull request overview
Updates Demo 04 in the swiftDialog demo suite to correctly document and demonstrate the --helpmessage option, and improves the flow of the button-related examples.
Changes:
- Fix the Demo 04 header option list to reference
--helpmessage(not the non-existent--helpsheetbuttontext). - Reorder Demo 04 screens and add a dedicated
--helpmessagehelp-popover example. - Add a repo
.gitignorefor macOS/Zsh/project-local artifacts.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
demos/04_buttons.zsh |
Reorders sections and adds a new helpmessage demo screen; updates final button labeling. |
.gitignore |
Introduces ignore rules for common macOS/Zsh and project-local temp files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --json || exit 0 | ||
|
|
There was a problem hiding this comment.
In the "Hidden Keyboard Action" dialog, --button2text "Also works with ⌘⇧Esc" likely returns a non-zero exit status (button2), so --json || exit 0 will terminate the demo early when the user clicks that button. Consider either removing/renaming button2 to an explicit quit action, or capturing $? and only exiting on actual cancel/quit while allowing both buttons to proceed to the next screen.
| --json || exit 0 | |
| --json | |
| exit_code=$? | |
| if [ "$exit_code" -ge 20 ]; then | |
| exit 0 | |
| fi |
| --message "Button 1 is **disabled** at launch with \`--button1disabled\`.\n\nButton 2 is active. In a real workflow, you'd re-enable Button 1 via the command file after some condition is met.\n\nPress Button 2 to continue." \ | ||
| --icon "SF=hand.raised.slash,colour=#8E8E93" \ | ||
| --button1text "Disabled" \ | ||
| --button1disabled \ | ||
| --button2text "Next →" \ | ||
| --button2text "Done ✓" \ |
There was a problem hiding this comment.
The Disabled Buttons dialog text says "Press Button 2 to continue.", but Button 2 is labeled "Done ✓" and this is the last screen (followed by || exit 0). Please update the message copy to match the actual button label/behavior (e.g., indicate it closes/finishes the demo).
Summary
--helpsheetbuttontextwith the real--helpmessageoption--hidedefaultkeyboardactionflows naturally before the final Disabled Buttons screen# --- Help message ---section demonstrating the--helpmessagehelp-popoverTest plan
zsh -n demos/04_buttons.zshpasses silently (run as repo owner)--hidedefaultkeyboardaction— pressing Enter alone does nothing; ⌘⇧Enter works