Dragonroll Frontend: Map Viewer adjustmentes #15
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'll start by exploring the repository structure and the map-related code.
Frontend deps are installed. Now let me create the shared map viewer pane component.
Now updating the sidebar to anchor maps instead of opening a floating window:
Now the create map window fixes (scale snapping + outer margin):
Now let me add tests for the new anchored-map state and the create-map input constraints:
Done — all three adjustments from the issue are implemented in the working tree.
1. Scale no longer snaps to
5.01 / 5.51 / 6.01frontend/app/components/windows/CreateMapWindow.vue— the scale field was<input type="number" min="0.01" step="0.5">. A number input only acceptsmin + n × step, so with that minimum the only reachable values were0.01, 0.51, …, 5.01, 5.51, …. It is nowstep="any"(plusinputmode="decimal"), keepingmin="0.01"because the backend schema enforces the same positive minimum. Any decimal (5,5.25,3.75…) is accepted and stored as typed.2. Outer margin in the create map window
The window body was
width: 100%+padding: 10px 18pxwith defaultbox-sizing, so it was 36 px wider than the window: content overflowed the frame and nothing inset it. It now has a real outer margin (margin: 10px,box-sizing: border-box,align-self: stretch) and fills/scrolls within the window height (flex: 1; min-height: 0).3. Anchoring a map on the note container
frontend/app/services/Content.jsgained the workspace pane state:ActivePane('notes'|'map'),AnchoredMap,SetActivePane,AnchorMap,ClearAnchoredMap.MapViewerWindow.vueinto a new chrome-lessfrontend/app/components/viewer/map/MapViewerPane.vue(same zoom/pan/grid/fit/edit behaviour, keeps reacting tocampaign-entry-updated). The floating window is now justWindowHandle+ that pane.Content.vuerenders the pane inside the note-container area and swaps it withNoteContainerviav-show, so the open notes stay open while the map is displayed.ContentSidebar.vue: clicking a map anchors it (instead of opening a window); the sidebar's notes button shows the open notes and the maps button shows the anchored map. The anchored entry is highlighted and badged. Anchoring closes a floating viewer for a map, deleting the anchored map or switching campaign clears the anchor, and adetachbutton in the anchored toolbar gives the map back a floating window (so the existingmap_viewerwindow stays reachable). Opening a note from the sidebar or the search palette always brings the notes back to the front.campaigns.map.open-window/campaigns.map.anchoredadded toen,es,ca.Verification
npm test→ 20/20 passed, including the newtests/map-viewer.test.js(anchor/pane state transitions loaded in anode:vmwith arefstub, plus create-map-window scale/margin checks; I confirmed both new create-map assertions fail against the previous code).npx nuxt build --dotenv .env.production→ build completed successfully (only pre-existing warnings). I did not run the dev server against a live backend, so the flows were not exercised in a browser.AGENTS.mdupdated for theContent.jsservice row, the newviewer/map/component and §5.1.Implementation is ready for review: #16