Skip to content
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

[pull] main from tldraw:main #1

Open
wants to merge 2,313 commits into
base: main
Choose a base branch
from
Open

[pull] main from tldraw:main #1

wants to merge 2,313 commits into from

Conversation

pull[bot]
Copy link

@pull pull bot commented Jul 3, 2022

See Commits and Changes for more details.


Created by pull[bot]

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

@netlify
Copy link

netlify bot commented Jul 3, 2022

Deploy Preview for rafids-tldraw failed.

Name Link
🔨 Latest commit c422deb
🔍 Latest deploy log https://app.netlify.com/sites/rafids-tldraw/deploys/678006852b1ccf0008d63f65

@pull pull bot added the ⤵️ pull label Jul 4, 2022
ds300 and others added 28 commits October 23, 2024 16:44
making it so that

- you can't rename other people's files
- you can't delete other people's files
- shared files appear immediately in your nav menu
- you can't change the share settings of other people's files

### Change type


- [x] `other`
Clicking the name to rename was broken

### Change type

- [x] `other`
blp

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
We talked today about an alternative to the multi-menu options, an
alternative to this PR #4699 .
Instead of the hamburger menu being a QuickActions area, that we could
combine it with the vertical dot menu at the top, like so:

<img width="546" alt="Screenshot 2024-10-23 at 17 40 10"
src="https://github.com/user-attachments/assets/045e5af8-0b75-4346-b6b8-43d9bfb2582e">

This might be a good compromise of the two worlds.

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
Just reverting this copy change. 'Forbidden' is too archaic and too
strong a word to be user-facing here. It's like an old bible word. cc
@mimecuvalo

### Change type

- [x] `other`
### Change type

- [x] `other`
adds the user name to the people menu

### Change type

- [x] `other`
This PR sets up deep links for the file route, and makes the
share/publish urls contain the deep links too.

### Change type

- [x] `other`
oversight, should have added this when I added the script

### Change type


- [x] `other`
This PR

- Replaces the file-edit and file-view records with a single record
called `file-state` that has timestamps for first view and most recent
edit.
- Uses the above to simplify the recent files sorting (maintains the
same behaviour, just achieves it with simpler code)
- removes unused presence stuff (should have been removed back in that
burn-it-all-down pr after we merged the prototype), we can add the UI
bits back when we work on file-level presence.
- Stores the UI state in the db so you go back to where you were before
in the file next time you open the file

implements INT-342

### Change type

- [x] `other`
For some reason I very conservatively set this value to two weeks.
People keep browser tabs open for way longer than that.


### Change type

- [x] `other`
Trim

### Change type

- [x] `other`
vercel has a 15,000 file limit that we were exceeding by 300 or so

maybe it's time to ship assets to s3

### Change type

- [x] `other`
we had bad 3.4 and 3.5 deploys, so lets clean those up.

### Change type

- [x] `other`
<img width="745" alt="image"
src="https://github.com/user-attachments/assets/74dd720b-beed-40a8-91ae-67cb974fc028">


This PR:
- adds help links to the share menu for sharing / publishing
- stubs pages on notion for help content
- removes the QR code from the publish tab
- adds `lastPublished`
- strips published data from file when publicating
- removes copied toasts from menu
- adds nice animation for updating published
- adds one second of fake delay to update published

