Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
91abdf9
Comment on a table row from its gutter
claude Sep 16, 2026
b43e72a
Resolve a row's subject the way the grid renders it
claude Sep 16, 2026
9be2dbf
Add a view when choosing a type from a tab, never replace the last one
Sep 29, 2026
c58cb88
Ask the drive for its apps again when a view menu opens (#1846)
Sep 29, 2026
ff7bf4a
Add a SessionStart hook for Claude Code cloud sessions
claude Sep 29, 2026
d0ff11a
Say where the time went when the demo setup stalls
joepio Sep 29, 2026
822ec9c
Name the failing request in the account passkey error
joepio Sep 29, 2026
2e64de5
Build in the background and use the environment cache in cloud sessions
claude Sep 30, 2026
edb9342
Don't report a vault backup as failed when another tab switched account
joepio Oct 1, 2026
1f0ef6c
Explain a drive this device can't reach instead of showing a raw error
joepio Oct 1, 2026
6077c6f
AI chat: compact on last-step context size, not summed multi-step usage
joepio Oct 1, 2026
5756620
Canvas: make the selection stand out with a glow, tinted box and bigg…
joepio Oct 1, 2026
f99cfc8
Canvas: picking a color recolors the selected strokes and text
joepio Oct 1, 2026
bb87568
Canvas: measure a color or size tap from where the press landed
joepio Oct 1, 2026
55657de
OpenRouter return: open the AI sidebar, and don't error on a code-les…
joepio Oct 1, 2026
0d13902
Send PRESENCE_SUBSCRIBE before the presence update that follows it
joepio Oct 1, 2026
4fe24dd
Merge #1908: Set up Claude Code cloud sessions: cached tools, backgro…
joepio Oct 1, 2026
4f51d89
Merge #1910: Name the failing request in the account passkey error
joepio Oct 1, 2026
1035f44
Merge #1941: Explain a drive this device can't reach instead of showi…
joepio Oct 1, 2026
98f66cd
Merge #1902: Add a view when choosing a type from a tab, never replac…
joepio Oct 1, 2026
ad309b5
Merge #1904: Ask the drive for its apps again when a view menu opens
joepio Oct 1, 2026
7e62909
Merge #1523: Comment on a table row from its gutter
joepio Oct 1, 2026
1211994
Merge #1909: Say where the time went when the demo setup stalls
joepio Oct 1, 2026
a1c1ec5
Merge #1960: AI chat: compact on real context size, not summed tool-s…
joepio Oct 1, 2026
3597b4d
Merge #1965: Send PRESENCE_SUBSCRIBE before the presence update that …
joepio Oct 1, 2026
5c5e63a
Merge #1964: OpenRouter return: open the AI sidebar, no error on a co…
joepio Oct 1, 2026
5d421c3
Merge #1950: Don't report a vault backup as failed when another tab s…
joepio Oct 1, 2026
e7c8271
Merge #1962: Canvas: stronger selection, recolor the selection, relia…
joepio Oct 1, 2026
83f84d9
Batch fixes: DriveUnavailable catches its expected fetch failures (#1…
joepio Oct 1, 2026
f5c3323
Settle translation catalogs for the batch
joepio Oct 1, 2026
78c6f6c
kanban/timer specs: convert a copy, since #1902 keeps the only view o…
joepio Oct 1, 2026
c7e9346
CI traces: name the Dagger function failedTestResults, which the CLI …
joepio Oct 1, 2026
85163ab
Merge develop (#1962, demo test budget, table reload diagnostics) int…
joepio Oct 2, 2026
da0d491
@tomic/lib unit tests: 20 s timeout, since a loaded CI host timed out…
joepio Oct 2, 2026
9d42fb8
Batch fixes and coverage
joepio Oct 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .claude/hooks/cloud-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Background build for Claude Code cloud sessions, started by
# session-start.sh. Nothing inside the repo survives between sessions (each
# one starts from a fresh clone), so this runs every session; it is kept out
# of the hook so the agent can start working meanwhile.
#
# Progress goes to $STATE/build.log. Each step writes a marker when it ends,
# containing `ok` or `failed`:
# $STATE/packages.done @tomic/* packages built (typecheck, vitest)
# $STATE/server.done debug atomic-server built (cargo, server, e2e)
set -uo pipefail

REPO="${REPO:-$(cd "$(dirname "$0")/../.." && pwd)}"
STATE="${ATOMIC_SETUP_STATE:-/tmp/atomic-setup}"
mkdir -p "$STATE"

# One build per VM, even if a resumed session starts the hook again.
exec 9>"$STATE/build.lock"
flock -n 9 || exit 0

mark() { echo "$2" >"$STATE/$1.done"; }

echo "==> Build @tomic workspace packages ($(date -u +%T))"
cd "$REPO/browser" || exit 1
# data-browser (which also compiles the WASM) is built by the server build.
if pnpm --filter @tomic/lib --filter @tomic/react --filter @tomic/plugin \
--filter @tomic/service-ui --filter @tomic/edit-mode \
--filter @tomic/cli --filter @tomic/svelte -r build; then
mark packages ok
else
mark packages failed
fi

# Its build.rs also builds data-browser and the WASM (wasm-pack), so the Vite
# dev server and `server/` both work afterwards. Uses the default target/:
# browser/lib's integration tests expect target/debug/atomic-server.
echo "==> Debug build of atomic-server ($(date -u +%T))"
cd "$REPO" || exit 1
if cargo build -p atomic-server; then
mark server ok
else
mark server failed
fi
echo "==> Done ($(date -u +%T))"
107 changes: 107 additions & 0 deletions .claude/hooks/cloud-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env bash
# Provisions the tools a Claude Code cloud session needs for this repo and
# warms the download caches. Every step checks first and skips what is already
# there, so a re-run on a provisioned VM takes seconds.
#
# Two callers:
# - The cloud environment's setup script (see AGENTS.md). The environment
# cache snapshots the filesystem after it, so everything outside the repo
# (toolchains, ~/.cargo registry, the pnpm store, Playwright browsers) is
# free in later sessions. That snapshot is only taken when the setup script
# finishes in about five minutes, hence the parallel downloads below.
# - session-start.sh, so sessions without that setup script still work.
#
# Every step is best-effort: a failing step logs a warning, the rest still
# runs, and the script always exits 0 (a failing setup script blocks sessions).
set -uo pipefail

REPO="${REPO:-$(cd "$(dirname "$0")/../.." && pwd)}"
BIN=/usr/local/bin
BINARYEN=version_117

step() { echo "==> $*"; }
warn() { echo "WARN: $*" >&2; }

# --- Rust -------------------------------------------------------------------
step "Rust toolchain from rust-toolchain.toml + wasm targets"
RUST_VERSION=$(sed -n 's/^channel *= *"\(.*\)"/\1/p' "$REPO/rust-toolchain.toml")
installed=$(rustup +"$RUST_VERSION" target list --installed 2>/dev/null)
if grep -q wasm32-unknown-unknown <<<"$installed" && grep -q wasm32-wasip2 <<<"$installed"; then
echo "Rust $RUST_VERSION already installed"
else
rustup toolchain install "$RUST_VERSION" --profile minimal \
--component rustfmt --component clippy \
--target wasm32-unknown-unknown --target wasm32-wasip2 ||
warn "rustup install failed"
fi

# Rust crates download in the background while the JS side installs.
(cd "$REPO" && cargo fetch --locked >/dev/null 2>&1 || warn "cargo fetch failed") &
cargo_fetch=$!

# --- wasm-pack + wasm-opt ---------------------------------------------------
# wasm-pack's own binaryen download fails behind the session proxy, so put
# wasm-opt on PATH; wasm-pack uses it from there.
step "wasm-pack"
WASM_PACK=$(sed -n 's/^version=//p' "$REPO/.dagger/scripts/install-wasm-pack.sh")
if wasm-pack --version 2>/dev/null | grep -qF "$WASM_PACK"; then
echo "wasm-pack $WASM_PACK already installed"
else
sh "$REPO/.dagger/scripts/install-wasm-pack.sh" "$BIN" || warn "wasm-pack install failed"
fi

step "binaryen (wasm-opt)"
if wasm-opt --version 2>/dev/null | grep -q "($BINARYEN)"; then
echo "wasm-opt $BINARYEN already installed"
else
tmp=$(mktemp -d)
if curl -fsSL --retry 3 \
"https://github.com/WebAssembly/binaryen/releases/download/${BINARYEN}/binaryen-${BINARYEN}-x86_64-linux.tar.gz" |
tar -xz -C "$tmp"; then
rm -rf /opt/binaryen && mv "$tmp/binaryen-${BINARYEN}" /opt/binaryen
ln -sf /opt/binaryen/bin/wasm-opt "$BIN/wasm-opt"
wasm-opt --version
else
warn "binaryen download failed"
fi
rm -rf "$tmp"
fi

# --- JS dependencies --------------------------------------------------------
# Fills the pnpm store (~/.local/share/pnpm), which the environment cache
# keeps; in a fresh clone the install is then mostly hard links.
step "pnpm install"
(cd "$REPO/browser" && pnpm install --frozen-lockfile) || warn "pnpm install failed"

# --- Playwright browsers ----------------------------------------------------
# The image's preinstalled Chromium usually lags @tomic/e2e's Playwright, and
# the session proxy blocks Playwright's CDN (cdn.playwright.dev). Chrome for
# Testing builds are the same zips, mirrored on storage.googleapis.com, so
# unpack those into the directories Playwright expects.
step "Playwright browsers for @tomic/e2e"
cd "$REPO/browser/e2e" &&
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD= pnpm exec playwright install --dry-run chromium chromium-headless-shell 2>/dev/null |
awk '/Install location:/{loc=$3} /Download url:/{if (loc) print loc, $3; loc=""}' |
while read -r loc url; do
case "$url" in */builds/cft/*) ;; *) continue ;; esac
if [ -f "$loc/INSTALLATION_COMPLETE" ]; then
echo "$loc already installed"
continue
fi
mirror="https://storage.googleapis.com/chrome-for-testing-public/${url#*/builds/cft/}"
echo "Downloading $mirror"
tmp=$(mktemp -d)
if curl -fsSL --retry 3 "$mirror" -o "$tmp/browser.zip" && unzip -q "$tmp/browser.zip" -d "$tmp/x"; then
rm -rf "$loc" && mkdir -p "$loc" && mv "$tmp"/x/* "$loc"/ &&
touch "$loc/INSTALLATION_COMPLETE" "$loc/DEPENDENCIES_VALIDATED"
else
warn "Playwright browser download failed: $mirror"
fi
rm -rf "$tmp"
done

step "cargo fetch"
wait "$cargo_fetch"

step "Tools ready"
exit 0
62 changes: 62 additions & 0 deletions .claude/hooks/session-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
# SessionStart hook for Claude Code on the web (cloud sessions).
#
# 1. Exports session environment variables.
# 2. Runs cloud-setup.sh: toolchains, pnpm install, Playwright browsers. Close
# to a no-op when the environment's setup script already ran it (see
# AGENTS.md); otherwise it installs them here, which takes a few minutes.
# 3. Starts cloud-build.sh in the background (the @tomic packages, then a
# debug atomic-server) and tells the agent how to wait for it.
#
# Keep these scripts in sync with the repo's requirements — see AGENTS.md.
set -uo pipefail

if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
exit 0
fi

REPO="${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "$0")/../.." && pwd)}"
HOOKS="$REPO/.claude/hooks"
STATE="${ATOMIC_SETUP_STATE:-/tmp/atomic-setup}"
mkdir -p "$STATE"

# stdout is reserved for the JSON below; everything else goes to the log.
exec 3>&1 >>"$STATE/setup.log" 2>&1
echo "==> session-start $(date -u +%FT%TZ)"

# --- Session environment ----------------------------------------------------
# atomic-server binds to `::` by default, and cloud containers have no IPv6
# ("Address family not supported by protocol"). ATOMIC_IP makes `cargo run`,
# browser/lib's integration fixture and the e2e server bind IPv4 instead.
if [ ! -e /proc/net/if_inet6 ] && [ -n "${CLAUDE_ENV_FILE:-}" ]; then
echo 'export ATOMIC_IP="${ATOMIC_IP:-0.0.0.0}"' >>"$CLAUDE_ENV_FILE"
fi

# --- Tools ------------------------------------------------------------------
start=$(date +%s)
REPO="$REPO" bash "$HOOKS/cloud-setup.sh"
echo "cloud-setup.sh took $(($(date +%s) - start))s"

# --- Background build -------------------------------------------------------
if [ -f "$STATE/server.done" ]; then
context="Cloud setup: toolchains, browser/node_modules, the @tomic packages \
($(cat "$STATE/packages.done" 2>/dev/null)) and a debug atomic-server \
($(cat "$STATE/server.done")) are already built on this VM. Log: $STATE/build.log."
else
REPO="$REPO" ATOMIC_SETUP_STATE="$STATE" setsid nohup bash "$HOOKS/cloud-build.sh" \
</dev/null >>"$STATE/build.log" 2>&1 &
context="Cloud setup: toolchains, wasm-pack, Playwright browsers and \
browser/node_modules are ready. A background job (.claude/hooks/cloud-build.sh) \
is still building the @tomic packages and then a debug atomic-server, which \
also builds data-browser and the WASM; from cold that takes 10-20 minutes. \
Log: $STATE/build.log. When each step ends it writes $STATE/packages.done or \
$STATE/server.done, containing ok or failed. Reading and editing code is fine \
right away. Before JS typecheck or tests, wait for packages.done; before cargo \
builds or tests, running the server, or e2e, wait for server.done, e.g. run \
\`until [ -e $STATE/server.done ]; do sleep 10; done; cat $STATE/server.done\` \
in the background. A cargo command started earlier just waits for the build \
lock. Don't start a second pnpm install or build of the same packages meanwhile."
fi

jq -n --arg ctx "$context" \
'{hookSpecificOutput: {hookEventName: "SessionStart", additionalContext: $ctx}}' >&3
15 changes: 15 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh",
"timeout": 1200
}
]
}
]
}
}
10 changes: 7 additions & 3 deletions .dagger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ export class AtomicServer {
/** Reuse closed worker profiles for eligible drive-scoped specs. */
@argument() playwrightCloneSessions: boolean = false,
/**
* Where failed e2e shards leave their traces, for `e2eTestResults` to
* Where failed e2e shards leave their traces, for `failedTestResults` to
* hand back. The workflow passes `<run id>-<attempt>`; empty keeps none.
*/
@argument() resultsKey: string = '',
Expand Down Expand Up @@ -2291,7 +2291,7 @@ export class AtomicServer {

/**
* Keeps failed shards' `test-results` (traces, screenshots,
* `error-context.md`) in a cache volume under `key`, for `e2eTestResults`.
* `error-context.md`) in a cache volume under `key`, for `failedTestResults`.
*
* They used to leave only through the netlify report, and with
* `NETLIFY_TOKEN` unset they were discarded with the container. A failure
Expand Down Expand Up @@ -2335,12 +2335,16 @@ export class AtomicServer {
}

/**
* Named without a digit on purpose: Dagger's CLI kebab-cases `e2eTestResults`
* to something other than `e2e-test-results` (as with `--e2e-mode`), and
* the workflow's call failed with "unknown command" (run 36895753311).
*
* The traces `ci`/`endToEnd` kept for failed shards under `resultsKey`,
* one folder per shard. Empty when nothing failed. main-ci.yml exports
* this on failure and uploads it as an artifact.
*/
@func()
async e2eTestResults(@argument() resultsKey: string): Promise<Directory> {
async failedTestResults(@argument() resultsKey: string): Promise<Directory> {
const safeKey = resultsKey.replace(/[^A-Za-z0-9._-]/g, '_');

return dag
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
engine-stop: "false"
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }}
verb: call
args: e2e-test-results --results-key ${{ github.run_id }}-${{ github.run_attempt }} export --path e2e-test-results
args: failed-test-results --results-key ${{ github.run_id }}-${{ github.run_attempt }} export --path e2e-test-results
- name: Upload e2e traces of failed tests
if: failure()
uses: actions/upload-artifact@v4
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ server/integrations_assets_tmp
server/js-build.log
.netlify
scratchpad
.claude
# Local Claude Code state stays out; the shared cloud-session hook is tracked.
**/.claude/*
!/.claude/settings.json
!/.claude/hooks/
.antigravitycli

# Release binaries and one-off rustc scratch files at repo root
Expand Down
45 changes: 45 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,51 @@ The pre-commit hook lints and clippies a snapshot of the staged files. It
borrows this worktree's `node_modules` (so `pnpm install` must have run) and
skips the frontend build, so it needs nothing else.

## Claude Code Cloud Sessions

Claude Code on the web sessions are set up by three scripts in `.claude/hooks/`.
They only run when `CLAUDE_CODE_REMOTE=true`, so local sessions are unaffected.

- `session-start.sh`, the SessionStart hook registered in
`.claude/settings.json`. It exports `ATOMIC_IP=0.0.0.0`: cloud containers have
no IPv6, and the server otherwise fails with "Address family not supported by
protocol". Then it runs `cloud-setup.sh`, starts `cloud-build.sh` in the
background, and tells the agent how to wait for that build.
- `cloud-setup.sh` installs the Rust toolchain and WASM targets, wasm-pack,
wasm-opt, `browser/node_modules` and the Playwright browsers for
`@tomic/e2e`, and fetches the crates. Each step skips what is already there.
- `cloud-build.sh` builds the `@tomic/*` packages, then a debug
`atomic-server` (which also builds data-browser and the WASM). It writes
`/tmp/atomic-setup/packages.done` and `server.done` (`ok` or `failed`) when
each step ends; the log is `/tmp/atomic-setup/build.log`.

Only a cloud environment's setup script is cached between sessions (a
filesystem snapshot, taken only when the script finishes in about five
minutes). Hooks run every session, and every session starts from a fresh clone.
So set the environment's setup script (environment settings, **Setup script**)
to:

```
bash /home/user/atomic-server/.claude/hooks/cloud-setup.sh || true
```

Then toolchains, the pnpm store, crates and browsers come from the cache, and
the hook blocks for about a minute (mostly linking `node_modules`). Without it
the hook installs them itself, taking a few minutes more. The server build
can't be cached either way, which is why it runs in the background.

These scripts pin versions and work around the cloud sandbox (for example, the
proxy blocks Playwright's CDN, so browsers come from the Chrome for Testing
mirror). When environment requirements change — `rust-toolchain.toml`, a new
Rust target, the wasm-pack or binaryen version, the Playwright version, a new
workspace package or build step — update them in the same PR, and test with
`CLAUDE_CODE_REMOTE=true .claude/hooks/session-start.sh`.

`pnpm test-e2e:local` builds the `e2e` cargo profile by default, a second cold
server build. In a cloud session, `ATOMIC_E2E_CARGO_PROFILE=dev pnpm
test-e2e:local <spec>` reuses the debug build instead (a green is still
trustworthy; see `browser/e2e/scripts/e2e-server.sh` on reading reds).

## Planning

Use the `./planning` folder to write plans and keep track of progress.
Expand Down
4 changes: 3 additions & 1 deletion TESTING_COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,9 @@ failure checks also pass. Actual staging phone restore latency remains unmeasure

## Right-panel lifecycle

`components/RightPanel/panelState.test.ts` covers session-local initial state, exclusive panels, cleared meeting selection, account/drive scoping, stale callbacks, and missing/unauthorized versus temporarily unavailable targets.
`components/RightPanel/panelState.test.ts` covers session-local initial state, exclusive panels, cleared meeting selection, account/drive scoping, stale callbacks, and missing/unauthorized versus temporarily unavailable targets. It also covers the comments panel's target: aiming it at another resource switches threads instead of toggling, the NavBar button (no target) returns to the page's own thread rather than closing a row's, the target is dropped when another panel takes over, and `closePanelState` closes the panel whatever it is aimed at — which a targetless toggle cannot express.

`e2e/tests/table-row-comments.spec.ts` covers commenting on a table row from the gutter bubble: the panel opens headed by the row's title, the count is live and belongs to that row alone, another row's bubble switches threads, the same row's closes the panel, the comment survives a reload, and the trailing entry row (no resource yet) offers no bubble. What is NOT covered: reaching the bubble by keyboard — it shares the row-gutter's mouse-only reachability with the existing expand button, since the grid owns Tab for cell navigation.

`e2e/tests/right-panel-lifecycle.spec.ts` asserts visible panel state with legacy localStorage values for meeting/comments/AI, SPA navigation away from commentable resources, deletion of an explicitly opened meeting, and switching drives and back without resurrecting the panel. Existing `meetings.spec.ts` agenda/start/end coverage verifies that minutes and explicitly opened meeting chat still work. AI chat E2E (`ai.spec.ts`, `table-tools.spec.ts`) opens the assistant with the navbar button rather than `atomic.rightPanel.active`, because that key is no longer restored.

Expand Down
Loading
Loading