grafana-jump: inline toolbar button, update toast, generic link targets - #40
Draft
nsheaps-oura wants to merge 2 commits into
Draft
grafana-jump: inline toolbar button, update toast, generic link targets#40nsheaps-oura wants to merge 2 commits into
nsheaps-oura wants to merge 2 commits into
Conversation
… 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.
Userscript Version PreviewPreview only — versions and CHANGELOGs are bumped automatically on merge to
|
…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.
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
[class^="gh-header-actions"]), the same selectorgithub-to-graphite-buttonalready 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").GM.info.script.versionagainst 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 afternsheaps/cept's ownUpdateToastcomponent (dark, bottom-centered, fade/slide transition), auto-dismissing after 10s, linking to this package's ownCHANGELOG.md(already generated per-release byrelease-it/conventional-changelog- no new changelog infra needed).type: linkjump target - a{{fieldKey}}-templated URL for linking anywhere (a wiki, a runbook, another tool entirely), not just Grafana. Reuses the same placeholder-scanningrequiredFields/renderTemplatemachinery already built for trace targets, so applicability is inferred purely from which placeholders the URL template uses.org,repoFullName,serverUrl,apiUrlto the field vocabulary a target can reference, loosely mirroring GitHub Actions' owngithubcontext object as far as a value is actually derivable from a GitHub page's URL (deliberately not addingactor/sha/event_nameetc. 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).latest, not release assets: GreasyFork's release-webhook sync reads content server-side viagit 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 areleases/.../download/URL, and the file doesn't need to be flattened to repo root.@downloadURL/@updateURLfor all three published packages now point atraw.githubusercontent.com/.../latest/packages/<pkg>/dist/script.user.jsinstead. Dropped the flat root-level mirror commit step and the release-asset upload step fromrelease.yamlaccordingly. 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:LinkTargettype +normalizeTarget/requiredFields/targetKey/buildJumpUrl/configToYamlLitesupport; expandedContextFieldKey/CONTEXT_FIELD_KEYS/contextFields;renderInlineButton/populateJumpContainer/styleJumpButtonfor the inline-vs-floating button split;checkForUpdate/showUpdateToast/isVersionUpdate/recordSeenVersionfor 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/@updateURLswitched 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.jsmirror 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, expandedcontextFields, andisVersionUpdate..github/jump-links.config.yaml: docs/example update for the new field vocabulary andtype: link.Test plan
tsc --buildcompiles cleanly (verified via a scratch compile in this sandbox - no package registry access here to run the realyarn build; CI will run the actual build).node --testpasses all 52 unit tests (52/52, including the new link-target andisVersionUpdatecases), against a local scratch build ofdist/index.js.type: linktarget shows/hides correctly based on which{{fieldKey}}placeholders its URL template uses.Generated by Claude Code