Working notes for any AI coding agent operating on this repository. Read this before touching the tree. Humans can read it too.
Desktop app that turns websites into integrated .desktop launchers. Three
binaries backed by a shared core:
| Binary | Crate | Role |
|---|---|---|
big-webapps-gui |
webapps-manager |
GTK4/libadwaita UI to CRUD webapps |
big-webapps-exec |
webapps-exec |
Launcher shim invoked by generated .desktop files |
big-webapps-viewer |
webapps-viewer |
Embedded WebKitGTK window (app-mode webapps) |
| — | webapps-core |
Shared models, TOML configs, i18n plumbing |
The Python version in /usr/share/biglinux/webapps/ is the legacy stable.
This Rust rewrite replaces it.
-
Language
- Code, identifiers, commits, internal comments → English.
- User-facing strings (gettext) → Brazilian Portuguese is the primary translation; source strings stay in English.
- Conversation with the maintainer in this repo → Brazilian Portuguese.
-
File sizes
- Target 200–300 lines. Justify going over 500.
- Function bodies 4–20 logical lines. Longer = split.
-
Naming
- No
data,helper,util,manager,process. Prefer specific, grep-friendly names (resolve_icon_path,rebuild_sections).
- No
-
Types
- Explicit types on all public Rust APIs.
- Domain primitives over raw strings where possible (see
webapps-core::models::{CategoryList, ProfileKind, WebAppUrl, BrowserId}).
-
Comments — default to zero
- Do NOT write "what" comments when the code already says it.
- Do NOT write "added for X", "used to be Y", or references to PRs, issues, commits, past rewrites, or planning docs. The git log is the history.
- DO write a one-line comment when the why is non-obvious (hidden invariant, workaround, surprising ordering).
-
Scope discipline
- Bug fix = fix the bug. No drive-by refactor.
- No new abstractions until there is a third concrete caller.
- No feature flags / back-compat shims unless the maintainer asks.
- No
*.mdplanning documents unless explicitly requested.
-
Safety
- Tool side-effects: deleting files, force-pushing, modifying shared state → confirm with the maintainer first.
- No
--no-verify, no--amendon already-pushed commits, no hook skipping.
crates/ Rust workspace (no GTK in -core)
webapps-core/ shared lib: models, browsers.toml loader, i18n, desktop writer
webapps-manager/ GUI crate (binary big-webapps-gui, plus lib)
webapps-exec/ launcher shim (binary big-webapps-exec)
webapps-viewer/ WebKit window (binary big-webapps-viewer)
biglinux-webapps/ Data tree shipped by every packager
usr/share/
applications/ br.com.biglinux.webapps.desktop
metainfo/ br.com.biglinux.webapps.metainfo.xml (AppStream)
icons/hicolor/ big-webapps.svg + big-webapps-symbolic.svg
biglinux-webapps/ browsers.toml
biglinux/webapps/ bundled browser icons + viewer profile seed
desktop-directories/ big-webapps.directory, google-apps.directory
usr/lib/systemd/user/ biglinux-webapps.service
usr/bin/ biglinux-webapps-systemd (session init helper)
etc/xdg/menus/ KDE/GNOME menu integration
packaging/ One subfolder per distribution channel
arch/ PKGBUILD + biglinux-webapps.install
flatpak/ br.com.biglinux.webapps.yml + generate-cargo-sources.sh
flake.nix Nix flake: package, devShell, apps.default
po/ Translation catalogs + biglinux-webapps.pot
scripts/
validate-customizations.sh one-shot local gate (see below)
update-translations.sh regenerate .pot + msgmerge every .po
- Auto-detects a local working tree via
BASH_SOURCE[0]; falls back togit+${url}.gitwhen building without one. - Version =
$(date +%y.%m.%d)-$(date +%H%M), surfaced to the app via theBIGLINUX_WEBAPPS_VERSIONenv var at build time. - Mirrors the source into
$srcdir/$pkgnamevia rsync withtarget/,.git/, andpackaging/arch/{pkg,src}/excluded — do not casually add new top-level dirs without extending the exclude list.
- Runtime:
org.gnome.Platform//48(current Flathub-recommended branch; each GNOME branch supported for ~1 year — bump in lockstep with upstream) plusorg.freedesktop.Sdk.Extension.rust-stable//24.08for the Rust toolchain. The extension branch must match the Freedesktop base of the GNOME runtime (verify withflatpak info -m org.gnome.Sdk//<ver>). - Local test:
flatpak-builder --user --install --force-clean build-dir packaging/flatpak/br.com.biglinux.webapps.yml. - Flathub submission checklist:
- Swap the
type: dirsource fortype: gitpinned to the release tag. - Run
packaging/flatpak/generate-cargo-sources.shto producecargo-sources.json, then add it to the manifestsources:list. - Drop
--share=networkfrombuild-options.build-args, setCARGO_NET_OFFLINE: 'true'in the build env, and change the build commands tocargo --offline fetch+cargo build --offline --release --locked.
- Swap the
- The app-id is
br.com.biglinux.webappsand must stay that way — all.desktop, metainfo, icon, and D-Bus names key off it.
nix buildproduces the full package with binaries, desktop entry, metainfo, icons, browsers.toml, and compiled locales.nix runlaunchesbig-webapps-gui.nix developdrops into a shell with cargo + all native GTK/WebKit deps.- webkitgtk-6.0 is referenced as
pkgs.webkitgtk_6_0; adjust if a newer nixpkgs pin renames the attribute.
Before declaring any change complete, run:
./scripts/validate-customizations.shThat wraps:
cargo fmt --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace
shellcheck biglinux-webapps/usr/bin/biglinux-webapps-systemd packaging/arch/PKGBUILD
shfmt -d biglinux-webapps/usr/bin/biglinux-webapps-systemd packaging/arch/PKGBUILD
bash -n biglinux-webapps/usr/bin/biglinux-webapps-systemd packaging/arch/PKGBUILD
Warnings are failures. If the script is missing a tool, install it; do not comment out the check.
UI changes require a manual sanity run:
cargo run --release --bin big-webapps-guiIf you cannot launch a GUI from your environment, say so explicitly in the summary instead of claiming UI success.
- Adding a new gettext string in code → run
./scripts/update-translations.sh(needscargo install xtr). That regeneratespo/biglinux-webapps.potandmsgmerges eachpo/*.po. Strings that match a close existing entry get flagged#, fuzzy— translators review those. Untranslated / fuzzy strings are dropped from the compiled.mo, so the UI falls back to English until a human updates them. - pt-BR is the primary translation. Keep it fully translated at all times. Other languages can lag behind.
- The PKGBUILD, Flatpak manifest, and Nix flake all compile
.po → .moat build time and install to/usr/share/locale/<lang>/LC_MESSAGES/biglinux-webapps.mo. The-inpt-BRis normalized to_(POSIX) during install.
- Source of truth is
browsers.toml, not code. - Default-browser resolution uses
desktop_pattern+desktop_aliases+ the Flatpakflatpak_app_id. Longest match wins. - When
xdg-settingsfails,xdg-mime query default x-scheme-handler/httpis the fallback. flatpak_idis returned when the system default points to the Flatpak variant; the nativeidotherwise.
- Any filesystem/network call that can block longer than ~50 ms runs on a worker. The result callback executes back on the main loop.
- Do not call GTK APIs from inside the worker closure. Only from the result callback.
- Returns either an absolute path (file found) or a plain icon name
(theme lookup). The caller chooses
set_from_filevsset_icon_namebased on that distinction. - Walks a size fallback chain and progressive suffix stripping; keep both.
create_webapp/update_webapp/delete_webapp/delete_all_webappseach hold an advisory file lock and have rollback paths. Integration tests incrates/webapps-manager/tests/crud_integration.rsguard those contracts — do not break them casually.
- Window and per-dialog sizes are persisted to JSON under the user cache
dir. Binding helpers:
load_geometry,save_geometry,bind_adw_dialog.
- Chromium-family browsers don't let us set WM_CLASS. Workaround: swap
the
.desktopIcon= entry, launch, then restore.DEFAULT_SWAP_SETTLE_MSis tuned; override viaBIG_WEBAPPS_SWAP_SETTLE_MSif a compositor needs more time.
- Cargo version lives in
Cargo.toml([workspace.package]). Keep it in step with the AppStream<releases>entries inbiglinux-webapps/usr/share/metainfo/br.com.biglinux.webapps.metainfo.xml. - Arch PKGBUILD uses a date-based
pkgver; bumping it is automatic. - Flatpak and Nix read the Cargo version (or git tag). Tag releases as
v<major>.<minor>.<patch>. Cargo.lockis committed. Do not regenerate it casually — commit intentional updates as their own change.
- "Rewrite everything in async" / large-scale refactors without a concrete failing case.
- "Skip the hook / bypass the lint" — investigate the failure instead.
- "Add a planning doc / architecture diagram" unless the maintainer explicitly asked.
- Any change that ships code behind a feature flag purely because an agent was unsure.
When blocked by ambiguity, ask. Do not guess the maintainer's intent on wide-blast-radius operations.