fix: CodeGit looked like an empty black box - hardcoded panel height + cache
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
This commit is contained in:
+79
-7
@@ -224,7 +224,79 @@ Worth doing if the dialog starts 500-ing again after editing a macro in the UI.
|
||||
|
||||
---
|
||||
|
||||
## 4. Checking for plugin problems in future
|
||||
## 4. 🟠 The CodeGit panel looked like an empty black box
|
||||
|
||||
**Symptom:** the CodeGit dialog appeared as a mostly-empty black rectangle. Nothing was *broken* —
|
||||
it was unreadable, which reads as "broken".
|
||||
|
||||
**This was NOT a codegit bug.** Verified exhaustively first:
|
||||
|
||||
```
|
||||
all four panels return real content 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 browser console; all DOM helpers (replaceClass etc.) exist
|
||||
```
|
||||
|
||||
**Root cause — the generic `panel` rule hardcodes a height.** `theme/modules/common/_panel.scss`
|
||||
(after minification, in `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); }
|
||||
```
|
||||
|
||||
Measured live, that produces:
|
||||
|
||||
| Element | Height | Problem |
|
||||
|---|---|---|
|
||||
| `#dialog` | 404px | clamped by `max-height: 70vh` + `overflow-y: auto` |
|
||||
| `#codegit panel` | 500px | **forced**, while its content is 119px |
|
||||
| `toolbar` ("Branch: …") | top **620** vs dialog bottom **490** | **pushed OUTSIDE the modal** |
|
||||
|
||||
So ~380px of the dialog was **empty dead space**, and anything after the panel — including the
|
||||
Branch line — rendered *below* the modal, invisible. A generic `panel { height: 500px }` is exactly
|
||||
the kind of rule that looks like a void.
|
||||
|
||||
**Fix applied:**
|
||||
|
||||
```css
|
||||
panel { ... height: auto; max-height: 58vh; overflow-y: auto; ... }
|
||||
```
|
||||
|
||||
Content-sized, capped so long content (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)
|
||||
```
|
||||
|
||||
`theme/modules/common/_panel.scss` is updated too, so the source does not contradict the shipped CSS
|
||||
(there is no Sass compiler on the guest, so `main.min.css` is edited directly).
|
||||
|
||||
---
|
||||
|
||||
## 5. 🟠 CSS/JS changes were invisible behind the browser cache
|
||||
|
||||
**Symptom:** a fix to the theme did not appear until a hard refresh — so the panel fix above looked
|
||||
like it had not worked at all.
|
||||
|
||||
**Root cause:** Atheos serves `theme/main.min.css` and the generated `public/*.min.js|css` bundles
|
||||
from **stable URLs with no cache headers**, so nginx adds only `Last-Modified`/`ETag` and browsers
|
||||
legitimately reuse their cached copy.
|
||||
|
||||
**Fix:** nginx now sends `Cache-Control: no-cache, must-revalidate` for `*.css`/`*.js`. Note this does
|
||||
**not** disable caching — it forces **revalidation**, so normal loads still get a cheap 304 while any
|
||||
change is guaranteed to be picked up on the next load.
|
||||
|
||||
**If you ever see a stale UI again:** force a reload (Ctrl/Cmd-Shift-R). That is the first thing to try
|
||||
before assuming a fix failed.
|
||||
|
||||
---
|
||||
|
||||
## 6. Checking for plugin problems in future
|
||||
|
||||
The plugin's JS is bundled into `public/plugins.min.js` (built by `classes/sourcemanager.php`), and
|
||||
its rightbar button is rendered by `components/sidebars/sb-right.php` from `plugin.json`. Both were
|
||||
@@ -258,17 +330,17 @@ verify them before trusting it.
|
||||
|
||||
---
|
||||
|
||||
## 5. Follow-ups not done (recorded so they are not forgotten)
|
||||
## 7. Follow-ups not done (recorded so they are not forgotten)
|
||||
|
||||
These came out of review. They are **operator decisions**, not agent ones — several change what the
|
||||
editor can do.
|
||||
|
||||
### 5.1 Remove the Terminal plugin — ✅ DONE
|
||||
### 7.1 Remove the Terminal plugin — ✅ DONE
|
||||
|
||||
Removed through the market's own code path once §1 was fixed (see §2). A browser shell was the largest
|
||||
attack surface in the container and macros already cover command execution.
|
||||
|
||||
### 5.2 ❌ `disable_functions` cannot be "on by default" here — measured
|
||||
### 7.2 ❌ `disable_functions` cannot be "on by default" here — measured
|
||||
|
||||
Review asked for `php.ini` to disable `exec`, `shell_exec`, `passthru`, `system` by default.
|
||||
**This would break the editor's core function.** Evidence:
|
||||
@@ -285,18 +357,18 @@ turns the editor into a text editor that cannot commit. So it stays **a delibera
|
||||
you would also lose macros and git integration, which is why S-7 already says *"test, do not
|
||||
blind-apply"*.
|
||||
|
||||
### 5.3 Rotate the terminal password automatically
|
||||
### 7.3 Rotate the terminal password automatically
|
||||
|
||||
If the plugin is kept, `provision.sh` should generate a random password rather than leaving the
|
||||
upstream default. Not implemented: it would hardcode a secret into a repo file, which is the same
|
||||
class of problem this file already documents.
|
||||
|
||||
### 5.4 Deploy key could be read-only
|
||||
### 7.4 Deploy key could be read-only
|
||||
|
||||
Review suggested making the deploy key read-only if writes are unnecessary. **They are necessary** —
|
||||
that is the whole point of the writer-branch workflow (macro 2 pushes). Not applicable.
|
||||
|
||||
### 5.5 The real upstream fix for §3
|
||||
### 7.5 The real upstream fix for §3
|
||||
|
||||
`class.macro.php::save()` should write `[]` instead of `"N/A"` for folder macros. See §3 — the fix is
|
||||
currently applied to the data, so it survives updates, at the cost of being reversible from the UI.
|
||||
|
||||
Reference in New Issue
Block a user