Skip to content

Commit adac987

Browse files
committed
πŸ”¨ refactor: refactor: security + UX improvements + module split
Phase 2 fixes: - SEC-02: zip bomb protection in import - QUALITY-02: signal handler leak fix - QUALITY-06: atomic JSON writes (tmp + rename) - UX-01: validation feedback CSS - UX-02: save error Banner display - UX-05: skip auto-detect on template selection - POLISH-03: geometry save accuracy (non-maximized dimensions) - POLISH-05: cancel debounce on dialog close - POLISH-06: context menu action group reuse High priority: - 2.6: permission prompt system β€” camera/mic/geolocation prompt via AlertDialog, decisions persisted in permissions.json; non-sensitive perms (notifications, clipboard, DRM) auto-granted - 2.3: import/export on background threads via std::thread::spawn + glib::timeout_add_local polling (non-blocking UI) Medium priority: - 3.5: collapse Behavior section for new webapps β€” "Advanced Settings..." button reveals on click - 3.9: split service.rs (735L) into service/ module directory β€” mod.rs (249L), browser.rs (126L), io.rs (130L), migration.rs (255L) Build: zero warnings (build + clippy), 35/35 tests pass.
1 parent 7801f3d commit adac987

9 files changed

Lines changed: 1097 additions & 808 deletions

File tree

β€ŽPLANNING.mdβ€Ž

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PLANNING.md β€” BigLinux WebApps v4.0.0 Full Audit
22

3-
> Generated: 2025-06-23 | Updated: 2025-06-24 (post-fix)
3+
> Generated: 2025-06-23 | Updated: 2025-06-25 (Phase 2 fixes applied)
44
> Codebase: 26 .rs files, ~5100 LOC, 3 crates
55
> Tooling: cargo clippy, cargo fmt, cargo audit, manual review, GTK4/Adwaita audit, Orca a11y audit
66
@@ -453,3 +453,43 @@ A11y issues: ~20 β†’ target 0 (Phase A+B+C)
453453
- **Browser detection caching:** `detect_browsers()` spawns external processes (flatpak list, xdg-settings). Results should be cached for the app session since installed browsers don't change during a single run.
454454
- **shell_split() limitations:** Custom tokenizer doesn't handle escaped quotes (`\"`) or heredoc-style strings. Document this or switch to `shell-words` crate.
455455
- **ZIP path traversal:** Current `canonicalize()` check is correct but `canonicalize()` requires the path to exist. Consider using `Path::components()` check for `..` segments as additional defense.
456+
457+
---
458+
459+
## 11. Phase 2 Fixes Applied (2025-06-25)
460+
461+
All changes verified: cargo build βœ…, cargo clippy 0 warnings βœ…, 35/35 tests βœ…
462+
463+
### Security
464+
| ID | Fix | File | Details |
465+
|----|-----|------|---------|
466+
| SEC-02 | βœ… Zip bomb protection | service.rs | `Read::take(50MB)` limit per extracted file + cleanup on oversize |
467+
468+
### Code Quality
469+
| ID | Fix | File | Details |
470+
|----|-----|------|---------|
471+
| QUALITY-02 | βœ… Signal handler leak | webapp_dialog.rs | `favicon_flow.connect_child_activated` moved out of detect handler β†’ wired once |
472+
| QUALITY-06 | βœ… Atomic JSON writes | service.rs | Write `.json.tmp` β†’ `fs::rename()` β†’ no corruption on crash |
473+
474+
### UX
475+
| ID | Fix | File | Details |
476+
|----|-----|------|---------|
477+
| UX-01 | βœ… Validation feedback | webapp_dialog.rs | Error CSS class + `grab_focus()` on empty/invalid fields |
478+
| UX-02 | βœ… Save error display | webapp_dialog.rs | `adw::Banner` error message, dialog stays open |
479+
| UX-05 | βœ… Skip auto-detect on template | webapp_dialog.rs | `skip_auto_detect` Cell flag β†’ no redundant favicon fetch |
480+
481+
### Polish
482+
| ID | Fix | File | Details |
483+
|----|-----|------|---------|
484+
| POLISH-03 | βœ… Geometry save accuracy | viewer/window.rs | Use `window.width()/height()` for non-maximized, `default_size()` fallback for maximized |
485+
| POLISH-05 | βœ… Cancel debounce on close | webapp_dialog.rs | `connect_destroy` cancels pending `SourceId` timer |
486+
| POLISH-06 | βœ… Context menu action group leak | viewer/window.rs | Action group created once, action takes URI as `String` param β†’ reused per right-click |
487+
488+
### Phase 3 β€” High+Medium Priority (2025-06-25)
489+
490+
| ID | Fix | File | Details |
491+
|----|-----|------|---------|
492+
| 2.6 | βœ… Permission prompt system | viewer/window.rs | Camera/mic/geolocation β†’ `adw::AlertDialog` prompt, decision persisted in `permissions.json`, other perms auto-granted |
493+
| 2.3 | βœ… Background I/O threads | manager/window.rs | Import/export run on `std::thread::spawn`, result polled via `glib::timeout_add_local` |
494+
| 3.5 | βœ… Collapse Behavior section | webapp_dialog.rs | New webapps: Behavior group hidden, "Advanced Settings…" button reveals it |
495+
| 3.9 | βœ… Split service.rs | service/ | 735L monolith β†’ 4 modules: mod.rs(249), browser.rs(126), io.rs(130), migration.rs(255) |

0 commit comments

Comments
Β (0)