Skip to content

[pull] main from tldraw:main#257

Merged
pull[bot] merged 4 commits intocode:mainfrom
tldraw:main
Nov 7, 2025
Merged

[pull] main from tldraw:main#257
pull[bot] merged 4 commits intocode:mainfrom
tldraw:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Nov 7, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

ds300 and others added 4 commits November 7, 2025 10:19
We hit subrequest limits on this so let's do it in smaller batches that
the client initiates

### Change type

- [x] `other`

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Switch user migration to server-limited batches (50/users per run) and
auto-chain batches on the client via SSE, with stop support and hasMore
signaling.
> 
> - **Admin UI (`apps/dotcom/client/src/pages/admin.tsx`)**:
> - Batch migration now runs in incremental batches: wraps SSE flow in
`startBatch()` Promise and auto-starts next batch when `data.hasMore` is
true.
> - Adds `shouldContinueRef` to allow stopping between batches; updates
stop logic and error handling.
> - Maintains capped progress log and updates stats from SSE `details`.
> - **Sync Worker (`apps/dotcom/sync-worker/src/adminRoutes.ts`)**:
> - `GET /app/admin/migrate_users_batch`: includes `hasMore` in
completion events.
> - `startUserMigration(...)`: processes up to `batchSize = 50` users
per invocation, returns `boolean` indicating remaining work; adds
`processedCount` loop and final remaining-users check.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
264c093. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
I realised I wasn't really comfortable leaving this running on its own
in case something did go wrong and I'd have to do more manual durable
object restarts.

this makes it stop as soon as any error happens and it saves the error
message in indexeddb so even if the page refreshes I should be able to
find the email associated with the error and do a manual restart or
investigate what went wrong if something else went wrong.

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Stops batch user migration on first failure and saves SSE failure
events to IndexedDB for later inspection.
> 
> - **Backend**:
> - `startUserMigration` in `apps/dotcom/sync-worker/src/adminRoutes.ts`
now emits a `failure` event with details, then a `summary` event, and
returns `false` to stop processing immediately on error.
> - **Frontend**:
> - `apps/dotcom/client/src/pages/admin.tsx` `BatchMigrateUsersToGroups`
makes `EventSource.onmessage` async and, on `failure` steps, calls
`saveMigrationLog` to persist entries.
> - Adds `apps/dotcom/client/src/pages/migrationLogsDB.ts` implementing
an IndexedDB (`idb`) store to save migration error logs.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
df8939e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Resolves #5697

> Inline editing of frame labels isn't a very good experience on mobile.
Instead, when you tap a frame label, we should open a window.prompt
instead.

> On mobile devices, attempting to edit a frame label opens a
window.prompt populated with the current name. Ok/cancel do what you
would expect.
> On desktop devices, the frame label can be edited inline as it is now

Detection of mobile devices via PORTRAIT_BREAKPOINT.MOBILE

### Change type

- [ ] `bugfix`
- [x] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`

### Test plan

1. Double click frame on mobil device (or via mobile developer tools)
2. Rename frame via opened window.prompt

### Release notes

- Use window.prompt to change frame label on mobile

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Use window.prompt to rename frames/pages on small coarse-pointer
devices and add Vitest mocks for breakpoints/translations.
> 
> - **UI**
>   - **Frame rename (`FrameLabelInput.tsx`)**:
> - Switch to `window.prompt(msg('action.rename'))` for renaming when
`breakpoint < PORTRAIT_BREAKPOINT.TABLET_SM` and `isCoarsePointer`.
> - Disable inline input and autofocus in that mode; refactor rename
logic into `renameFrame`.
>   - **Page menu (`DefaultPageMenu.tsx`)**:
> - Use the same `shouldUseWindowPrompt` condition to rename pages via
`window.prompt(msg('action.rename'))` in editing and submenu flows.
> - Replace hardcoded strings; remove platform check in favor of
breakpoint/coarse-pointer logic.
> - **Tests**
> - **Vitest setup (`setupVitest.js`)**: mock `useBreakpoint` and
translation hooks to provide defaults during tests.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
06c1f1d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: swdev33 <18295918+swdev33@users.noreply.github.com>
Co-authored-by: Mime Čuvalo <mimecuvalo@gmail.com>
…7086)

hmm

### Change type

- [x] `other`

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Wrap per-user migration in a retry to reduce flakes in the admin batch
user migration flow.
> 
> - **Admin migration batch
(`apps/dotcom/sync-worker/src/adminRoutes.ts`)**:
>   - Wrap per-user migration logic in `retry(...)`:
> - Executes `migrate_user_to_groups(...)` and
`admin_forceHardReboot(...)` within the retry block.
>     - Maintains progress reporting and success/failure handling.
>   - Import `retry` from `@tldraw/utils`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b826be2. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@pull pull Bot locked and limited conversation to collaborators Nov 7, 2025
@pull pull Bot added the ⤵️ pull label Nov 7, 2025
@pull pull Bot had a problem deploying to deploy-staging November 7, 2025 15:13 Failure
@pull pull Bot merged commit 0646aa8 into code:main Nov 7, 2025
1 of 8 checks passed
@pull pull Bot had a problem deploying to deploy-production November 7, 2025 15:13 Failure
@pull pull Bot had a problem deploying to deploy-staging November 7, 2025 15:13 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants