Auto zoom becomes significantly smaller after switching tabs
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript, typescript
- 领域
- frontend
调研方向
The Auto zoom resize handler lives in apps/vscode/assets/www/preview/index.js, where scaleFactor is computed from window.innerWidth and a 200 ms throttle flag gates resize events. Reproduce by moving the preview tab between editor groups and switching tabs, logging window.innerWidth in the handler. Done when the scale is recalculated after the timer expires or on the restoration resize, so it matches the visible width.
由索引模型根据 Issue 内容生成。
描述
Bug description
This was detected when testing #1244 , but impacts normal Quarto Preview behavior on a released version.
Steps to reproduce
- Open a
.qmdfile in the editor. - Start Quarto: Preview. The preview opens in an editor group on the right.
- Confirm that Zoom: (Auto) is selected.
- Move the preview tab into the left editor group, alongside the source document.
- Switch to the source document tab.
- Switch back to the Quarto Preview tab.
Actual behavior
The preview content becomes significantly smaller after switching back to its tab.
Expected behavior
Auto zoom should calculate the scale from the preview’s current visible width. Moving the preview between editor groups or switching tabs should not leave it incorrectly scaled.
Additional observations
- Reproduced with the native Quarto extension in desktop VS Code
- Fixed zoom levels do not exhibit the issue.
- The issue was not observed in code-server.
Possible cause
The Auto zoom resize handler in apps/vscode/assets/www/preview/index.js calculates:
scaleFactor = Math.min(1, window.innerWidth / 1050);
It updates on the first resize event, then ignores further resize events for 200 ms. When the timer expires, it clears the throttle flag without recalculating the scale.
Moving or hiding a preview tab may temporarily give its webview a smaller viewport. If the handler captures that intermediate width and ignores the subsequent restoration event, the preview could retain an incorrectly reduced scale when shown again.
Steps to reproduce
No response
Actual behavior
No response
Expected behavior
No response
Your environment
No response
- 主要语言
- TypeScript
- 星标
- 665
- 派生
- 69
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 14
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/quarto 的其他 Issue
-
vscode
难度 2/5 1-3 小时 新手友好度 68/100
quarto-dev/quarto#1227 · 1 条评论 ·
维护者通常 1 天内回复
-
bug vscode
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/quarto#1211 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
quarto-dev/quarto#1139 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 90/100
quarto-dev/quarto#1138 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
quarto-dev/quarto#1137 ·
维护者通常 1 天内回复
查看 quarto-dev/quarto 的全部 Issue
相似的 Issue
-
api bug priority:low ready-for-agent
难度 2/5 1-3 小时 新手友好度 78/100
wondermoney/wondermoney#862 ·
维护者通常 1 天内回复
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 84/100
rootsiemen/seo-agent-tools#70 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
alvinunreal/oh-my-opencode-slim#1971 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
elecnix/bellwether#467 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复