Commit 01f1988
fix(#82): address Copilot review findings on firewall editor PR
- helpers.go: refresh sectionsJSON doc-comment — payload is embedded in a
hidden <textarea>, not a <script type="application/json"> (the inline
templ comment already noted this; the helper doc was stale).
- helpers.go: add shortSHA() — safe 12-char truncation that returns the
original string when shorter than 12 chars, instead of panicking on a
bounds-out-of-range slice.
- firewall_config.templ: use shortSHA(config.SHA256) for the header SHA
display; document the non-nil `config` precondition in the templ
doc-comment (the HTTP handler routes nil/error to
FirewallConfigPageWithError, so the hidden input/textarea elements
legitimately rely on it).
- editor.js: drop the unread `btn.dataset.line` assignment in
makeNavButton — scrollToLine is invoked via the closure with
section.start_line, so the dataset attribute was dead code.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3b827fb commit 01f1988
3 files changed
Lines changed: 24 additions & 4 deletions
File tree
- gearbox
- internal/framework/templates/pages
- static/js/firewall_config
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
| |||
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
22 | | - | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | 268 | | |
270 | 269 | | |
271 | 270 | | |
| |||
0 commit comments