Add TUI 'g' shortcut to delegate work items to GitHub Copilot#795
Merged
SorraTheOrc merged 6 commits intomainfrom Mar 10, 2026
Merged
Conversation
added 6 commits
March 9, 2026 14:26
…teWorkItem() helper Refactored the wl github delegate CLI action handler to call delegateWorkItem() from src/delegate-helper.ts instead of inlining the push/assign/state-update logic. The CLI handler now only handles CLI-specific concerns (process.exit, console output, interactive children prompt) while the core delegate flow lives in the shared helper for reuse by the TUI. Changes: - src/commands/github.ts: import delegateWorkItem, export resolveGithubConfig, replace ~100 lines of inline logic with helper call + result mapping - src/delegate-helper.ts: new shared module (already existed as untracked file) with DelegateResult, DelegateOptions, DelegateDb types and delegateWorkItem() function All 16 delegate guard-rail tests pass unchanged.
… GitHub Copilot - Wire screen.key(KEY_DELEGATE) handler in controller.ts with standard modal/move-mode/search guards - Show confirmation modal via selectList with Delegate/Force/Cancel options - When item has do-not-delegate tag, only show Force and Cancel options with warning message - Call delegateWorkItem() helper on confirm, show toast feedback on success/failure - Refresh list display after successful delegation - Optional browser-open gated by WL_OPEN_BROWSER=true env var - Covers Features 2 (key binding), 3 (confirmation modal), 4 (feedback)
- New tests/tui/delegate-shortcut.test.ts with 9 tests covering: empty list no-op, delegate on confirm, success toast with issue URL, failure toast, cancel flow, force=true selection, do-not-delegate tag with Force override, move mode suppression, and error handling - TUI.md: document g (delegate) and D (do-not-delegate toggle) shortcuts in Work Item Actions section - CLI.md: document delegate subcommand under github subcommands with cross-reference to TUI g shortcut
…r normal items, rename for do-not-delegate items
…r dialog for delegation flow
- Add messageBox() method to ModalDialogsComponent returning {update, close} handle
- Add onProgress callback to delegateWorkItem() for step-by-step status reporting
- Update TUI delegate handler to show status dialog during delegation
- On failure: show short toast + error dialog with full error detail
- Add tests for status dialog progress updates and error dialog
- All 26 delegate-related tests pass (10 TUI + 16 guard-rails)
…n instead of env-var gating - Replace WL_OPEN_BROWSER env-var auto-open with interactive dialog - On success, show 'Delegation Successful' dialog with 'Open in Browser' / 'Close' choices - Add test verifying the browser-open dialog is offered with correct items and URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the TUI delegate shortcut epic (WL-0MM8PWK3C1V70TS1) across 5 features:
src/commands/github.tsinto a shareddelegateWorkItem()function insrc/delegate-helper.tsthat returns structured results (noprocess.exit()orconsole.log). CLI handler rewired to use the helper.KEY_DELEGATE = ['g']in constants with help menu entry. Wiredscreen.keyhandler in controller with standard overlay/move-mode/search guards.selectListmodal with Delegate/Force/Cancel options. When item hasdo-not-delegatetag, only shows Force/Cancel with a yellow warning.refreshFromDatabase()to update item display, and opt-in browser-open gated byWL_OPEN_BROWSER=true.tests/tui/delegate-shortcut.test.tscovering all scenarios. TUI.md and CLI.md updated.Files Changed
src/delegate-helper.tsdelegateWorkItem(), typessrc/commands/github.tsresolveGithubConfigsrc/tui/constants.tsKEY_DELEGATEand help menu entrysrc/tui/controller.tsgkey handler with modal + delegate flowtests/tui/delegate-shortcut.test.tsTUI.mdgandDshortcutsCLI.mddelegatesubcommandTesting
Work Items