feat: add view mode in Excalidraw#2840
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/excalidraw/excalidraw/h4sbatay9 |
|
Looks promising. We'll need to factor out logic relating to canvas movements (panning, zoom...) and such. Dunno what's our stance on exporting. Ad help dialog: maybe. Or we can leave it for later PR. |
I have only now read #2841 so I'll discuss some more points over there |
|
I think the cursor in view mode should act as a drag tool, as does in Figma/Miro etc. and we shouldn't deviate from that standard. I know we're still not splitting the modes into presentation & read at this point, but this I think should be in both modes. In terms of how selection will work in that mode: I like what Miro does, which is dragging always drags, and single-clicking on an element selects (plus changes cursor from hand to normal arrow). If we want to leave this part for a next PR, that's fine, but I'd at least start with dragging tool across the board. |
|
Also, if we're gonna persist the view mode into LS across refreshed, I'd add the |
I think we shouldn't store it in local storage as this doesn't seem like a mode which users would want to persist. For example, if you check in google docs (change to view mode & it is lost on refresh) and when we use this mode in a collaboration that time mode will always be persisted if the view-only link is shared. Thoughts? |
|
🐑 it |
Do you mean we should show a hand cursor instead of the disabled cursor in view mode? And by dragging tool you mean something like below 👇 But wouldn't this mean we are allowing the user to update the whole drawing position in view mode ? |
I'm talking about panning. That modifies local client's scroll position. Same as what is shown in your Miro GIF above. |
… individual elements)
|
I'm down.. with follow up improvements..! |
|
Let's at least fix this: the panning only works every 2nd drag you do :) |
|
My approach of checking selectedElementIds might not be right when allowing selection over panning. I am looking into it but might need some more time to debug this. The selection also requires a double click sometimes. Do we want to disable selection and allow only panning for first version? Then resetting the |
|
There is no wrong way for the first iterration.. anything we don't like or want to improve can file as issues.. |
I think this is a good idea. Better than to ship it in a half broken state. (Also, selecting is an edge case. Panning is more important in view mode.) |
Sure sounds good 👍 . If this bug is not a blocker let's ship it 🚀 . @dwelle what do you say? |
missed this comment. should be fine now 👍 |
|
Thanks. Shipping! 🎉 |
* 'master' of github.com:excalidraw/excalidraw: (58 commits) chore: Update translations from Crowdin (#2906) fix: toolbar unnecessarily eats too much width (#2924) fix: mistakenly hardcoding scale (#2925) fix: text editor not visible in dark mode (#2920) feat: support supplying custom scale when exporting canvas (#2904) fix: incorrect z-index of text editor (#2914) feat: Show version in the stats dialog (#2908) fix: make scrollbars draggable when offsets are set (#2916) chore: Run actions on pull requests as well (#2917) feat: Add idle detection to collaboration feature (#2877) fix: pointer-events being disabled on free-draw (#2912) feat: don't store to LS during collab (#2909) chore: Update translations from Crowdin (#2898) fix: track zenmode and grid mode usage (#2900) refactor: Use the latest vercel configuration instead of now (#2893) chore: Update translations from Crowdin (#2894) Update i18n.ts Update locales-coverage-description.js feat: add view mode in Excalidraw (#2840) chore(deps): bump @sentry/integrations from 6.0.1 to 6.0.3 (#2889) ...
Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: Lipis <lipiridis@gmail.com>

Fixes #2830 Fixes #2841
This is an initial version of how view mode would look like 👇 Please share your views.
For package 👇
You can check it here
Version 1 (this PR)
Read-only(just likeZen mode)alt+rfor view modeviewModeEnabledprop so the host can also use it. We don't render view mode in context menu when this prop is true so host can control it.Version 2 (next PR)
what else?
cc @dwelle