Skip to content

feat: add Herdr plugin for ghzinga links#39

Merged
osolmaz merged 14 commits into
mainfrom
feat/herdr-plugin
Jun 16, 2026
Merged

feat: add Herdr plugin for ghzinga links#39
osolmaz merged 14 commits into
mainfrom
feat/herdr-plugin

Conversation

@osolmaz

@osolmaz osolmaz commented Jun 16, 2026

Copy link
Copy Markdown
Member

Opened on behalf of Onur Solmaz (osolmaz).

Summary

Herdr can now hand GitHub issue and pull request links to ghzinga.
The plugin stays thin: Herdr calls gzg herdr-plugin open/viewer, and ghzinga owns the URL parsing, pane reuse, session naming, and Herdr pane control in Rust.
This matters because the ghzinga-specific behavior now ships with ghzinga instead of living in plugin shell scripts.

What Changed

The production path is now Herdr manifest wiring into ghzinga-owned Rust entrypoints.
The plugin opens or reuses a right-side ghzinga pane next to the clicked pane, using Herdr's current Ctrl-click link-handler surface.

  • Added plugins/herdr/herdr-plugin.toml with a GitHub issue/PR link handler, one action, and one viewer pane.
  • Added hidden Rust commands: gzg herdr-plugin open and gzg herdr-plugin viewer.
  • Moved URL normalization, source-pane scoped session naming, pane reuse validation, and Herdr CLI pane open/focus logic into ghzinga Rust.
  • Removed production open.sh and viewer.sh; shell remains only in test fakes/harnesses.
  • Documented install, architecture, Ctrl-click behavior, and verification in README.md and plugins/herdr/README.md.
  • Added fake Herdr tests and a live Herdr smoke test for the side-pane flow.
  • Updated capture manifests after validating the existing captures still match the current app output.

Testing

I tested the Rust-owned path directly, with fake Herdr, and inside a real disposable Herdr session.
The live Herdr smoke starts Herdr, links the plugin, opens a right-side pane, and verifies ghzinga rendered fixture content there.

  • cargo test herdr_plugin --lib
  • plugins/herdr/test/test-open.sh
  • plugins/herdr/test/test-viewer.sh
  • scripts/herdr-plugin-live-smoke.sh
  • npx -y @simpledoc/simpledoc check
  • PATH="/tmp/ghzinga-py312/bin:$PATH" scripts/ci-local.sh

The first local scripts/ci-local.sh run used macOS system Python 3.9.6 and failed on existing Python 3.10+ type syntax in capture scripts.
The full gate passed after putting a temporary Python 3.12 venv first on PATH, matching the Python version available on GitHub's ubuntu-latest runner.

Risks

The main limitation is Herdr's current trigger surface.
The plugin handles Ctrl-click link events; plain left-click link routing would need Herdr itself to expose that behavior to plugins.

  • gzg must be installed on PATH for normal Herdr plugin launches.
  • The plugin uses Herdr 0.7.0 plugin/link-handler/pane CLI APIs, so future Herdr API drift is the main compatibility risk.
  • GHZINGA_BIN is supported for local development or custom viewer launches, but normal installs should not need it.

@osolmaz

osolmaz commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Final implementation report

Summary:

  • Added the Herdr plugin under plugins/herdr with a GitHub issue/PR link handler, open action, and viewer pane.
  • The plugin opens a right-side ghzinga pane next to the source pane and reuses that pane for later links from the same source pane/session.
  • Added plugin docs, root README install notes, shell tests, CI wiring, and an isolated live Herdr smoke test.

Validation passed:

  • codex review --base main: no actionable correctness issues on the latest head.
  • tmpdir=$(mktemp -d); uv venv --python 3.12 "$tmpdir/venv" >/dev/null; PATH="$tmpdir/venv/bin:$PATH" scripts/ci-local.sh: passed.
  • scripts/herdr-plugin-live-smoke.sh: passed. It starts a real Herdr session in a PTY, links the local plugin in isolated Herdr XDG dirs, invokes the link-handler action with Herdr-style env, verifies a right-side ghzinga pane opens, and verifies fixture content renders.
  • herdr plugin install dutifuldev/ghzinga/plugins/herdr --ref feat/herdr-plugin --yes with isolated Herdr XDG dirs and inherited Herdr socket env cleared: passed at commit af4c77dae7277b7be9891c7115f4c9f15211f785.
  • gh pr checks 39: verify passed.

