From e594ec37806754125e51cf179b882b7905c0faea Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 16 Nov 2026 02:04:45 +1100 Subject: [PATCH] chore: cleanup unused files --- extras/gitea-agent-view/README.md | 88 ----------- extras/gitea-agent-view/agent-monitor.js | 158 ------------------- extras/gitea-agent-view/body_inner_post.tmpl | 36 ----- extras/gitea-agent-view/extra_tabs.tmpl | 18 --- 4 files changed, 300 deletions(-) delete mode 100644 extras/gitea-agent-view/README.md delete mode 100644 extras/gitea-agent-view/agent-monitor.js delete mode 100644 extras/gitea-agent-view/body_inner_post.tmpl delete mode 100644 extras/gitea-agent-view/extra_tabs.tmpl diff --git a/extras/gitea-agent-view/README.md b/extras/gitea-agent-view/README.md deleted file mode 100644 index 5310223ad..000000000 --- a/extras/gitea-agent-view/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Gitea agent-run view - -Untracked reference copies — deploy by hand onto the gitea container. - -Renders inside Gitea's own Actions page (real `base/head` / `repo/header` -/ `base/footer`, real `.Repository`/`.CurWorkflow` context) via the -`body_inner_post.tmpl` hook — no full-file template override needed. -Confirmed 2026-07-22 that this hook receives the same per-page context -as `templates/repo/actions/list.tmpl`. - -## Files → destinations - -| file | destination on gitea container | role | -| ---------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------- | -| `extra_tabs.tmpl` | `$GITEA_CUSTOM/templates/custom/extra_tabs.tmpl` | adds the "Agent Run" repo tab | -| `body_inner_post.tmpl` | `$GITEA_CUSTOM/templates/custom/body_inner_post.tmpl` | loads the CDN CSS/JS + agent-monitor.js, gated on the sentinel | -| `agent-monitor.js` | `$GITEA_CUSTOM/public/assets/agent-monitor.js` | swaps the runs-list segment's content for the terminal, opens the SSE connection | - -`$GITEA_CUSTOM` is usually `/data/gitea` in the container — confirm via -Site Administration > Configuration, or `gitea help`. - -Restart Gitea after copying either file (custom/templates is only read -at startup unless `RUN_MODE = dev`). - -## How it fits together - -`extra_tabs.tmpl` links to the real `/actions` route with a sentinel -`?workflow=__agent_monitor__`. Gitea's Actions handler happily sets -`.CurWorkflow` to that string (it doesn't validate it matches a real -workflow file) and renders the stock page as normal — sidebar, run-count -bar, "0 workflow runs" panel, all real Gitea markup. `body_inner_post.tmpl` -then fires on that same page, sees the sentinel, and loads -`agent-monitor.js`, which: - -1. finds the real `.ui.attached.segment` inside `.flex-container-main` - — the element list.tmpl already sizes correctly to hold the runs - list — and swaps its content for the terminal, rather than hiding or - duplicating anything -2. hides the run-count/filter bar directly above that segment (nothing - to filter once the terminal's showing) -3. styles the segment as a floating rounded card (border radius, shadow) -4. mounts the xterm.js terminal inside it and opens the SSE connection - -The sidebar is deliberately left alone — it's real, always-current Gitea -markup (actual workflow files, actual routes). An earlier version tried -hiding it and hardcoding a lookalike sidebar instead; that goes stale the -moment a workflow is added/renamed, so it was dropped in favour of this. -Nesting the terminal inside other stock wrapper classes (e.g. -`.ui.top.attached.header`, meant for the slim counter bar) also produced -a tiny clipped box in testing — reason `.ui.attached.segment` specifically -is the target now. - -**Why the terminal logic is a separate `.js` file, not inline in the -template:** Gitea's CSP requires a per-request nonce for inline -` - - -{{end}} diff --git a/extras/gitea-agent-view/extra_tabs.tmpl b/extras/gitea-agent-view/extra_tabs.tmpl deleted file mode 100644 index 1a999f5ee..000000000 --- a/extras/gitea-agent-view/extra_tabs.tmpl +++ /dev/null @@ -1,18 +0,0 @@ -{{/* - Copy to: $GITEA_CUSTOM/templates/custom/extra_tabs.tmpl - (on the gitea container: /data/gitea/templates/custom/extra_tabs.tmpl, - or wherever GITEA_CUSTOM points — check Site Administration > Configuration) - - Adds an "Agent Run" tab to the repo header, matching the markup Gitea - uses for its own tabs (see templates/repo/header.tmpl upstream). - Restart Gitea after copying (custom/templates is only read at startup - unless RUN_MODE = dev). - - Links into the real Actions list route with a sentinel ?workflow= value - that list.tmpl (see list.tmpl in this same directory) intercepts to - render agent_monitor.tmpl instead of the normal runs list — real - head/header/footer, no separate static page or route needed. -*/}} - - {{svg "octicon-play" 16 "tw-mr-2"}}Agent Run - \ No newline at end of file