Skip to content

canvas: read only mode#4006

Merged
Parth merged 3 commits intomasterfrom
canvas-readonly
Dec 7, 2025
Merged

canvas: read only mode#4006
Parth merged 3 commits intomasterfrom
canvas-readonly

Conversation

@ad-tra
Copy link
Copy Markdown
Member

@ad-tra ad-tra commented Dec 5, 2025

This pr adds a flag read_only in the Tab struct so that different content types can handle read mode differently.

@tvanderstad feel free to ad a MD read only mode based on that.

on the canvas front: read only mode will:

  1. hide the tools island so that the user can't select a pen, eraser, or any other mutation tools
  2. never saves the buffer even on a pan
  3. skips processing mutation events like new strokes, clipboard handling, etc.
image

fixes #3997

@Parth Parth requested a review from tvanderstad December 5, 2025 16:04
Copy link
Copy Markdown
Contributor

@tvanderstad tvanderstad left a comment

Choose a reason for hiding this comment

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

lgtm

@Parth Parth merged commit 430ded5 into master Dec 7, 2025
1 check passed
@Parth Parth deleted the canvas-readonly branch December 7, 2025 00:03
@tvanderstad tvanderstad mentioned this pull request Dec 7, 2025
.next_back()
.unwrap_or_default()
.to_owned(),
let (ext, read_only) = match self.core.get_file_by_id(id) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should use the file_cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

read only mode

3 participants