From c4ad32771290c0f21ee2ac95fd16cfbd50de99d5 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 7 Nov 2026 13:38:24 -0800 Subject: [PATCH 01/50] Web: deploy main to app.draftcraft.dev on every push (fork only) Builds apps/draftcraft-web with Trunk and publishes it with GitHub Pages' Actions flow, only in withshalom/draftcraft and only from main. Not part of the pull requests sent upstream. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F67Rss9szchwv8emEAdE9m --- .github/workflows/web-deploy.yml | 91 ++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/web-deploy.yml diff --git a/.github/workflows/web-deploy.yml b/.github/workflows/web-deploy.yml new file mode 100644 index 00000000..8071c563 --- /dev/null +++ b/.github/workflows/web-deploy.yml @@ -0,0 +1,91 @@ +# Builds DraftCraft's browser version (apps/draftcraft-web, wasm via Trunk) from `main` and publishes it to +# GitHub Pages at https://app.draftcraft.dev/ (Settings › Pages › Source: GitHub Actions) on every push to +# `main`, so the site is always the live main. Only in withshalom/draftcraft (WithShalom Studios' fork of +# SkryxDev/DraftCraft); any other branch or repository builds nothing. This file is the fork's own: it is +# not part of the pull requests sent upstream. +name: web-deploy + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +# A custom domain, when there is one: set it here and point its DNS at GitHub Pages. +env: + CUSTOM_DOMAIN: app.draftcraft.dev + TRUNK_VERSION: 0.21.14 + TRUNK_SHA256: f2b4680cd239693a646a2795e4633c625328d7b2a044fbe749fa3a2fe9e7036b + +jobs: + build: + # Only in withshalom/draftcraft, only from main. + if: github.repository == 'withshalom/draftcraft' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + timeout-minutes: 90 + env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Install Rust (stable) with the wasm target + uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 + with: + toolchain: stable + targets: wasm32-unknown-unknown + + - name: Cache cargo and target + uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 + with: + key: web-deploy + + - name: Install Trunk (checksum verified, as upstream's release does) + run: | + url="https://github.com/trunk-rs/trunk/releases/download/v${TRUNK_VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz" + curl --proto '=https' --proto-redir =https -fsSL -o "$RUNNER_TEMP/trunk.tar.gz" "$url" + echo "$TRUNK_SHA256 $RUNNER_TEMP/trunk.tar.gz" | sha256sum -c - + tar -xz -C "$HOME/.cargo/bin" -f "$RUNNER_TEMP/trunk.tar.gz" trunk + trunk --version + + - name: Build (release) + working-directory: apps/draftcraft-web + run: trunk build --release + + - name: Check the site uses relative URLs + run: | + test -f dist/web/index.html + if grep -Eq '(src|href)="/[^/]' dist/web/index.html; then + echo "index.html has root-absolute URLs" >&2 + exit 1 + fi + + - name: Add Pages files + run: | + touch dist/web/.nojekyll + if [ -n "$CUSTOM_DOMAIN" ]; then echo "$CUSTOM_DOMAIN" > dist/web/CNAME; fi + + - uses: actions/configure-pages@v5 + + - uses: actions/upload-pages-artifact@v3 + with: + path: dist/web + + deploy: + if: github.repository == 'withshalom/draftcraft' && github.ref == 'refs/heads/main' + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 From e652165182341c8a0d3113f0e106743775971d8d Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 7 Nov 2026 14:33:19 -0800 Subject: [PATCH 02/50] The DraftCraft logo in the app; the menu bar above the ribbon on the web and Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Logo - crates/ui-egui/src/brand.rs: the app icon (the compass on its blueprint tile) as a texture, decoded once per size, with a DC tile only if it can't be drawn. - The application button shows the logo instead of the DC letters; the Start page and the About window show it beside the name; About adds "DraftCraft and the DraftCraft logo are trademarks of WithShalom Studios." (Italian and Chinese added). The Windows title bar uses the same module. - Web: the logo is the page's favicon and touch icon and sits on the loading screen. Menu bar - Where DraftCraft doesn't draw its own title bar (the web, Linux), the menu bar was drawn after the ribbon, so it sat under it. It is now the top row, laid out like the Windows title bar: the logo, the name, then File … Help, above the application bar and the ribbon. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01F67Rss9szchwv8emEAdE9m --- apps/draftcraft-web/index.html | 5 ++- crates/ui-egui/src/brand.rs | 72 ++++++++++++++++++++++++++++++ crates/ui-egui/src/chrome.rs | 6 ++- crates/ui-egui/src/dialogs.rs | 13 +++++- crates/ui-egui/src/i18n/it.tsv | 1 + crates/ui-egui/src/i18n/zh.tsv | 1 + crates/ui-egui/src/lib.rs | 5 ++- crates/ui-egui/src/menus.rs | 23 ++++++++-- crates/ui-egui/src/ribbon.rs | 12 ++--- crates/ui-egui/src/window_frame.rs | 27 ++--------- 10 files changed, 126 insertions(+), 39 deletions(-) create mode 100644 crates/ui-egui/src/brand.rs diff --git a/apps/draftcraft-web/index.html b/apps/draftcraft-web/index.html index f1bdf8d4..83507970 100644 --- a/apps/draftcraft-web/index.html +++ b/apps/draftcraft-web/index.html @@ -5,6 +5,9 @@ DraftCraft + + +