PR comments/reviews:

  • No PR issue comments, reviews, or inline review threads were present when checked.

@osolmaz

osolmaz commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Final implementation report for the current Rust-owned Herdr plugin implementation.

Summary:

  • Herdr plugin manifest lives in plugins/herdr/herdr-plugin.toml and is installable from dutifuldev/ghzinga/plugins/herdr.
  • Production plugin logic is owned by ghzinga Rust entrypoints: gzg herdr-plugin open and gzg herdr-plugin viewer.
  • The plugin handles GitHub issue/PR links, opens a right-side ghzinga plugin pane beside the source pane, reuses that pane for later links from the same source pane/session, and validates that a stored pane still belongs to dutifuldev.ghzinga before reuse.
  • No production shell scripts remain in the plugin path; shell is only used for tests and live smoke harnesses.

Validation passed on head 71f9702af782280040191afd1eaf998f080796b3:

  • cargo test herdr_plugin --lib
  • plugins/herdr/test/test-open.sh
  • plugins/herdr/test/test-viewer.sh
  • scripts/herdr-plugin-live-smoke.sh against real Herdr 0.7.0: linked the local plugin, opened a right-side ghzinga pane from a live Herdr session, and verified rendered fixture content.
  • npx -y @simpledoc/simpledoc check
  • PATH="/tmp/ghzinga-py312/bin:$PATH" scripts/ci-local.sh
  • codex review --base main: no actionable correctness issues.
  • GitHub Actions verify: passed.

PR comments/reviews:

  • No issue comments, reviews, or inline review threads are pending.

Known Herdr-side limitation:

  • Current Herdr link handlers are invoked by Ctrl-click. Plain left-click behavior would require a Herdr change; ghzinga documents this limitation.

@osolmaz

osolmaz commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Follow-up fix for nested ghzinga panes:

  • Links clicked from inside a ghzinga Herdr viewer now reuse that same viewer instead of opening another side pane.
  • New viewer panes write a reverse pane-to-session mapping for deterministic reuse.
  • Existing viewer panes opened by older builds are also handled: if the reverse mapping is missing, the plugin validates the source pane is this plugin's viewer and falls back to ghzinga's Herdr pane-context session resolution.

Additional validation passed on head 011e83fdcb41446e6f19685ed0f866ceb3e77f96:

  • cargo test herdr_plugin --lib
  • plugins/herdr/test/test-open.sh
  • plugins/herdr/test/test-viewer.sh
  • scripts/herdr-plugin-live-smoke.sh verified a real Herdr side pane and confirmed an internal link kept the pane count unchanged.
  • Manual active-Herdr check from current ghzinga pane w1:pE: workspace pane count stayed 2 -> 2, and ghzinga reported focused openclaw/openclaw#81834.
  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings
  • npx -y @simpledoc/simpledoc check
  • GitHub Actions verify: passed.

@osolmaz

osolmaz commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Follow-up fix for stale restored tabs in Herdr plugin viewers:

  • gzg herdr-plugin viewer now launches ghzinga with --new --session <stable-plugin-session> <target>.
  • This keeps the stable session/control socket needed for later gzg open --session ... updates, but prevents a newly created Herdr side pane from restoring tabs left behind by a previous closed plugin pane.
  • The live smoke now keeps restore/control enabled in the viewer and verifies an internal link to a different issue fixture updates the same pane.

Validation passed on head 1e84a126d091a3de891af4e66129c7f5d17f120a:

  • cargo test herdr_plugin --lib
  • plugins/herdr/test/test-viewer.sh
  • plugins/herdr/test/test-open.sh
  • scripts/herdr-plugin-live-smoke.sh
  • cargo test
  • cargo clippy --all-targets --all-features -- -D warnings
  • npx -y @simpledoc/simpledoc check
  • GitHub Actions verify: passed.

@osolmaz osolmaz merged commit f10b00d into main Jun 16, 2026
1 check passed
@osolmaz osolmaz deleted the feat/herdr-plugin branch June 16, 2026 16:51
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