Skip to content

grafana-jump: fix dark-mode inputs, add repo-shared config - #39

Merged
nsheaps-oura merged 2 commits into
mainfrom
claude/greasyfork-auto-pull-plugins-qhe8nz
Aug 6, 2026
Merged

grafana-jump: fix dark-mode inputs, add repo-shared config#39
nsheaps-oura merged 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

  • Fixes illegible config-modal input fields under browser dark mode by explicitly setting background/color on inputs instead of relying on default form-control styling.
  • Adds support for a repo-checked-in shared config at .github/jump-links.config.yaml, fetched via GM.xmlHttpRequest from raw.githubusercontent.com (no auth required). A contributor's personal config still wins outright for any page it covers; the repo config is only used as a fallback where nobody has personally configured a target.
  • Adds two buttons to the config panel:
    • Create repo config template — opens GitHub's create-file UI pre-filled with a commented YAML template, for repos with no config yet.
    • Export my config to repo — opens the same create-file UI pre-filled with the union of the repo's existing config and the user's personal config (deduped, repo's copy wins on collision), rather than overwriting.
    • Both hand off to GitHub's own web UI for the actual commit/PR, so the userscript itself never touches git history.
  • Extends jump targets to also filter/template by repo name, runner group, workflow run ID, and job ID, and generalizes matching so a target only shows up when every field it's configured to use is actually present on the current page (previously only one field per page was ever considered).
  • Adds two new page contexts: a workflow run's own page (optionally drilled into one job), and an org's runner group detail page.
  • Adds a second kind of jump target: a Tempo trace search, built as a Grafana Explore TraceQL query with {{fieldKey}} placeholders filled in from the current page - for when there's no dashboard UID to jump to, only a trace/span to search for.
  • Fixes a latent YAML-lite parser bug (surfaced by trace queries containing embedded double quotes) where quoted values were escaped on write but never unescaped on read, breaking round-tripping through the checked-in config file.
  • Adds this repo's own .github/jump-links.config.yaml as a live example with five targets: workflow runs for this repo, for this branch, and on this runner, plus a trace for a workflow run and a span for one job.

Changes

  • packages/github-actions-grafana-jump/src/index.ts: dark-mode input fix; repo-config discovery/fetching (fetchRepoConfig, resolveDefaultBranch) with a hand-rolled YAML-lite parser/serializer (parseYamlLite/configToYamlLite) to avoid a third-party @required YAML library; repoContextForJump; activeDashboards (personal-wins-else-repo-fallback); mergeConfigsForExport (deduped union); buildCreateFileUrl for the GitHub create-file deep link; new RunContext/RunnerGroupContext; a generalized contextFields/requiredFields/applicableDashboards (all-fields-required matching); a new TraceTarget jump-target type alongside the existing dashboard target, with buildTraceExploreUrl/renderTemplate; expanded config-panel UI (target type selector, 8 filterable fields, trace-specific fields, repo-sync buttons).
  • packages/github-actions-grafana-jump/src/meta.json: added GM.xmlHttpRequest grant and @connect entries for raw.githubusercontent.com / api.github.com.
  • packages/github-actions-grafana-jump/test/grafana-jump.test.js: unit tests for all of the above.
  • .github/jump-links.config.yaml: example/dogfood config for this repo.

Test plan

  • CI build (tsc --build) compiles cleanly.
  • CI unit tests (node --test) pass, including the new context-parsing, multi-field applicability, trace-target URL-building, and YAML-lite round-trip cases.
  • Manually verify config modal inputs are legible in both light and dark browser modes.
  • Manually verify "Create repo config template" and "Export my config to repo" open GitHub's create-file UI pre-filled as expected.
  • Manually verify a Tempo trace target opens Grafana Explore with the expected TraceQL query.

Config modal inputs relied on the browser's default text/background
colors, which dark-mode browsers render illegibly against the modal's
fixed light panel - now explicitly styled.

Also lets a repo publish shared dashboard config via
.github/jump-links.config.yaml, fetched from raw.githubusercontent.com
so it works without any auth. A contributor's personal config still
wins outright wherever it applies; the repo config is only a fallback
for pages nobody has personally configured. The config panel gains
"Create repo config template" and "Export my config to repo" buttons
that hand off to GitHub's own create-file UI, so the userscript never
touches git history itself - export unions the two configs (deduped by
dashboard uid) rather than overwriting the repo's file.

Adds this repo's own .github/jump-links.config.yaml as a live example.
@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.3 0.2.4 will-bump

Jump targets previously mapped one page context to exactly one filter
value (branch, PR number, workflow file, or runner ID). Extends the
page-provided field set to include the repo name, runner group, workflow
run ID, and job ID, and generalizes matching so a target only shows up
when *every* field it's configured to use is actually present on the
current page - not just one, since different targets now legitimately
need different combinations (e.g. a "span for this job" target needs
both a run ID and a job ID, which only coexist on a job's own page).

Adds two new page contexts to source those fields: a workflow run's
own page (optionally drilled into one job), and an org's runner group
detail page.

Also adds a second kind of jump target alongside the existing Grafana
dashboard link: a Tempo trace search, built as a Grafana Explore TraceQL
query with `{{fieldKey}}` placeholders filled in from the current page.
A target's required fields are inferred from its varNames (dashboard)
or its query's placeholders (trace), so no separate "required fields"
list needs to be kept in sync by hand.

Fixes a latent bug in the YAML-lite parser surfaced by this: it quoted
values containing embedded double quotes (like a TraceQL query) on
write but never unescaped them on read, so such a value wouldn't
round-trip through the checked-in config file correctly.

Updates the repo config template and this repo's own example config
with five examples: workflow runs for this repo, for this branch, and
on this runner, plus a trace for a workflow run and a span for one job.
@nsheaps-oura
nsheaps-oura marked this pull request as ready for review August 6, 2026 12:12
@nsheaps-oura
nsheaps-oura merged commit 40a083c into main Aug 6, 2026
6 of 7 checks passed
@nsheaps-oura
nsheaps-oura deleted the claude/greasyfork-auto-pull-plugins-qhe8nz branch August 6, 2026 12:12
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