Open pages without geo data in a separate fullscreen route#53
Open pages without geo data in a separate fullscreen route#53
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: bcye <29666239+bcye@users.noreply.github.com>
Co-authored-by: bcye <29666239+bcye@users.noreply.github.com>
Co-authored-by: bcye <29666239+bcye@users.noreply.github.com>
Co-authored-by: bcye <29666239+bcye@users.noreply.github.com>
bcye
left a comment
There was a problem hiding this comment.
This isn't a nice solution. How about making full screen mode it's own route, outside of the map _layout and navigating to that when full screen should be used
|
@copilot can you implement the changes requested in my review? |
…screen Co-authored-by: bcye <29666239+bcye@users.noreply.github.com>
Done! I've refactored the implementation to use a separate fullscreen route as you requested (commit 0673701). Changes:
The fullscreen mode is now a completely separate route outside the map layout, as suggested. |
|
@copilot this looks incredibly duplicated. Make a good effort. |
Co-authored-by: bcye <29666239+bcye@users.noreply.github.com>
Refactored to eliminate duplication (commit d137bcd). Changes:
The duplication is eliminated while maintaining clean separation between map and fullscreen routes. |
Problem
Currently, all pages open with the map view visible regardless of whether they have geographic coordinates. Pages without geo data would benefit from opening in fullscreen mode to maximize content visibility, since there's nothing to show on the map.
Solution
This PR implements a route-based approach to handle pages without geographic data by creating a separate fullscreen route outside of the map layout:
/main/explore/page/[pageId]with map view and automatically zoom to the coordinates/main/explore/page-fullscreen/[pageId]which displays content without the map layoutImplementation Details
1. Created Shared Components (
app/main/explore/_shared/)To eliminate code duplication, common logic has been extracted into reusable components:
page-content.tsx- Shared page content and section cards with configurable base pathsscroll-container.tsx- Conditional scroll view wrapper (usesBottomSheetScrollViewfor map layout,ScrollViewfor fullscreen)use-section-bookmarks.ts- Shared bookmark management logic2. Created New Fullscreen Route (
app/main/explore/page-fullscreen/[pageId]/)A separate route structure for pages without geographic data that reuses shared components:
_layout.tsx- Simple Stack layout with fullscreen mode enabledindex.tsx- Main fullscreen page component using sharedPageContentsection/[title].tsx- Section view using sharedScrollContainerand bookmark logic3. Refactored Existing Page Route
Both the regular page route and fullscreen route now use the same shared components:
_page-root-view.tsx- Simplified to useScrollContainerandPageContentsection/[title].tsx- Simplified to useScrollContaineranduseSectionBookmarksindex.tsx- Added redirect logic to route to fullscreen when no geo data detectedArchitecture Benefits
Benefits
Fixes #52
Original prompt
Fixes #52
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.