@@ -641,7 +641,7 @@ function refresh(): void {
641641 updatePanelStatus ( ) ;
642642}
643643
644- /** Update the status line without recreating the rest of the panel controls. */
644+ /** Update the status line (and auto-resolution readout) without recreating controls. */
645645function updatePanelStatus ( ) : void {
646646 const status = panelContainer ?. querySelector < HTMLElement > ( "[data-dggal-status]" ) ;
647647 if ( ! status ) {
@@ -650,6 +650,16 @@ function updatePanelStatus(): void {
650650 }
651651 status . textContent = currentError ?? labels . cellCount ( currentGrid . features . length ) ;
652652 status . style . color = currentError ? "#dc2626" : "" ;
653+ if ( settings . autoResolution ) {
654+ const shown = String ( effectiveResolution ( ) ) ;
655+ const resolution = panelContainer ?. querySelector < HTMLInputElement > ( "[data-dggal-resolution]" ) ;
656+ const resolutionValue = panelContainer ?. querySelector < HTMLElement > ( "[data-dggal-resolution-value]" ) ;
657+ if ( resolution ) {
658+ resolution . value = shown ;
659+ resolution . title = shown ;
660+ }
661+ if ( resolutionValue ) resolutionValue . textContent = shown ;
662+ }
653663}
654664
655665/**
@@ -824,11 +834,11 @@ function renderPanel(container: HTMLElement): void {
824834 ) ;
825835 row ( labels . autoResolution , autoResolution ) ;
826836
827- // In automatic mode the slider becomes a read-only indicator of the
828- // zoom-derived resolution; refresh() re-renders the panel on every moveend,
829- // so it tracks zoom gestures.
837+ // In automatic mode the slider is a read-only indicator of the zoom-derived
838+ // resolution; updatePanelStatus() keeps it in sync on every moveend.
830839 const shownResolution = effectiveResolution ( ) ;
831840 const resolution = document . createElement ( "input" ) ;
841+ resolution . dataset . dggalResolution = "" ;
832842 resolution . type = "range" ;
833843 resolution . min = "0" ;
834844 resolution . max = String ( DGGAL_TYPES [ settings . dggrsType ] ) ;
@@ -847,6 +857,7 @@ function renderPanel(container: HTMLElement): void {
847857 resolutionWrap . style . gap = "6px" ;
848858 resolutionWrap . style . opacity = settings . autoResolution ? "0.6" : "1" ;
849859 const resolutionValue = document . createElement ( "strong" ) ;
860+ resolutionValue . dataset . dggalResolutionValue = "" ;
850861 resolutionValue . textContent = String ( shownResolution ) ;
851862 resolution . addEventListener ( "input" , ( ) => {
852863 resolutionValue . textContent = resolution . value ;
0 commit comments