feat: the board names the plugin version it is running - #25
Merged
Conversation
Collaborator
Author
|
Swapped the pair so the version owns the corner:
Drop order is unchanged and now reads more naturally with it: the theme goes first, so the version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The header's right side now reads
v0.2.0 · theme: tokyo-night.The question this answers comes up constantly with a plugin loaded from a working tree: is the
board I am looking at the board I just built? Nothing on screen used to say. Today that took
reading
herdr plugin list, checking which directory it points at, and comparing a binary's mtimeagainst
tui/src— for a fact the header can simply state.Where the number comes from, and where it deliberately doesn't
bin/e2b-dashresolves it withplugin_version()— which readsherdr-plugin.toml, the samemanifest herdr's own marketplace reads — and passes it in
E2B_DASH_VERSION. Same shape asE2B_DASH_DOMAIN_CMD: the shell owns resolution, the TUI never re-implements it, and the board cannever disagree with what herdr reports.
It pointedly does not use the crate's own
CARGO_PKG_VERSION.tui/Cargo.tomlcarries a secondversion with a comment saying to keep it in sync by hand — and it isn't: it still says
0.0.1whilethe plugin is at
0.2.0, because nothing in CI compares it (version-checkonly checkspackage.jsonagainstherdr-plugin.toml). A drifted version in the header would be worse than noversion at all, so the number comes from the one file that is actually maintained. That drift is
left alone here rather than quietly fixed in an unrelated PR — see below.
Launched directly with no shell to resolve it, or with a manifest that could not be read (the shell
prints
unknown), the header just omits it. A missing version costs nothing; a wrong one misleads.Layout
The right-hand pair sheds items on a narrow pane, theme first. Both are context rather than live
state, but the version answers a question people actually ask of a plugin loaded from a checkout,
while the theme is already visible in every colour on screen — the cheapest thing to lose. The
region still never gives way.
Measured in a pty at four widths:
herdr-e2b-sandbox · 1 sandboxes · region eu…v0.2.0 · theme: tokyo-nightherdr-e2b-sandbox · region eu…v0.2.0 · theme: tokyo-nighte2b · region eu…v0.2.0 · theme: tokyo-nightherdr-e2b-sandbox · region eu…v0.2.0The title getting longer between 52 and 40 looks wrong and is pre-existing behaviour, not a
regression: the search prefers the richest right-hand side and shortens the title to afford it, so
dropping the theme frees width the title takes back. Worth a separate look if it grates.
Test plan
cargo test— 28 pass, including a new case pinning the reader: a real version, a padded one,unknown, empty, and unset (each of the last three → omitted)cargo fmt --checkclean,cargo clippy --all-targetssilentnpm test— 309 CLI cases passFollow-up, not done here
tui/Cargo.toml's version is stale (0.0.1vs0.2.0) and its "keep in sync" comment is notenforced by anything. Either CI's
version-checkshould compare all three files, or that versionshould stop claiming to track the plugin's. Happy to take it in its own PR.