![Kapture 2024-10-24 at 15 02
27](https://github.com/user-attachments/assets/ae9b114f-b9c7-48d8-a481-a769eb6ba5b5)


### Change type

- [x] `other`
This PR adds a (non-lazy) no index wrapping component to the botcom
pages, too.

### Change type

- [x] `improvement`
this is such a weird default by Clerk

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
There was a race condition preventing file deletions from working
properly most of the time. I also spotted an issue where the clock value
was not being set properly on the sync room for the app DO 🤦🏼

### Change type

- [x] `other`
followup to the convo here: #4775
i'll leave this open so we can discuss our opinions!

### Change type

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

---------

Co-authored-by: David Sheldrick <[email protected]>
This PR fixes the top bar on mobile.

Before:
<img width="354" alt="image"
src="https://github.com/user-attachments/assets/2e1756a2-3364-4fd8-b740-1029b206753b">

After:
<img width="328" alt="image"
src="https://github.com/user-attachments/assets/402a1d37-831a-4222-9f78-4a7875ace579">

### Change type

- [x] `other`
Adds e2e scaffolding (playwright):
- Tests depend on `auth-setup` so the tests run as a signed in user by
default. There's an example spec of showing how to test not logged in
functionality.
- These were a bit tricky to setup up, especially the sidebar toggle.
Let's see if they'll be flaky 🤞
- I created a separate `e2e-dotcom` environment, so that we can use
development version of clerk api keys (other existing environments use
the live ones). Clerk has some special dev mode features which allow for
easier signing in during testing.
- Also had some issues with `examples` `e2e` tests failing (bookmark
exports on dark were failing). Seems like it was caused if I used
playwright version 1.48, so I went back to 1.46. We might face this
issue in the future.

### Change type

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

### Release notes

- e2e scaffolding for botcom.
This PR fixes a bug where frame headings would not capture the pointer.

![Kapture 2024-10-26 at 11 21
53](https://github.com/user-attachments/assets/bb656d09-8c47-47e5-a793-34c71a67c8f3)

### Change type

- [x] `bugfix`

### Test plan

1. Drag a frame by its heading
2. Move your cursor outside of the window
3. The frame should move with your cursor, even when the cursor is
outside of the window

### Release notes

- Fixed a bug with dragging frames by their heading.
This PR allows double clicking the sidebar item to edit its name inline.
It fixes a bug with the Escape key to cancel the edit.

### Change type

- [x] `improvement`
This PR fixes some spacing in toasts.

### Change type

- [x] `bugfix`

### Release notes

- Fixed a bug with toast layout.
This PR:
- makes the default user preference light, rather than system
- updates the theme when the media theme changes only if the user has
selected system

## Rationale

Our light theme is better and presents a better initial experience of
the app.
Our logged out pages only support light mode and we don't want to show a
dark editor on a light page.
Our docs landing page has light mode as its default and we don't want to
show a dark editor on a light page.

### Change type

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

### Release notes

- Sets the default color theme to light.
steveruizok and others added 30 commits December 13, 2024 08:10
Add ClickUp to logos.

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
fixes #5047

the problem was we weren't destroying the shape effect schedulers when
the editor changed, because they were only keyed by the shape type name,
which obviously does not change when the editor is reinstantiated.

this augments useStateTracking to accept a deps array, and uses the
identity of the shape util as part of the deps array.

### Change type

- [x] `bugfix`
This PR adds a pinned files feature.

<img width="747" alt="Screenshot 2024-12-14 at 14 52 32"
src="https://github.com/user-attachments/assets/82924750-757d-441a-9062-97b920fa798b"
/>

- A file_state tracks whether a user has pinned a file
- A user may pin or unpin a file from the file menu
- A user's pinned files are displayed in a section at the top of their
recent files
- The order of pinned files is determined by most recently-edited

### Change type

- [x] `other`

### Test plan

- [x] End to end tests
fixes
#5047 (comment)

the problem was that during hot reload react was rerendering the
container elem but the editor wasn't recreated at the same, so the
sneaky div that the text measurement manager adds was being disconnected
from the DOM.

### Change type

- [x] `bugfix`
fixes part of
#5047 (comment)

Not sure why the baseElem needed to be appended to the container? This
avoids that and everything seems to work ok.


### Change type

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

### Release notes

- Prevents divs created for text measurement from leaking during hot
reloading.
Allow supplying a custom presence derivation to `useSync` and
`useSyncDemo`.

### Change type
- [x] `api`

### Release notes

- It's now possible to customise what presence data is synced between
clients, or disable presence syncing entirely.
This PR fixes two consistency issues we ran into while stress testing

1. Send the messages to the user DOs in guaranteed order, using one
ExecutionQueue per user.
2. Update the mutation number in a transaction, to make sure the mutated
data is synced before the mutation number gets back.

this involved doing a few extra bits

- set up migrations for sqlite in the replicator
- add a per-user sequence id and sequence number, so that user DOs can
reboot if there's any weird issues that prevent things from arriving in
order despite the execution queues.


### Change type

- [x] `other`
This makes sure we close connections when we run migrations and also
from the `TLDrawDurableObject`. It also gets the file record data
straight from pg instead of going through the replicator.

### Change type

- [ ] `bugfix`
- [x] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`
This PR adds (stubs) support for legacy routes in botcom. Those are:
- shared room
- shared room (readonly)
- shared room (readonly, old url)
- snapshot
- history
- history snapshot
- touchscreen sidebar (maybe)

I think it's better for us to treat these as "new routes" within botcom
so that we can develop out the ways that these routes should be handled.
Many routes need new UI and interactions, while the more rare internal
routes can be mostly left as they are.

We don't want to break shared rooms etc for people, however we do want
to have the prompts to sign in, etc, present on these rooms, similar to
what we display to signed out users for files. And for signed in users,
we should have a way to "claim" or "slurp" the file into your account's
files.

Some notes:

- titles appear in title bar for legacy routes
- legacy routes support copy tab in share menu


### Change type

- [x] `other`
### Change type

Docs

### Description

This type is named `CardShape` everywhere else in this code block.
Copy/pasting the current version of the code block into an editor would
result in a type error.

Worth noting that the ["Custom Shape and Tool"
example](https://tldraw.dev/examples/shapes/tools/custom-config) uses
`ICardShape`.
Hi, this PR fixes the broken link to Bluesky account. This is due to
that change of handle name: from `@tldraw.bsky.social` to `@tldraw.com`.

![screenshot of footer section including "Bluesky"
link](https://github.com/user-attachments/assets/7ee52079-af31-4541-b8e1-e9d0ca555472)

---

Also, I'd recommend adding Bluesky (or +Mastodon) icons on the website's
header as well to show support for an open platforms. I think X's
disrespectful actions toward developers and the open web is not aligned
with tldraw's open nature.

![screenshot of website header including only X, Discord, and
GitHub](https://github.com/user-attachments/assets/3ede735b-8804-4214-8194-1622063148a0)


### Change type

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

### Test plan
N/A

### Release notes

- Fixed a broken Bluesky link with an old handle name
Improve `getPostgres` helper.:
- We can now pass in a name, which allows us to see the who is holding
an open connection in `pg_stat_activity`. See `application_name` column
below.
![CleanShot 2024-12-16 at 15 47
58@2x](https://github.com/user-attachments/assets/a9f62e5c-4198-478d-9020-12a74841c48e)
- `idleTimeout` option with a default of 30.

### Change type

- [ ] `bugfix`
- [x] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`
Fixes #5130 

### Change type

- [x] `bugfix`

### Test plan

1. Create a shape...
2.

- [ ] Unit tests
- [ ] End to end tests

### Release notes

- Fixed a bug during development with React Strict Mode enabled where
store.listen might end up not calling the listener.
This PR adds snow to tldraw.com.

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
Remove snow when reduce motion is on

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
This removes the snowstorm effect from dotcom and adds it as an example.

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
Improve the `dotcom/client` project's docs.

### Change type

- [ ] `bugfix`
- [x] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`
This PR adds a SECURITY.md file.

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
When getting fonts for an export, all stylesheets on the page are
traversed. If any CSS import rules are found, they are downloaded.
However this just directly used the href of the import rule, which makes
it relative to the document. Import rule URLs should however be relative
to the style sheet they are included in. We therefore have to construct
an absolute URL by using the style sheet as the base. If the import rule
doesn't have a parent style sheet it means it's an inline style sheet
and we should fall back to using the baseURI as the base.

Fixes #4939

Describe what your pull request does. If you can, add GIFs or images
showing the before and after of your change.

### Change type

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

### Test plan

1. Include a relative `@import` rule on your page.
2. Trigger an export or print.
3. Observe that the rule is resolved correctly after this change.

- [ ] Unit tests
- [ ] End to end tests

### Release notes

- Fix relative CSS import rules failing to be fetched when exporting or
printing.

Co-authored-by: Torkil Aamodt <[email protected]>
This allows the selection outline to be expanded by different amounts on
each side by supporting returning a `Box` from
`expandSelectionOutlinePx`. Currently it only supports returning a
number which will expand the selection that amount on each side.

Together with #5137 this allows us to implement an alternative cropping
behavior where the shape size remains fixed while cropping, while the
uncropped image size is what you change instead. This is useful in
scenarios where you want to first lay out shapes in a certain layout,
and afterwards crop them so they display the portion of the image you
want.

### Change type

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

### Test plan

1. Add a `expandSelectionOutlinePx` function to a shape that returns a
Box.
2. Verify that the selection outline is expanded according to this Box.

- [ ] Unit tests
- [ ] End to end tests

### Release notes

- Support expanding the selection outline by different amounts on each
side by returning a `Box` from `expandSelectionOutlinePx`.
The problem was twofold:
- we weren't awaiting the updating of the assets
- we used old asset values when creating the shapes.

fixes #5173 / TLD-2910

### Change type

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

### Test plan

1. In `develop.tsx` set `maxImageDimension` to some value.
2. Paste an image.
3. The image should be within the max dimension.

### Release notes

- Fix a bug with `maxImageDimension` not getting applied to pasted
images.
Initial report was a problem with Github Gist's not working on dotcom
but then as long as I was here I noticed we had some other embed issues.

Fixes:
- [x] Gists not working on dotcom
- [ ] Val Town being flaky to load (prbly we should report to them
separately)
- [x] Adds support for pasting in YouTube/Google Maps embeds 

### Change type

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

### Release notes

- Fixes bugs with Github Gist and Val Town; adds support for pasting
`<iframe src="...">` embeds
A user reported that there was a slight risk in allowing Github Gist's
as they were currently being added to the canvas — basically, the JSONP
option on Github can be used to pass in arbitrary Javascript which can
look quite dodgy. But, in the end the Gist is iframed and thus,
sandboxed.

Nonetheless @MitjaBezensek and I worked to come up with a more
restrictive URL filter which should mitigate the issue.

Further reading:
-
https://github.com/bhaveshk90/Content-Security-Policy-CSP-Bypass-Techniques
- https://github.com/renniepak/CSPBypass

### Change type

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

### Release notes

- Restrict Github Gists to a more strict URL format.
Switches from using postgres js to kysely. We still use postgres js for
subscription to the db.

During stress tests we noticed that postgres js was not good at managing
the connection pool. Kysely performed much better.

### Change type

- [ ] `bugfix`
- [x] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`
#5161)

This PR solves the issue #5065. It makes it possible to select multiple
arrow descriptions using the cmd key, which was impossible before.


https://github.com/user-attachments/assets/193ee887-1011-481d-b2d3-16dfa753c0fc

### Change type

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

### Release notes

- Provided an ability to select multiple arrow labels using ctrl/cmd key
Lint is failing on [main
branch](https://github.com/tldraw/tldraw/actions/runs/12668085643/job/35302757390),
this should fix it.

Unsure why it didn't report what the error was?
![CleanShot 2025-01-08 at 15 28
32](https://github.com/user-attachments/assets/5cbc382a-887d-4695-a355-41a9b12a0775)

### Change type

- [x] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`
Found some issues with the blog while working on a blog post.

- Fixed missing videos in make real blog post.
- Fixed broken video on one of the release notes.
- Fixed videos not autoplaying.

This mostly affects the make real blog post.



### Change type

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

### Test plan

1. View the make real blog post
2. Make sure all of the videos load.

- [ ] Unit tests
- [ ] End to end tests

### Release notes

- Blog: Fixed a broken video.
Describe what your pull request does. If you can, add GIFs or images
showing the before and after of your change.

### Change type

- [ ] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [x] `other`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.