Skip to content

fix(dotcom): preserve user preferences when using deep links#7917

Merged
mimecuvalo merged 4 commits intomainfrom
mime/grid-disappearing
Feb 17, 2026
Merged

fix(dotcom): preserve user preferences when using deep links#7917
mimecuvalo merged 4 commits intomainfrom
mime/grid-disappearing

Conversation

@mimecuvalo
Copy link
Copy Markdown
Member

@mimecuvalo mimecuvalo commented Feb 13, 2026

When a URL contains a deep link parameter (?d=...), the session state (including grid mode, tool lock, etc.) was being skipped entirely. This caused user preferences to be lost on page refresh when a deep link was present.

The previous logic was:

if (fileState?.lastSessionState && !deepLink) {
    // Load session state - but ONLY if no deep link!
}

Now we load session preferences separately from camera/page states, allowing deep links to control navigation while preserving user settings like grid mode.

Closes #4391

Change type

  • bugfix

Test plan

  1. Open a file on tldraw.com
  2. Toggle grid mode ON (Cmd+' or menu)
  3. Wait 10 seconds for auto-save, or refresh to trigger save
  4. Refresh the page (note: URL will have ?d= parameter)
  5. Grid should now be preserved

Release notes

  • Fixed a bug where grid mode and other user preferences were lost on page refresh when a deep link was present in the URL.

Note

Low Risk
Small, localized change to client-side session restore behavior; main risk is subtle regressions in which parts of session state are restored when deep links are present.

Overview
Fixes editor initialization so saved lastSessionState is no longer skipped when a ?d= deep link is present.

When deep linking, it now loads only preference-related session fields (excluding pageStates and currentPageId) before calling navigateToDeepLink, preserving settings like grid/tool preferences without overriding deep-link navigation.

Written by Cursor Bugbot for commit 582aa7f. This will update automatically on new commits. Configure here.

When a URL contains a deep link parameter (?d=...), the session state
(including grid mode, tool lock, etc.) was being skipped entirely.
This caused user preferences to be lost on page refresh when a deep
link was present.

Now we load session preferences separately from camera/page states,
allowing deep links to control navigation while preserving user settings.
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples Ready Ready Preview Feb 16, 2026 11:24am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
analytics Ignored Ignored Preview Feb 16, 2026 11:24am
tldraw-docs Ignored Ignored Preview Feb 16, 2026 11:24am
chat-template Skipped Skipped Feb 16, 2026 11:24am
tldraw-shader Skipped Skipped Feb 16, 2026 11:24am
workflow-template Skipped Skipped Feb 16, 2026 11:24am

Request Review

@huppy-bot huppy-bot bot added the bugfix Bug fix label Feb 13, 2026
@mimecuvalo mimecuvalo requested a review from ds300 February 13, 2026 15:49
Comment thread apps/dotcom/client/src/tla/components/TlaEditor/TlaEditor.tsx Outdated
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread apps/dotcom/client/src/tla/components/TlaEditor/TlaEditor.tsx Outdated
Copy link
Copy Markdown
Collaborator

@ds300 ds300 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@mimecuvalo mimecuvalo added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit 7ce6164 Feb 17, 2026
17 checks passed
@mimecuvalo mimecuvalo deleted the mime/grid-disappearing branch February 17, 2026 12:28
github-merge-queue bot pushed a commit that referenced this pull request Feb 24, 2026
…8068)

followup to #7917
it was fixed and then i accidentally commited a "cleanup" commit that
undid the work 🤦

closes
#4391 (comment)

### Change type

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Small change to editor mount logic affecting deep-link/session-state
restoration; low risk but could impact initial navigation/camera state
on load.
> 
> **Overview**
> Fixes deep-link initialization so opening a URL with `?d=` preserves
user *preferences* while letting the deep link control navigation.
> 
> `TlaEditor` now (1) loads only preference fields from
`lastSessionState` when a deep link is present and navigates
immediately, (2) otherwise loads the full session snapshot, and (3)
still navigates to the deep link even when no saved session state
exists.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1e0ef18. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grid disappears on page refresh

3 participants