Skip to content

demo(04): add --helpmessage section; correct header#2

Open
dan-snelson wants to merge 4 commits intoswiftDialog:mainfrom
dan-snelson:demo/04-buttons
Open

demo(04): add --helpmessage section; correct header#2
dan-snelson wants to merge 4 commits intoswiftDialog:mainfrom
dan-snelson:demo/04-buttons

Conversation

@dan-snelson
Copy link
Contributor

Summary

  • Corrects the header comment: replaces the non-existent --helpsheetbuttontext with the real --helpmessage option
  • Reorders sections so --hidedefaultkeyboardaction flows naturally before the final Disabled Buttons screen
  • Adds a dedicated # --- Help message --- section demonstrating the --helpmessage help-popover
  • Adds missing trailing newline

Test plan

  • zsh -n demos/04_buttons.zsh passes silently (run as repo owner)
  • Run the demo end-to-end; confirm the help (?) button appears and the popover renders
  • Confirm --hidedefaultkeyboardaction — pressing Enter alone does nothing; ⌘⇧Enter works
  • Confirm Disabled Buttons screen shows Button 1 greyed out; Button 2 ("Done ✓") closes the demo

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.
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

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 --helpmessage help-popover example.
  • Add a repo .gitignore for 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.

Comment on lines +100 to +101
--json || exit 0

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.

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.

Suggested change
--json || exit 0
--json
exit_code=$?
if [ "$exit_code" -ge 20 ]; then
exit 0
fi

Copilot uses AI. Check for mistakes.
Comment on lines 115 to +119
--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 ✓" \
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 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).

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