diff --git a/Docs/Maps_Stage3.md b/Docs/Maps_Stage3.md index 6bc2158c..c7e0872d 100644 --- a/Docs/Maps_Stage3.md +++ b/Docs/Maps_Stage3.md @@ -22,7 +22,7 @@ The guard covers map selection, hierarchy and other same-origin in-application l ## Shared workspace surface -`workspace-surface.js/css` is used by Maps and Relationship Map. Maximise/Restore updates canonical command state and sizing without fitting/rebuilding geography or resetting view/selection/mode/Story scope. Escape first respects open menus/dialogs and active editing gestures. Maps hides redundant Maximise in standalone PWA mode. Relationship Map retains its prior PWA behaviour. +`workspace-surface.js/css` is used by Maps and Relationship Map. Maximise/Restore updates canonical command state and sizing without fitting/rebuilding geography or resetting view/selection/mode/Story scope. Escape first respects open menus/dialogs and active editing gestures. Maps hides only redundant Maximise in standalone PWA mode, retaining the visible Workspace commands. Maps reserves consistent PWA caption height across Story lenses and observes chrome resizing so ribbon collapse/restore continues to fill the available space. Relationship Map retains its prior PWA behaviour. ## Story navigation and readability diff --git a/PlotLine/wwwroot/css/maps-workspace.css b/PlotLine/wwwroot/css/maps-workspace.css index ada5af2d..c7f0fa87 100644 --- a/PlotLine/wwwroot/css/maps-workspace.css +++ b/PlotLine/wwwroot/css/maps-workspace.css @@ -13,3 +13,6 @@ html[data-standalone=true] .maps-story-web-search{display:none!important} #mapsCanvas.manipulating,#mapsCanvas.manipulating .maps-feature{cursor:grabbing} .maps-story-details ol{list-style:none;padding-left:0} + +/* Reserve room for two-line canonical context captions across Maps lenses. */ +html[data-standalone=true]:has(#mapsApp) .pd-ribbon-panel:not([hidden]){min-height:94px} diff --git a/PlotLine/wwwroot/js/maps-workspace.js b/PlotLine/wwwroot/js/maps-workspace.js index fc1c95d8..e9620318 100644 --- a/PlotLine/wwwroot/js/maps-workspace.js +++ b/PlotLine/wwwroot/js/maps-workspace.js @@ -312,7 +312,8 @@ $('mapsFit').onclick=()=>fit();$('mapsFitSelection').onclick=()=>fit(doc?.features.filter(f=>selected.has(f.featureID)));$('mapsZoomIn').onclick=()=>zoom(1/1.25);$('mapsZoomOut').onclick=()=>zoom(1.25); window.PlotDirectorWorkspaceSurface.attach(app,$('mapsMaximise'),{className:'maps-maximised'}); window.addEventListener('beforeunload',e=>{if(dirty){e.preventDefault();e.returnValue='';}}); - new ResizeObserver(()=>{const top=app.getBoundingClientRect().top;if(!app.classList.contains('maps-maximised'))app.style.setProperty('--maps-shell-top',Math.max(0,top)+'px');if(doc)render();}).observe(svg); + const resizeWorkspace=()=>{const top=Math.max(0,app.getBoundingClientRect().top)+'px';if(!app.classList.contains('maps-maximised')&&app.style.getPropertyValue('--maps-shell-top')!==top)app.style.setProperty('--maps-shell-top',top);if(doc)render();}; + const workspaceResize=new ResizeObserver(resizeWorkspace);workspaceResize.observe(svg);const chrome=document.querySelector('.pd-application-header');if(chrome)workspaceResize.observe(chrome); const syncDisplayMode=()=>{$('mapsMaximise').hidden=!!window.PlotDirectorPwa?.standalone;};syncDisplayMode();window.matchMedia('(display-mode: standalone)').addEventListener('change',syncDisplayMode); app.dataset.mode=mode;library();locations();crumbs();details();updateButtons(); $('mapsWelcome').hidden=!!doc;svg.style.visibility=doc?'visible':'hidden';$('mapsList').innerHTML=boot.maps.map(m=>`${esc(m.name)} · ${esc(m.kind)}${m.parentMapID?' · detail of '+esc(boot.maps.find(p=>p.mapID===m.parentMapID)?.name||'parent map'):''}`).join('');