Skip to content

Add TUI 'g' shortcut to delegate work items to GitHub Copilot#795

Merged
SorraTheOrc merged 6 commits intomainfrom
feature/WL-0MM8PWK3C1V70TS1-tui-delegate-shortcut
Mar 10, 2026
Merged

Add TUI 'g' shortcut to delegate work items to GitHub Copilot#795
SorraTheOrc merged 6 commits intomainfrom
feature/WL-0MM8PWK3C1V70TS1-tui-delegate-shortcut

Conversation

@SorraTheOrc
Copy link
Copy Markdown
Collaborator

Summary

Implements the TUI delegate shortcut epic (WL-0MM8PWK3C1V70TS1) across 5 features:

  • Extract delegate orchestration helper — Refactored the inline delegate flow from src/commands/github.ts into a shared delegateWorkItem() function in src/delegate-helper.ts that returns structured results (no process.exit() or console.log). CLI handler rewired to use the helper.
  • TUI 'g' key binding — Registered KEY_DELEGATE = ['g'] in constants with help menu entry. Wired screen.key handler in controller with standard overlay/move-mode/search guards.
  • Confirmation modal with Force — Shows selectList modal with Delegate/Force/Cancel options. When item has do-not-delegate tag, only shows Force/Cancel with a yellow warning.
  • Post-delegation feedback — Success toast with issue URL, failure toast with error message, refreshFromDatabase() to update item display, and opt-in browser-open gated by WL_OPEN_BROWSER=true.
  • Tests and docs — 9 new tests in tests/tui/delegate-shortcut.test.ts covering all scenarios. TUI.md and CLI.md updated.

Files Changed

File Change
src/delegate-helper.ts New shared module with delegateWorkItem(), types
src/commands/github.ts Rewired CLI handler to use helper; exported resolveGithubConfig
src/tui/constants.ts Added KEY_DELEGATE and help menu entry
src/tui/controller.ts Added g key handler with modal + delegate flow
tests/tui/delegate-shortcut.test.ts 9 new tests
TUI.md Documented g and D shortcuts
CLI.md Documented delegate subcommand

Testing

  • All 16 existing delegate guard-rail tests pass
  • All 9 new TUI delegate shortcut tests pass
  • TypeScript compiles cleanly
  • 2 pre-existing clipboard test failures (WSL/Wayland environment-specific) unrelated

Work Items

  • Parent: WL-0MM8PWK3C1V70TS1
  • Feature 1: WL-0MMJO1ZHO16ED15O (in_review)
  • Feature 2: WL-0MMJF6COK05XSLFX (in_review)
  • Feature 3: WL-0MMJO2OAH1Q20TJ3 (in_review)
  • Feature 4: WL-0MMJO338Z167IJ6T (in_review)
  • Feature 5: WL-0MMJO3LBG0NGIBQV (in_review)

Sorra 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
@SorraTheOrc SorraTheOrc merged commit 3cf1f92 into main Mar 10, 2026
4 checks passed
@SorraTheOrc SorraTheOrc deleted the feature/WL-0MM8PWK3C1V70TS1-tui-delegate-shortcut branch March 10, 2026 00:42
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.

1 participant