Repository navigation
feat(ui, widget, screen, map): Added Room Search functionality prototype! + settings UI features, floorplay overlay header, and more - #126
TheStaticBits wants to merge 29 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Great work! A couple notes:
3. Hide the "Get directions" button for now since micronavigation isn't implemented yet (planned for a 3.x release)
4. Is bathroom search working right now? If not that's ok but I noticed it couldn't find any on the grove (same for "Printing" chip, I got no results)
5. I'm seeing a "Null check operator used on a null value" as you scroll the chips to the right
|
| ColorType.roomSearchBathroom: Color.fromARGB(255, 151, 132, 193), | ||
| ColorType.roomSearchInfoDesk: Color.fromARGB(255, 121, 176, 235), | ||
| ColorType.roomSearchDining: Color.fromARGB(255, 235, 162, 121), | ||
| ColorType.roomSearchVending: Color.fromARGB(255, 235, 121, 121), |
There was a problem hiding this comment.
Dark mode crash on the Vending chip
ColorType.roomSearchVending is only defined in lightColors. It's missing from darkColors, and getColor() force-unwraps the dark map (darkColors[type]!). Vending is the last chip in the row, so it only renders once you scroll right, at which point dark mode throws "Null check operator used on a null value". I believe that's the crash from @iswheeler's earlier comment.
Fix: add a roomSearchVending entry to darkColors. It might also be worth a small test that asserts both palettes contain every ColorType value so this can't happen again.
Written by Claude, verified by Ishan.
| controller: _searchController, | ||
| focusNode: _searchFocusNode, | ||
| decoration: InputDecoration( | ||
| fillColor: getColor(context, ColorType.roomSearchBg), |
There was a problem hiding this comment.
Typed search text is unreadable in dark mode
The field background changed from the themed ColorType.inputBackground to ColorType.roomSearchBg, but roomSearchBg is the same light blue (223, 237, 252) in both lightColors and darkColors. The typed text style in LocationSearchBar still uses ColorType.opposite, which is white in dark mode, so you get white text on a light blue field. This is probably the dark-mode readability issue from @iswheeler's comment.
Fix: either give roomSearchBg a proper dark variant in darkColors, or use a fixed dark text colour (e.g. roomSearchText or black) for the input text so it reads against the light field in both themes.
Written by Claude, verified by Ishan.
|
Also in the future, please make much smaller PRs. 21 files changed is a lot to review. Make smaller PRs as you go rather than big summing PRs |
|
@iswheeler: @i-kumar: I have changed the offset distance for the header to be based off of the globalTopPadding variable. thank you guys! |
…n the map in map_screen.dart, added a new variable called mapCenter that tracks where the user is centered on the map. in location_search.dart, searchLocations and _ngramSearch now accept an optional center, and when it’s given, they take the 30 best text matches, sort them by distance to that point, and return the closest 10 (rooms in equally ranked buildings also sort nearest-first), while behaving exactly as before when no center is passed in search_sheet_main.dart, added an optional mapCenter to SearchSheet and LocationSearchBar, passed it from the sheet down to the search bar, and handed it to both searchLocations calls (the live results and the on-submit lookup) as center. in location_search_test.dart, added 3 buildings at various locations on campus and tested results when searching with diff locations. all tests pass and this file can be removed when submitting the pr.
Calculate the slide distance from the device's bottom padding instead of using a fixed value (was 2 previously).
|
Claude pointed out a few extra bugs and these three seem to be the most severe. Could you take a look at these? Retry loop with no backoff. On a failed fetch or empty result, refreshKey.value++ triggers a rebuild, then a refetch, then another increment. With the backend down, this hammers it in a tight loop with no delay or retry cap. The fetch happens on every sheet open, with no caching. showPOISelection returns silently when location is unavailable. map_screen.dart:1411 does if (position == null) return;. The sheet is already closed and the user sees nothing. The error snackbar is commented out, so errors are swallowed by catch (). The user gets no feedback on permission denial, GPS off, or any thrown error. Non-numeric room names are unreachable. The edge-word check (digits <= letters → skip) means rooms like "B" or "G12A" (more letters than digits) can never match as the number part. Rooms named "Lobby" or "AB" are unsearchable by room. |







Description
Consolidated search bars sheets into one search bar, added room search functionality, recent searches, cards for nearby POI search, settings features (Sign in banner and "Help" section), along with the header bar and back button for floorplan overview mode. Also fixed search result markers not showing up. Apologies for the large pull request, MaizeBus is the only thing I have been working on for the past four days :p
Type of Change
feat)fix)Changed Files
map_screen.dart_loadStopsForLaunch()in_loadAllData()now, so that the code does not need to be duplicated insearch_sheet_main.dart_showSearchLocationMarker()takes a "showGetOnIcon" parameter, telling it whether to show a normal marker or an "enter" icon marker._searchLocationMarkeris passed intoCompositeMapWidgetto properly display on map, as it was previously not being displayed (bug fix)_selectedPOIstate to track the currently selected room/POI for the POISheet overlay_showPOISelection()to search around the user's location for a particular type of POI, opening the POI sheet and centering on the user after it finds them._showRoomSearchResult()to center onto a particular room. It switches to the floor of the room, centers it, places a marker, and opens its corresponding POISheet.search_sheet_main.dartsaveRecentSearch()andgetRecentSearches().location_sheet.dartSearchSheetclass.search_rooms.dartlocation_search.dartLocationclass.List<Locations>(which can be RoomLocation objects when rooms are returned as search results)poi_sheet.dartsettings.dartBathroomProviderclass.composite_map_widget.dartfloorplan_marker_service.dartfloorplan_service.dartLocatedFloorplanPoiclass, which stores a POI along with its building, floor, etc.FloorplanPoiIndexclass, which is used for searching. It projects all POIs onto the real world map, storing their actual latlng, and adding them all to a single List ofLocatedFloorplanPois. It implements anearestfunction, which returns the nearest X number of POIs of a particular type to a given LatLng.floorplan_style.dartfloorplans_layer.dartfloorplan_overlay_widget.dartonRoomSearchcallback forFloorplanEntryBarclassFloorplanEntryBarFloorplanOverlayclassonClosedandonRoomSearchcallbacks toFloorplanOverlayFloorplanOverlayfor consistency with the map search bar UIbathroom_provider.dartmain.dartsearch_result_layer.dartdialog.dartshowDialogOptions()function, which displays a dialog to the user with as many different options on it as the function caller passes in via theoptionsparameter.constants.darttoJson()andfromJson()functions toLocationclass to help with saving recent search locationsdirections_sheet.dartSearchSheet()calls (due to the new parameter in SearchSheet widget)journey_results_widget.dartSearchSheet()calls (due to the new parameter in SearchSheet widget)floorplan.dartprinter.pngci.yamlDoes your code rely on another PR
None that are still open.
Testing Done
Flutter:
Screenshots / Demo (if UI or notification change)
Checklist
[type](scope): short descriptionmainand is our current working update branch (e.g.maizebus2.1)print()/debugPrint()/console.log()left in production code