Auto zoom becomes significantly smaller after switching tabs

Aperta
#1,245 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug vscode
Bug description

This was detected when testing #1244 , but impacts normal Quarto Preview behavior on a released version.

Steps to reproduce
  1. Open a .qmd file in the editor.
  2. Start Quarto: Preview. The preview opens in an editor group on the right.
  3. Confirm that Zoom: (Auto) is selected.
  4. Move the preview tab into the left editor group, alongside the source document.
  5. Switch to the source document tab.
  6. 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

Lingua principale
TypeScript
Stelle
665
Fork
69
Merge medio
2g 4h
PR unite (30g)
14

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quarto-dev/quarto

Tutte le issue di quarto-dev/quarto

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.