Skip to content

Show Risk and Effort in TUI metadata pane and CLI output with placeholder when empty#932

Merged
SorraTheOrc merged 2 commits intomainfrom
copilot/add-risk-effort-scores
Mar 13, 2026
Merged

Show Risk and Effort in TUI metadata pane and CLI output with placeholder when empty#932
SorraTheOrc merged 2 commits intomainfrom
copilot/add-risk-effort-scores

Conversation

Copy link
Contributor

Copilot AI commented Mar 13, 2026

Risk and Effort fields existed in the data model but were invisible in the TUI metadata pane and conditionally omitted from CLI output when empty — making triage and prioritization decisions harder.

Changes

TUI metadata pane (src/tui/components/metadata-pane.ts)

  • Added risk and effort to updateFromItem signature
  • Always renders Risk and Effort rows; shows placeholder when empty
  • Row count: 9 → 11

CLI output (src/commands/helpers.ts)

  • All four formats (tree, concise, normal, full) now unconditionally emit Risk: <value> and Effort: <value>, using instead of omitting the line

Tests

  • Updated row-count assertions: 9 → 11 in tui-github-metadata.test.ts and tui-50-50-layout.test.ts
  • Added unit tests for placeholder vs. value rendering in both TUI and CLI helper formats

Docs

  • CLI.md: show command notes Risk/Effort always appear with placeholder
  • TUI.md: Overview updated to list the full metadata pane row set

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 - (http block)
    • Triggering command: /usr/bin/gh gh issue create --repo owner/name --title Alpha item --body-file - --global ode-gyp-bin/bashgit rev-parse --show-toplevel bash i/mo�� rev-parse --show-toplevel (http block)
    • Triggering command: /usr/bin/gh gh issue create --repo owner/name --title Alpha item --body-file - copilot/add-risk-c dist/loader.mjs bash i/mo�� rev-parse x5DI9/wt e_modules/.bin/bash tree-rendering.tnode --local de/node/bin/bash/home/REDACTED/work/ContextHub/ContextHub/src/cli.ts bash (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>Show risk and effort scores int he meta-data</issue_title>
<issue_description>

Headline summary
Add visible Risk and Effort fields to item metadata in TUI and CLI; show placeholders when empty.

Problem statement
The metadata UI and CLI outputs currently omit visible Risk and Effort entries. Developers and triage users need these fields surfaced in the metadata pane and wl show output (showing a placeholder when empty) so intake triage and prioritization decisions can be made quickly.

Users

  • Triage engineers and Producers who review work items in the TUI and CLI (example user story: "As a triage engineer, I want to see risk and effort in the metadata pane so I can quickly assess whether an item needs escalation").
  • Developers and maintainers who rely on wl show for summaries in workflows (example user story: "As a developer, I want wl show <id> to include risk/effort so I can decide assignment and estimate work").

Success criteria

  • Metadata pane shows Risk and Effort rows; when a field is empty the UI shows a placeholder like "—".
  • wl show <id> and summary output include Risk: <value> and Effort: <value> (or placeholder when empty) in the CLI output and in wl show -c (compact) where applicable.
  • GitHub sync continues to map risk/effort label fields into the local work item fields so local fields remain the single source of truth for display.
  • Unit and integration tests added covering metadata pane rendering, wl show output, and sync label->field mapping.
  • Documentation updated (CLI.md and metadata pane docs) and a short note in the changelog.

Constraints

  • Preserve local risk and effort fields as the display source-of-truth (do not change the existing label priority without explicit approval).
  • Avoid breaking existing GitHub sync behavior: label parsing and writing lives in src/github.ts and src/github-sync.ts and must remain compatible with existing labels.
  • Keep UI changes minimal and localized to MetadataPaneComponent and wl show formatting code; keep behavior consistent across TUI and CLI.
  • Tests that currently assert empty risk/effort behaviour may need small updates to expect the placeholder instead of an empty string.

Existing state

  • The repository already stores risk and effort on work items (fields exist in tests and types).
  • src/tui/components/metadata-pane.ts and src/tui/controller.ts handle the metadata pane (tests reference empty risk/effort in tests/tui/*).
  • GitHub parsing and sync code in src/github.ts and src/github-sync.ts already read/write risk and effort from labels; some code paths currently use labelFields when present.
  • Current tests and fixtures show risk and effort defaulting to empty strings; some tests expect empty values.

Desired change

  • Update MetadataPaneComponent.updateFromItem to render Risk and Effort rows, showing the work item's risk and effort values or a placeholder when empty.
  • Update wl show CLI output (and compact summary output) to include Risk and Effort lines consistently.
  • Ensure GitHub sync code continues to parse risk: and effort: labels into local fields during sync, but keep local fields as the displayed values (no new mixed-display behavior).
  • Add unit and integration tests that assert rendering both when fields are set and when empty, and tests that assert label->field mapping during sync.
  • Update CLI.md and any metadata-pane documentation to mention the visible fields and placeholder behavior.

Related work

  • src/tui/components/metadata-pane.ts — Metadata pane rendering; updateFromItem currently prepares metadata display but risk/effort are not shown in UI tests.
  • src/tui/controller.ts — Metadata pane wiring and updateFromItem invocation.
  • src/github.ts — Label parsing and label field definitions for risk: and effort:.
  • src/github-sync.ts — Sync logic which maps labels to work item fields and back.
  • CLI.md — Documents --risk and --effort flags and example usage; update required.
  • Tests: tests/tui/* and tests/** reference risk and effort fields and should be extended to cover the rendering and CLI output.
  • Potentially related work items:
    • Calculate effort and risk at intake and planning (WL-0MMMERBMV14QUUW4)
    • Audit comment improvements (WL-0MLG60MK60WDEEGE)
    • Add docs for wl doctor and migration policy (WL-0MLGZR0RS1I4A921)

Notes / open questions

  • Display behavior chosen: always show fields with placeholder when empty (user preference).
  • Source-of-truth chosen: local work item fields are used for display; sync should still map labels->fields so values stay consistent after sync.

Please review this draft and either approve or provide concise edits (list edits or paste corrected sentences). Once you approve I'll run the five brief reviews and then update the Worklog item description.

Risks

  • Scope cree...

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

- Add Risk and Effort rows to MetadataPaneComponent (with '—' placeholder when empty)
- Always show Risk/Effort in CLI concise/normal/full/tree formats (with '—' placeholder)
- Update tests: row count 9→11, add risk/effort rendering assertions
- Add new tests for placeholder and value rendering in TUI and CLI helpers
- Update CLI.md and TUI.md docs to mention Risk/Effort always visible

Co-authored-by: SorraTheOrc <250240+SorraTheOrc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add visible Risk and Effort fields in metadata Show Risk and Effort in TUI metadata pane and CLI output with placeholder when empty Mar 13, 2026
Copilot AI requested a review from SorraTheOrc March 13, 2026 08:59
Copy link
Member

@SorraTheOrc SorraTheOrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests passed locally. Small UI/CLI updates as described look correct. Approving and will merge if mergeable.

@SorraTheOrc SorraTheOrc merged commit 294be02 into main Mar 13, 2026
4 checks passed
@SorraTheOrc SorraTheOrc mentioned this pull request Mar 14, 2026
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.

Show risk and effort scores int he meta-data

2 participants