Skip to content

feat: add Marketplace/Source/Repo columns, raw JSON toggle, and health update#34

Merged
ericchansen merged 4 commits intomainfrom
feat/plugin-source-columns-and-json-toggle
May 6, 2026
Merged

feat: add Marketplace/Source/Repo columns, raw JSON toggle, and health update#34
ericchansen merged 4 commits intomainfrom
feat/plugin-source-columns-and-json-toggle

Conversation

@ericchansen
Copy link
Copy Markdown
Owner

What

  • Plugins tab: Replace single Source column with three config-faithful columns: Marketplace, Source, Repo — mirroring config.json fields
  • Raw JSON toggle: Press j on tabs with raw data (Plugins, MCP Servers, LSP, Hooks, Settings, Extensions) to view underlying config JSON in the detail pane
  • Health column update: MCP Servers health probe now writes results back to the table cell and refreshes the detail pane (previously only showed a toast)
  • UX polish: Pin-to-release hint shows actual path/tag; bold RAW JSON indicator; footer hint only on tabs that support it

Details

  • Added source_type, source_repo, raw_data to PluginInfo
  • Added raw_data to dataclasses with config data; removed dead fields from 6 others
  • toggle_json_view() in BaseTab with null-safe guard
  • _update_health() uses dataclasses.replace + update_cell for in-place updates
  • 5 new data-layer tests for source field parsing (287 total pass)

ericchansen and others added 4 commits May 5, 2026 21:55
… installs

When a plugin is installed from a local path that is a git checkout on a
branch (active dev work), the TUI's upgrade detector previously fell back
to ``git describe --tags --abbrev=0`` to find the nearest ancestor tag and
compared that to the highest tag on origin. This produced a misleading
``↑ vX.Y.Z`` arrow even though pressing ``[u]`` could not actually upgrade
the plugin -- ``copilot plugin update`` only does ``git pull`` on the
current branch, so the user's dev branch never advances to the release tag.

Now we distinguish three install states:

1. Tag-pinned (detached HEAD on an exact tag): unchanged. Show
   ``↑ vX.Y.Z`` if origin has a higher tag; ``[u]`` works via the CLI.
2. Dev checkout (HEAD on a branch -- including a branch whose tip happens
   to coincide with a tag): NEW. Show ``dev: <branch>`` in the Upgrade
   column instead of an arrow. The detail pane explains the local install
   state, surfaces the latest origin tag for context, and shows the
   suggested git command to pin to a release. Pressing ``[u]`` short-
   circuits with a helpful message pointing at the source repo -- it does
   not call the CLI.
3. Other (no tags, missing path, not git): unchanged.

Branch state is authoritative. We deliberately ignore exact-tag detection
when HEAD is on a branch, because ``copilot plugin update`` will ``git
pull`` the branch rather than ``git checkout`` the tag, so we cannot
promise tag-based upgrades will land.

Also clears stale ``upgrade_available``/``upgrade_version`` in the no-
upgrade fallback of ``_apply_upgrades`` so a row that flips from
provisional-upgradable to fresh-no-upgrade does not still trigger the CLI
when ``[u]`` is pressed.

This is purely informational. We do NOT re-introduce any git-checkout
logic in the upgrade handler -- that was the path PR #31 took and PR #32
deliberately reverted, after upstream confirmed ``copilot plugin update``
handles fresh-tag local installs correctly. The bug here is in our display
heuristics, not in the upgrade action.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the single 'Source' column in the Plugins tab with three
config-faithful columns (Marketplace, Source, Repo) that mirror the
actual config.json fields, making install method immediately visible.

Add [j] key binding across all tabs to toggle the detail pane between
the human-readable Rich markup view and a raw JSON dump of the
underlying data — helpful for diagnosing config issues.

Changes:
- data/plugins.py: Add source_type, source_repo, raw_data fields
- tabs/plugins.py: Update columns, row_for, detail_for
- tabs/base.py: Add _detail_raw_mode toggle and toggle_json_view()
- app.py: Add j binding -> action_toggle_json
- All data/*.py: Add raw_data field to every frozen dataclass
- Populate raw_data from JSON source where available
- tests: Fix column index references for new layout

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Previously the health probe only showed a toast notification but never
wrote the result back to the table. Now _update_health replaces the
frozen item, updates the cell via update_cell, and refreshes the detail
pane if the probed row is selected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
add_column(key=header) gives each column a stable key matching
its header string. Without this, Textual auto-generates anonymous
keys and update_cell('Health', ...) silently fails via
suppress(Exception).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ericchansen ericchansen merged commit 6a78b36 into main May 6, 2026
8 checks passed
@ericchansen ericchansen deleted the feat/plugin-source-columns-and-json-toggle branch May 6, 2026 04:20
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