-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: mount live preview to document root #12860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+815
−1,135
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading status checks…
Loading status checks…
Loading status checks…
This was referenced Jun 24, 2025
Loading status checks…
Loading status checks…
Loading status checks…
Loading status checks…
Loading status checks…
paulpopus
previously approved these changes
Jun 26, 2025
jacobsfletch
added a commit
that referenced
this pull request
Jun 26, 2025
Loading
Loading status checks…
Needed for #12860. The client config unnecessarily omits the `livePreview.collections` and `livePreview.globals` properties. This is because the root live preview config extends the type with these two additional properties without sharing it elsewhere. To led to the client sanitization function overlooking these additional properties, as there was no type indication that they exist. The `collections` and `globals` properties are now appended to the client config as expected, and the root live preview is standardized behind the `RootLivePreviewConfig` type to ensure no properties are lost. --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1210628466702823
jacobsfletch
added a commit
that referenced
this pull request
Jun 26, 2025
Loading
Loading status checks…
…#12925) Needed for #12860. If the admin panel broadcasts foreign postMessage events, i.e. those without the `payload-live-preview` signature, client-side live preview subscriptions will reset back to initial state. This is because we dispatch two postMessage events in the admin panel, one for client-side live preview to catch (`payload-live-preview`), and the other for server-side live preview (`payload-document-event`). This was not previously noticeable because both events would only get called simultaneously on initial render, where initial state is already the expected result. Now that Live Preview can be freely toggled on and off, both events are frequently dispatched and very obviously disregard the current working state. --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1210628466702818
Loading status checks…
DanRibbens
requested changes
Jun 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the live-preview e2e failure might not be a flake.
jacobsfletch
added a commit
that referenced
this pull request
Jun 27, 2025
Loading
Loading status checks…
Needed for #12860. The new live preview pattern requires collection-level preferences, a pattern that does not yet exist. Instead of creating a new record for these types of preferences, we can simply reuse `<collectionSlug>-list` under a more general key: `collection-<slug>`. This way other relevant properties can be attached in the future that might not specifically apply to the list view. This will also match the conventions already estalished by document-level preferences in `collection-<slug>-<id>` and `global-<slug>`. --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1210628212784050
Loading status checks…
Loading status checks…
Love this change |
Loading status checks…
DanRibbens
approved these changes
Jun 27, 2025
🚀 This is included in version v3.45.0 |
jacobsfletch
added a commit
that referenced
this pull request
Jul 3, 2025
Loading
Loading status checks…
This feature seems to have changed how the live preview url is generated causing issues. See #13149 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mounts live preview to
../:id
instead../:id/preview
.This is a huge win for both UX and a maintainability standpoint.
Here are just a few of those wins:
LeaveWithoutSaving
modal and are forced to either save your edits or clear them. This is because you are being navigated to an entirely new page with it's own form context. Instead, you should be able to freely navigate back and forth between the two.This change does also include some small modifications to UI. The "Live Preview" tab no longer exists, and instead has been replaced with a button placed next to the document controls (subject to change).
Before:
Screen.Recording.2025-06-25.at.5.13.13.PM.mp4
After:
Screen.Recording.2025-06-25.at.4.55.49.PM.mov