Repository navigation
Redesign the Live Study Map - #111
Merged
Merged
Conversation
…dy timer - The study-map page lays a "Studying now" list with exam filters and a study dock over a taller map; narrow screens and the exam-page embed stack them below the map. India is fitted into the area left visible. - List rows and markers highlight each other; a row flies to its student and opens their card. Nearby avatars merge into stacks that zoom in, or list everyone sharing an approximate location. - Starting a session shows a "You" marker and a live timer, also in the tab title, and a reload returns to a session the server still shows. - City labels appear once zoomed in; controls are one vertical group. - The page drops its lede and feature cards. Title, description, canonical, H1 and JSON-LD are unchanged, and exam pages render the same server HTML. - Same Supabase RPC contract, approximate-location jitter and no tiles. - Fix the three study-map e2e tests that failed on main and cover the list, filters, groups, restore and accessibility of the full page.
The list, exam chips and phone card strip are gone. On a wide page the dock floats over the bottom of the map and India is centred above it; the status pill sits on the map. The marker whose card is open stays raised.
State borders are the lines two states share in DataMeet's States/Admin2 (pinned revision, Survey of India's 2021 Ladakh and J&K boundaries, CC BY 2.5 IN, credited on the map), so the coast and national boundary stay those of the country outline. Large states are named at the country view on big maps, smaller ones once zoomed in; a name that would touch a city label is hidden at that zoom. scripts/build-india-states.mjs rebuilds the 179 KB file from the shapefile without dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
The map itself does more, with no extra panels.
+Nchip. Clicking (or Enter/Space) zooms in. Students who share an approximate location are listed in a card instead of zooming to street level.scripts/build-india-states.mjs, and documented inpublic/exam-countdown/maps/README.md.Patterns were borrowed from Mobbin, not cloned: Shopify Live View, Mindtrip, Tiimo.
What stays the same
get_active_study_sessions,upsert_study_session,heartbeat_session,end_study_session), realtime channel and 30 s poll. No backend changes./exam-countdown/study-mapdiffers only in body text (the removed lede and cards). Its title, description, canonical, H1 and JSON-LD are unchanged.Code
lib/timekeeper/use-study-sessions.ts: connection, realtime, polling and heartbeat, moved out of the component unchanged.lib/timekeeper/study-map-engine.ts: Leaflet layers, persistent markers, clustering, focus and dock-aware fitting.components/timekeeper/StudyMapDock.tsx: new component.public/exam-countdown/maps/india-states.geojson,scripts/build-india-states.mjs: state borders and label points, plus the script that builds them. The file is added to the map cache-header rule and toverify-timekeeper.mjs.components/timekeeper/StudyMap.tsx: wires the pieces together.public/ejam/*.css: dropsmy-6andsm:grid-cols-3, which only the removed cards used.Testing
npx playwright test e2e/timekeeper.spec.tsagainstnext build && next start: 75 of 75 pass across the 320, 390, 768, 1024 and 1440 projects.tsc --noEmitand ESLint are clean.Merging
Not merged. This is a single change for its own deploy, ready to annotate in Search Console under the one-change-per-deploy plan.