fix: CodeGit black box - hardcoded panel height + CSS cache #5

Merged
hermes merged 1 commits from fix/codegit-panel-layout into master 2026-09-29 16:39:02 +10:00
Owner

Summary

"CodeGit is just a black box" was a CSS layout bug — codegit itself works perfectly.

I verified the component first, and it is fine

Through the authenticated API, all four panels return real content:

Panel Status Bytes
overview 200 940
log 200 79,596 (full commit history)
transfer 200 1,460
config 200 1,174

No JS errors in the browser console; every DOM helper codegit calls (replaceClass, etc.) exists.
Loaded the real app in a browser, authenticated, and clicked through it — the panel renders with the
commit box, your untracked file, and the branch name.

Root cause 1 — a generic CSS rule hardcodes a height

theme/modules/common/_panel.scss → theme/main.min.css:

panel { padding: 5px; width: calc(100% - 200px); overflow: auto; overflow-y: scroll;
        height: 500px; position: relative; border-left: var(--borderLight); }

That forces every modal panel to a fixed 500px box. Measured live:

Element Height Problem
#dialog 404px clamped by max-height: 70vh + overflow-y: auto
#codegit panel 500px forced; its content is only 119px
toolbar ("Branch: …") top 620 vs dialog bottom 490 pushed OUTSIDE the modal

So ~380px of the dialog was empty dead space, and the Branch line rendered below the modal —
invisible. A generic panel { height: 500px } genuinely looks like a void.

Fixed to height: auto; max-height: 58vh (long content, e.g. the 79KB log, still scrolls).
Verified live:

before: panel 500px -> toolbar top 620, dialog bottom 490   (outside)
after:  panel 136px -> toolbar top 256, dialog bottom 279   (inside)

Root cause 2 — the fix was invisible because of the browser cache

