Skip to content

Commit a37a657

Browse files
Gilbert SanchezHeyItsGilbert
authored andcommitted
feat(Get-ShortcutKeyPanel): ✨ add detailed comment-based help for function
- Enhanced the function documentation with a comprehensive `.SYNOPSIS`, `.DESCRIPTION`, and `.EXAMPLE`. - Improved readability and usability of the shortcut keys panel for the Pester Explorer TUI.
1 parent c197985 commit a37a657

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed
Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
function Get-ShortcutKeyPanel {
2+
<#
3+
.SYNOPSIS
4+
Get a panel displaying shortcut keys for the Pester Explorer TUI.
5+
6+
.DESCRIPTION
7+
This function generates a panel that displays the shortcut keys available
8+
in the Pester Explorer TUI. The keys are formatted for display using
9+
Spectre.Console, providing a user-friendly interface for navigating the
10+
Pester Explorer. The panel includes common shortcuts for navigation,
11+
exploration, and exiting the TUI. It returns a formatted panel that can be
12+
displayed in the Pester Explorer interface.
13+
14+
.EXAMPLE
15+
$shortcutPanel = Get-ShortcutKeyPanel
16+
17+
This example retrieves a panel displaying the shortcut keys for the Pester
18+
Explorer TUI. The panel includes keys for navigation, exploration, and
19+
exiting the TUI, formatted for easy readability.
20+
#>
221
[CmdletBinding()]
322
$shortcutKeys = @(
423
"Up, Down - Navigate",
@@ -7,10 +26,14 @@ function Get-ShortcutKeyPanel {
726
"Ctrl+C - Exit"
827
# TODO: Add a key to jump to the test
928
)
29+
$formatSpectreAlignedSplat = @{
30+
HorizontalAlignment = 'Center'
31+
VerticalAlignment = 'Middle'
32+
}
1033
$result = $shortcutKeys | Foreach-Object {
1134
"[grey]$($_)[/]"
1235
} | Format-SpectreColumns -Padding 5 |
13-
Format-SpectreAligned -HorizontalAlignment Center -VerticalAlignment Middle |
36+
Format-SpectreAligned @formatSpectreAlignedSplat |
1437
Format-SpectrePanel -Expand -Border 'None'
1538
return $result
1639
}

0 commit comments

Comments
 (0)