Skip to content

grafana-jump: inline toolbar button, update toast, generic link targets - #40

Draft
nsheaps-oura wants to merge 2 commits into
mainfrom
claude/greasyfork-auto-pull-plugins-qhe8nz
Draft

grafana-jump: inline toolbar button, update toast, generic link targets#40
nsheaps-oura wants to merge 2 commits into
mainfrom
claude/greasyfork-auto-pull-plugins-qhe8nz

Conversation

@nsheaps-oura

@nsheaps-oura nsheaps-oura commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Inline toolbar button: on a PR page, the jump button now injects directly into GitHub's own header toolbar ([class^="gh-header-actions"]), the same selector github-to-graphite-button already anchors to - mirroring how the Graphite↔GitHub buttons in this repo inject theirs. Every other supported context (branch/workflow/run/runner/runnerGroup - all on the Actions tab, not a PR) has no known equivalent stable toolbar, so those keep the existing floating button. The unconfigured-state label is now always "⚙️ Set up links" (previously split between "Set up Grafana jump" and "No jump target configured for this page").
  • Update-detected toast: compares GM.info.script.version against the last-seen version recorded in storage (no network call - this only detects a local upgrade the script manager already applied). When it differs, shows a toast styled after nsheaps/cept's own UpdateToast component (dark, bottom-centered, fade/slide transition), auto-dismissing after 10s, linking to this package's own CHANGELOG.md (already generated per-release by release-it/conventional-changelog - no new changelog infra needed).
  • Generic link targets: a new type: link jump target - a {{fieldKey}}-templated URL for linking anywhere (a wiki, a runbook, another tool entirely), not just Grafana. Reuses the same placeholder-scanning requiredFields/renderTemplate machinery already built for trace targets, so applicability is inferred purely from which placeholders the URL template uses.
  • Expanded context fields: adds org, repoFullName, serverUrl, apiUrl to the field vocabulary a target can reference, loosely mirroring GitHub Actions' own github context object as far as a value is actually derivable from a GitHub page's URL (deliberately not adding actor/sha/event_name etc. since those aren't derivable from a page URL alone, and a target referencing one should never show as applicable rather than showing with a guessed value).
  • GreasyFork sync via raw blob at latest, not release assets: GreasyFork's release-webhook sync reads content server-side via git show <release-tag>:<path> rather than fetching the stored sync URL over HTTP, so the URL only needs to parse to the right git path - it doesn't need to be a releases/.../download/ URL, and the file doesn't need to be flattened to repo root. @downloadURL/@updateURL for all three published packages now point at raw.githubusercontent.com/.../latest/packages/<pkg>/dist/script.user.js instead. Dropped the flat root-level mirror commit step and the release-asset upload step from release.yaml accordingly. The GitHub Release (and its webhook) stays, since it still carries the changelog/bump report and triggers GreasyFork's sync - only the URL shape changed, not the trigger mechanism.

Changes

  • packages/github-actions-grafana-jump/src/index.ts: LinkTarget type + normalizeTarget/requiredFields/targetKey/buildJumpUrl/configToYamlLite support; expanded ContextFieldKey/CONTEXT_FIELD_KEYS/contextFields; renderInlineButton/populateJumpContainer/styleJumpButton for the inline-vs-floating button split; checkForUpdate/showUpdateToast/isVersionUpdate/recordSeenVersion for the update toast; config-modal UI for the new target type and fields.
  • packages/github-actions-grafana-jump/src/meta.json, packages/graphite-to-github-button/src/meta.json, packages/github-to-graphite-button/src/meta.json: @downloadURL/@updateURL switched to the raw-blob-at-latest-tag form; grafana-jump's description tweak (no longer Grafana-only).
  • .github/workflows/release.yaml: dropped the flat root-level .user.js mirror step and the release-asset upload step; updated comments to explain the new sync mechanism.
  • README.md: updated the versioning/releases section to describe the raw-blob sync URL instead of the release-asset one.
  • packages/github-actions-grafana-jump/test/grafana-jump.test.js: unit tests for the new target type, expanded contextFields, and isVersionUpdate.
  • .github/jump-links.config.yaml: docs/example update for the new field vocabulary and type: link.

Test plan

  • tsc --build compiles cleanly (verified via a scratch compile in this sandbox - no package registry access here to run the real yarn build; CI will run the actual build).
  • node --test passes all 52 unit tests (52/52, including the new link-target and isVersionUpdate cases), against a local scratch build of dist/index.js.
  • Manually verify the inline button appears in a real PR page's header toolbar, and the floating button still appears on branch/workflow/run/runner pages.
  • Manually verify the update toast appears once after bumping the stored "last seen" version below the running one, auto-dismisses after 10s, and links to the CHANGELOG.
  • Manually verify a type: link target shows/hides correctly based on which {{fieldKey}} placeholders its URL template uses.
  • After merge, once a release publishes each package's file at the new raw-blob path, update each script's registered "Source Code URL" in GreasyFork's own site UI to match (an out-of-repo, account-side step).

Generated by Claude Code

… targets

- Injects the jump button inline into GitHub's own PR header toolbar
  (mirroring github-to-graphite-button's gh-header-actions injection),
  falling back to the floating button elsewhere. The unconfigured-state
  label is now "Set up links" regardless of why nothing's applicable.
- Adds a new type: link jump target - a generic {{fieldKey}}-templated URL
  for linking anywhere, not just Grafana, reusing the same
  placeholder/requiredFields machinery as trace targets.
- Expands the context-field vocabulary (org, repoFullName, serverUrl,
  apiUrl) to mimic more of GitHub Actions' own `github` context, as far as
  a value is actually derivable from a GitHub page's URL.
- Adds a cept-styled, auto-dismissing (10s) update-detected toast, comparing
  GM.info.script.version against the last-seen version and linking to this
  package's own CHANGELOG.md.
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Userscript Version Preview

Preview only — versions and CHANGELOGs are bumped automatically on merge to main, not in this PR. Manual bumps to a higher version are preserved.

Package Base New Action
github-actions-grafana-jump 0.2.4 0.2.5 will-bump

…e assets

GreasyFork's release-webhook sync reads content server-side via
`git show <release-tag>:<path>` rather than fetching the stored sync URL
over HTTP, so the URL only needs to parse to the right git path - it
doesn't need to be a releases/.../download/ URL, and the file doesn't need
to be flattened to repo root. Point @downloadURL/@updateURL at
raw.githubusercontent.com/.../latest/packages/<pkg>/dist/script.user.js
instead, drop the flat root-level mirror commit step, and drop the
release-asset upload step. The GitHub Release (and its webhook) stays,
since it still carries the changelog/bump report and triggers GreasyFork's
sync.
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.

2 participants