My first attempt appeared to do nothing. Cause: Atheos serves theme/main.min.css and the generated
bundles from stable URLs with no cache headers, so the browser legitimately reused its cached
copy. nginx now sends Cache-Control: no-cache, must-revalidate for *.css/*.js — this does not
disable caching (normal loads still get cheap 304s), it forces revalidation so a change is always
picked up.

Deliverables

  • scripts/fix-panel-layout.sh — idempotent re-apply of both fixes, since update-atheos.sh
    replaces the tree and would lose them. Verified it reports "already applied" when run twice.
  • docs/known-issues.md §4 and §5 — both findings with the actual measurements.

Tests — 44 passed, 1 failed

Added:

  • the panel rule must not be fixed at 500px
  • the theme CSS must send Cache-Control: no-cache

The single failure is branch protection on armistace/blog — a genuine, still-open operator
action (403 for the bot: collaborator, not owner). It self-reports on every run.

Test plan

  • All four codegit panels return content (authenticated API)
  • Panel/toolbar geometry measured before and after
  • Fix confirmed with the freshly-served CSS in a clean browser session
  • fix-panel-layout.sh verified idempotent
  • nginx config test passes; editor still HTTP 200
  • Temporary test bootstrap removed from the guest
## Summary **"CodeGit is just a black box" was a CSS layout bug — codegit itself works perfectly.** ### I verified the component first, and it is fine Through the authenticated API, all four panels return real content: | Panel | Status | Bytes | |---|---|---| | overview | 200 | 940 | | **log** | 200 | **79,596** (full commit history) | | transfer | 200 | 1,460 | | config | 200 | 1,174 | No JS errors in the browser console; every DOM helper codegit calls (`replaceClass`, etc.) exists. Loaded the real app in a browser, authenticated, and clicked through it — the panel renders with the commit box, your untracked file, and the branch name. ### Root cause 1 — a generic CSS rule hardcodes a height `theme/modules/common/_panel.scss` → `theme/main.min.css`: ```css panel { padding: 5px; width: calc(100% - 200px); overflow: auto; overflow-y: scroll; height: 500px; position: relative; border-left: var(--borderLight); } ``` That forces **every** modal panel to a fixed 500px box. Measured live: | Element | Height | Problem | |---|---|---| | `#dialog` | 404px | clamped by `max-height: 70vh` + `overflow-y: auto` | | `#codegit panel` | 500px | **forced**; its content is only **119px** | | `toolbar` ("Branch: …") | top **620** vs dialog bottom **490** | **pushed OUTSIDE the modal** | So ~380px of the dialog was **empty dead space**, and the Branch line rendered *below* the modal — invisible. A generic `panel { height: 500px }` genuinely looks like a void. **Fixed** to `height: auto; max-height: 58vh` (long content, e.g. the 79KB log, still scrolls). Verified live: ``` before: panel 500px -> toolbar top 620, dialog bottom 490 (outside) after: panel 136px -> toolbar top 256, dialog bottom 279 (inside) ``` ### Root cause 2 — the fix was invisible because of the browser cache My first attempt appeared to do nothing. Cause: Atheos serves `theme/main.min.css` and the generated bundles from **stable URLs with no cache headers**, so the browser legitimately reused its cached copy. nginx now sends `Cache-Control: no-cache, must-revalidate` for `*.css`/`*.js` — this does **not** disable caching (normal loads still get cheap 304s), it forces revalidation so a change is always picked up. ### Deliverables - `scripts/fix-panel-layout.sh` — **idempotent** re-apply of both fixes, since `update-atheos.sh` replaces the tree and would lose them. Verified it reports "already applied" when run twice. - `docs/known-issues.md` §4 and §5 — both findings with the actual measurements. ### Tests — 44 passed, 1 failed Added: - the `panel` rule must not be fixed at 500px - the theme CSS must send `Cache-Control: no-cache` The single failure is **branch protection on `armistace/blog`** — a genuine, still-open operator action (403 for the bot: collaborator, not owner). It self-reports on every run. ## Test plan - [x] All four codegit panels return content (authenticated API) - [x] Panel/toolbar geometry measured before and after - [x] Fix confirmed with the freshly-served CSS in a clean browser session - [x] `fix-panel-layout.sh` verified idempotent - [x] nginx config test passes; editor still HTTP 200 - [x] Temporary test bootstrap removed from the guest
hermes added 1 commit 2026-09-29 16:39:01 +10:00
Reported as "why can't i see anything from codegit its just a black box".

NOT a codegit bug. Verified first, exhaustively, through the authenticated API:
  overview  200    940 bytes
  log       200  79596 bytes   (full commit history)
  transfer  200   1460 bytes
  config    200   1174 bytes
no JS errors in the console; every DOM helper codegit calls exists.

ROOT CAUSE 1 - a generic CSS rule hardcodes a height
  theme/modules/common/_panel.scss -> theme/main.min.css:
    panel { ... height: 500px; ... }
  That forces EVERY modal panel to a fixed 500px box. Measured live:
    #dialog            404px  (clamped by max-height:70vh + overflow-y:auto)
    #codegit panel     500px, while its content is only 119px
    toolbar ("Branch") top 620 vs dialog bottom 490 -> OUTSIDE the modal
  So ~380px of the dialog was empty dead space and the Branch line rendered below the
  modal, invisible. Fixed to height:auto with max-height:58vh (long content still scrolls):
    before: panel 500 -> toolbar top 620, dialog bottom 490 (outside)
    after:  panel 136 -> toolbar top 256, dialog bottom 279 (inside)
  _panel.scss updated too so the source does not contradict the shipped CSS.

ROOT CAUSE 2 - the fix was invisible because of the browser cache
  Atheos serves theme/main.min.css and the generated bundles from stable URLs with no cache
  headers, so browsers legitimately reuse their cached copy - which is why the first attempt
  appeared to do nothing. nginx now sends Cache-Control: no-cache, must-revalidate for
  *.css/*.js: caching still works (cheap 304s) but changes are always picked up.

Adds
  scripts/fix-panel-layout.sh   idempotent re-apply for both fixes (lost on update-atheos)
  docs/known-issues.md §4, §5   both findings, with the measurements

Tests (44 passed, 1 failed - the failure is branch protection, a genuine open item)
  + panel must not be fixed at 500px
  + theme CSS must send Cache-Control: no-cache
hermes merged commit 1ff8aaf2f1 into master 2026-09-29 16:39:02 +10:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hermes/atheos-blog-lxc#5