Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
test: stabilize WordplayTrainer async waits (#3059)
[._.]/ Adam Eivy9a3570b6a6ef
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex e924493e28..a71dd79b84 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -140,6 +140,7 @@## Fixed+- **[issue-3059] Wordplay training checks now stay reliable during busy CI runs** — the test suite gives a newly selected word game time to finish its normal loading path, preventing intermittent build failures without weakening coverage.- **"Choose a file" buttons now open the file picker from a remote browser** — the Screenshot and Attach buttons on the task form, Browse Files on the Uploads page, and ~20 other upload buttons across PortOS did nothing when you clicked them from another machine over the tailnet. Each one was a plain button whose click handler reached over and *programmatically* clicked a hidden `<input type="file">` — a synthetic click that several browsers refuse to honor, most notably Safari/WebKit when PortOS is running as an installed (standalone) app rather than a normal tab, which is exactly how it tends to get opened on a second machine or a tablet. Every one of those triggers is now a real `<label>` bound to its file input, so the browser opens the picker itself with no scripting involved. Three related annoyances went with it: every file picker in the app is now reachable by keyboard and screen reader (they were hidden from both, including six that already opened fine); re-picking the *same* file after a failed upload now works everywhere; and the Attach picker no longer greys out every file on iOS/iPadOS, where an extension-only filter isn't understood.- **Uploads now state the real size limit instead of failing past ~41MB** — the Uploads page advertised a 100MB maximum and task attachments 50MB, but files are sent base64-encoded inside a JSON body, and the server's 55MB body cap means anything past roughly 41MB was rejected by the body parser before the size check ever ran — so a 60MB file produced an opaque failure rather than a limit message. Every base64-in-JSON upload path (general uploads, task attachments, SongBook attachments) now derives its cap from the body limit itself, so the advertised number is always one the server can actually accept. Screenshots keep their own deliberately smaller 10MB cap, now shared between client and server instead of being written twice.- **Installing or removing an Ollama model now refreshes provider model pickers instantly** — the Ollama provider (and any Claude/Codex/Gemini CLI running against a local Ollama daemon) picks up the change immediately instead of waiting for a manual "Refresh Models" click on the AI Providers page. The scheduled-task model picker also stays in sync automatically, no app restart required.diff --git a/client/src/components/meatspace/post/WordplayTrainer.test.jsx b/client/src/components/meatspace/post/WordplayTrainer.test.jsxindex 405c8019be..f05872fe15 100644--- a/client/src/components/meatspace/post/WordplayTrainer.test.jsx+++ b/client/src/components/meatspace/post/WordplayTrainer.test.jsx@@ -20,6 +20,11 @@ import {generatePostDrill, scorePostLlmDrill, getPostDrillCacheStatus, submitTrainingEntry,} from '../../../services/api';+// Mode activation crosses cache-status and drill-generation promises before a+// clue renders. Give that real async chain enough time when the full client+// suite is competing for CI's event loop.+const GENERATED_DRILL_TIMEOUT = 5_000;+// The selected mode now lives in the URL (`/post/wordplay/:mode`) — PostTab// owns that param and passes it down. This harness stands in for that routing:// clicking a mode button calls onSelectMode, which sets the `mode` prop, and the@@ -63,7 +68,7 @@ describe('WordplayTrainer — training-log persistence (issue #2097)', () => {fireEvent.click(await screen.findByText('Compound Chain'));// Drill generated — a single-challenge round keeps this test to one round.- await waitFor(() => expect(screen.getByText('fire')).toBeInTheDocument());+ await waitFor(() => expect(screen.getByText('fire')).toBeInTheDocument(), { timeout: GENERATED_DRILL_TIMEOUT });const input = screen.getByPlaceholderText(/other half/i);fireEvent.change(input, { target: { value: 'firehouse' } });@@ -118,7 +123,7 @@ describe('WordplayTrainer — training-log persistence (issue #2097)', () => {await screen.findByText('Bridge Word'); // back on the mode gridfireEvent.click(screen.getByText('Bridge Word')); // enter mode B- await waitFor(() => expect(screen.getByText('news___')).toBeInTheDocument()); // B generated, not wedged+ await waitFor(() => expect(screen.getByText('news___')).toBeInTheDocument(), { timeout: GENERATED_DRILL_TIMEOUT }); // B generated, not wedged});it('ignores a superseded generation when the same mode is re-entered mid-generation (issue #2098)', async () => {@@ -137,7 +142,7 @@ describe('WordplayTrainer — training-log persistence (issue #2097)', () => {fireEvent.click(screen.getAllByRole('button')[0]); // back to grid (invalidates run #1)await screen.findByText('Compound Chain');fireEvent.click(screen.getByText('Compound Chain')); // re-enter A → run #2 resolves- await waitFor(() => expect(screen.getByText('water')).toBeInTheDocument());+ await waitFor(() => expect(screen.getByText('water')).toBeInTheDocument(), { timeout: GENERATED_DRILL_TIMEOUT });// The stale run #1 finally resolves — its token is superseded, so it must NOT// swap the drill out from under the live run #2.@@ -164,7 +169,7 @@ describe('WordplayTrainer — training-log persistence (issue #2097)', () => {fireEvent.click(await screen.findByText('Bridge Word'));- await waitFor(() => expect(screen.getByText('news___')).toBeInTheDocument());+ await waitFor(() => expect(screen.getByText('news___')).toBeInTheDocument(), { timeout: GENERATED_DRILL_TIMEOUT });// Answer the FIRST of two puzzles.fireEvent.change(screen.getByPlaceholderText(/bridge word is/i), { target: { value: 'wrongword' } });@@ -208,7 +213,7 @@ describe('WordplayTrainer — training-log persistence (issue #2097)', () => {render(<TrainerHarness onBack={() => {}} config={{}} onConfigUpdate={() => {}} />);fireEvent.click(await screen.findByText('Bridge Word'));- await waitFor(() => expect(screen.getByText('news___')).toBeInTheDocument());+ await waitFor(() => expect(screen.getByText('news___')).toBeInTheDocument(), { timeout: GENERATED_DRILL_TIMEOUT });const input = screen.getByPlaceholderText(/bridge word is/i);fireEvent.change(input, { target: { value: 'wrongword' } });