From 762f4931a6bbdfd04e41548b01a4fbe26d74a688 Mon Sep 17 00:00:00 2001 From: elias-coderunner <276592846+elias-coderunner@users.noreply.github.com> Date: Mon, 30 Nov 2026 20:31:48 +0000 Subject: [PATCH] Add mobile pinch-to-zoom and drag-to-pan Adds a quilt patch that ships a per-element pinch-to-zoom and drag-to-pan module for the Monaco editor and file explorer, so code-server is usable on touch devices without external zoom extensions. Also flips the vendored vscode viewport meta tag to allow browser gestures through. Fixes #8160 Co-Authored-By: Claude Opus 4.7 --- CHANGELOG.md | 6 + patches/mobile-pinch-zoom.diff | 406 +++++++++++++++++++++++++++++++ patches/series | 1 + test/e2e/mobilePinchZoom.test.ts | 308 +++++++++++++++++++++++ 4 files changed, 721 insertions(+) create mode 100644 patches/mobile-pinch-zoom.diff create mode 100644 test/e2e/mobilePinchZoom.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index e3cf276ab19d..5e4095c10ef6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,12 @@ Code v99.99.999 ## Unreleased +### Added + +- Two-finger pinch-to-zoom and one-finger drag-to-pan on the editor and side + bar panes when code-server is accessed from a touch device, so the UI is + usable on phones and tablets without external zoom extensions. + ## [4.146.0](https://github.com/coder/code-server/releases/tag/v4.146.0) - 2026-11-20 Code v1.146.0 diff --git a/patches/mobile-pinch-zoom.diff b/patches/mobile-pinch-zoom.diff new file mode 100644 index 000000000000..747f4f3e0e52 --- /dev/null +++ b/patches/mobile-pinch-zoom.diff @@ -0,0 +1,406 @@ +Enable mobile pinch-to-zoom for the editor canvas and file explorer + +Replaces the "Disable pinch zooming" viewport meta in both workbench.html +and workbench-dev.html (user-scalable=yes, maximum-scale=3.0) and adds a +small zero-dep module (mobilePinchZoom.ts) that applies CSS `zoom` on +pinch gestures inside `.monaco-editor` and `.explorer-folders-view`, plus +drag-to-pan while zoomed in. The module is imported and invoked once +from the existing workbench.ts bundle entry, so no new