Skip to content

feat(tui): Add GitHub link and Push action to metadata pane#920

Merged
SorraTheOrc merged 2 commits intomainfrom
copilot/add-github-link-tui-metadata
Mar 11, 2026
Merged

feat(tui): Add GitHub link and Push action to metadata pane#920
SorraTheOrc merged 2 commits intomainfrom
copilot/add-github-link-tui-metadata

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

TUI users had no way to view or act on a work item's GitHub issue without leaving the TUI. This adds a GitHub row to the metadata pane and a G (Shift+G) shortcut to open or push.

Metadata pane — new GitHub row

MetadataPaneComponent.updateFromItem now accepts githubIssueNumber and githubRepo and renders a 9th row with one of three states:

State Display
No githubRepo configured GitHub: (set githubRepo in config to enable)
Mapped to GitHub issue GitHub: owner/repo#42 (G to open)
Configured, not yet pushed GitHub: (G to push to GitHub)

G (Shift+G) key handler in controller

  • Not configured → toast with configuration hint
  • Already mapped → opens https://github.com/<repo>/issues/<n> in default browser; falls back to clipboard copy if browser open fails
  • Configured, not pushed → calls upsertIssuesFromWorkItems([item], ...) off the render loop, persists mapping via db.upsertItems?.(), then opens the created issue URL (clipboard fallback on failure)

Conflict avoidance with g (delegate)

Both g and G share the same key name in blessed. Guards added:

  • g handler: early-returns when key.shift === true
  • G handler: early-returns when !key.shift

Key files changed

  • src/tui/components/metadata-pane.ts — extended item type, added GitHub row
  • src/tui/constants.tsKEY_GITHUB_PUSH = ['G'], help menu entry
  • src/tui/controller.tstryGetGithubRepo() helper, passes github fields to pane, G key handler, shift guards
  • tests/tui/tui-50-50-layout.test.ts — row count assertions updated 8→9
  • tests/tui/tui-github-metadata.test.ts — 10 new tests (unit rendering + controller integration)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh issue create --repo owner/name --title Alpha item --body-file - U5Zcy/wt bin/bash bash i/mo�� -C /.worklog/tmp-worktree-0f9gI6/wt k/ContextHub/ContextHub/tests/cli/mock-bin/bash -m first sync i/mock-bin/bash -data.jsonl (http block)
    • Triggering command: /usr/bin/gh gh issue create --repo owner/name --title Alpha item --body-file - U5Zcy/wt es/.bin/bash bash i/mo�� -C /.worklog/tmp-worktree-0f9gI6/wt k/node_modules/.bin/bash -m first sync ash -data.jsonl (http block)
    • Triggering command: /usr/bin/gh gh issue create --repo owner/name --title Alpha item --body-file - --verify de/node/bin/bashconfig bash i/mo�� show-ref /.worklog/tmp-worktree-RAxAvr/wt k/ContextHub/node_modules/.bin/bash og/data /tmp/worklog-tes/home/REDACTED/work/ContextHub/ContextHub/tests/cli/mock-bin/git modules/@npmcli/rev-parse git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Github link in tui meta-data</issue_title>
<issue_description>

Github link in TUI meta-data (WL-0MMLXZ9Z90O3N49Q)

Headline summary
Add a visible GitHub link and a Push action in the TUI item's metadata pane so users can open or create the mapped GitHub issue from the TUI and receive clear success/failure feedback.

Problem statement
Users of the TUI cannot quickly open or create the corresponding GitHub issue for a work item from the metadata view. This requires them to switch to the CLI or web UI to inspect or push an item, adding friction and context switching.

Users

  • CLI/TUI users who work primarily inside the TUI and want quick access to the GitHub issue for the focused work item.
  • Example user stories:
    • As a user viewing an item in the TUI, I want to see a link to the mapped GitHub issue in the metadata pane so I can open it in my browser.
    • As a TUI user with a local work item not yet pushed, I want a "Push to GitHub" action in the metadata pane that runs the established push flow and opens the new issue on success.
    • As a user on a machine missing GitHub configuration, I want the Push action disabled with a short hint telling me how to configure the repo so I understand why it is unavailable.

Success criteria

  • Items with an existing mapping show a clickable GitHub URL in the metadata pane that opens the issue in the default browser.
  • For items without a mapping, the metadata pane shows a "Push" action that invokes the existing wl gh push --id <id> flow and on success:
    • updates the work item with githubIssueNumber, githubIssueId, and githubIssueUpdatedAt (same behavior as existing push), and
    • shows a success toast and attempts to open the created issue URL in the user's browser; if opening the browser fails the URL is copied to the clipboard and the user is notified.
  • If GitHub is not configured (no githubRepo), the Push action is disabled and the UI displays a short hint (one-line) that tells the user how to configure the repo (e.g., "Set githubRepo in config or use wl github --repo <owner/repo> push").
  • Include automated tests that cover: rendering the link when mapped, invoking the Push action triggers the existing push flow and persists mappings, and disabled state when config is missing. Tests should include unit tests for rendering and an integration-style test that stubs the push flow.

Constraints

  • Reuse existing CLI push / github-sync logic: do not reimplement push behavior in the TUI; call the existing wl gh push code path.
  • Respect current authentication/credentials handling — do not introduce new credential storage or prompt flows.
  • Keep UI changes confined to the metadata pane and follow existing TUI theming (use theme.tui styles).
  • Avoid blocking the TUI main thread: any long-running push work must run off the main render loop and surface progress/feedback via toast or a non-blocking indicator.

Existing state

  • Code locations:
    • src/tui/controller.ts — main TUI controller and metadata pane rendering
    • src/commands/github.ts — CLI github push command and helper wiring
    • src/github-sync.ts — logic that creates/updates GitHub issues and persists mappings
  • Related work items:
    • WL-0MMLXZ9Z90O3N49Q — "Github link in tui meta-data" (this item)
    • WL-0MMJO338Z167IJ6T — "Post-delegation feedback and error handling" (patterns for toasts/feedback)
    • WL-0MMJO2OAH1Q20TJ3 — "Delegate confirmation modal with Force" (modal patterns)
    • WL-0MMKENAJT14229DE — "Open-in-browser from github TUI (key g) fails on WSL" (open-in-browser behavior and platform quirks)

Desired change

  • UI: Add a compact metadata row in the item's metadata pane that shows either:
  • Behavior:
    • Clicking the link opens the corresponding https://github.com/<repo>/issues/<number> in the default browser.
    • Clicking "Push" invokes the same push code path as wl gh push --id <id> (reuse existing functions from src/commands/github.ts or its helpers), runs off the render loop, surfaces progress or errors via existing toast patterns, and opens the created issue URL on success.
    • Disable the Push/link if githubRepo is not configured and show a one-line hint where the control would be (e.g., "Configure githubRepo in config or run wl github --repo <owner/repo> push").
  • Tests and docs:
    • Add unit/integration tests around the metadata rendering and push invocation (mocking the push implementation as needed).
    • Update any TUI docs that describe available metadata actions and shortcuts.

Related work

  • WL-0MMJO338Z167IJ6T — Post-delegation feedback and error handling: guidance for toasts and user messaging.
  • WL-0MMJO2OAH1Q20TJ3 — Delegate confirmation modal with Force: reference modal/confirmation ...

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub link and push action in TUI metadata feat(tui): Add GitHub link and Push action to metadata pane Mar 11, 2026
@SorraTheOrc SorraTheOrc marked this pull request as ready for review March 11, 2026 19:36
@SorraTheOrc SorraTheOrc merged commit f47fbb0 into main Mar 11, 2026
4 checks passed
@SorraTheOrc SorraTheOrc deleted the copilot/add-github-link-tui-metadata branch March 11, 2026 22:18
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.

Github link in tui meta-data

2 participants