-
-
Notifications
You must be signed in to change notification settings - Fork 7
Integrate Resolution Search and UI Improvements #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6eeae28
160e082
ae085cf
73c385c
1508c04
c8c028b
e2c0615
43179e7
7d45e02
5623831
44e86b6
0a48018
6acfbe5
8ae549a
3495da1
ba36e58
6431b41
8a04d49
10ab3fe
250283e
6554775
e95a25b
f80c87f
c4278e9
813d264
c868dcd
3b5ed27
3984b9b
f45f687
67c26d5
a842df1
184f678
9377934
895bf37
dc345b9
86013ed
2ba1f9e
a77a5d4
5814452
307738b
df52ed9
dda7a32
af8012e
23a1d3f
a9bf40d
d519390
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ import { useActions, useUIState } from 'ai/rsc' | |
| import { AI } from '@/app/actions' | ||
| import { nanoid } from 'nanoid' | ||
| import { UserMessage } from './user-message' | ||
| import { toast } from 'react-toastify' | ||
| import { toast } from 'sonner' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify Toaster component is mounted in the app
rg -n "Toaster" --type=tsx --type=ts -g '!node_modules'Repository: QueueLab/QCX Length of output: 83 🏁 Script executed: # Check for any remaining react-toastify imports
rg -n "react-toastify" --type=tsx --type=ts -g '!node_modules'Repository: QueueLab/QCX Length of output: 83 🏁 Script executed: # Verify the migration in the file
rg -n "from 'sonner'" --type=tsx --type=ts -g '!node_modules'Repository: QueueLab/QCX Length of output: 83 🏁 Script executed: #!/bin/bash
# Search for Toaster component in TypeScript/React files
rg -n "Toaster" --type-add 'web:*.{ts,tsx,js,jsx}' -t web -g '!node_modules'Repository: QueueLab/QCX Length of output: 970 🏁 Script executed: # Search for react-toastify to ensure it was fully removed
rg "react-toastify" -g '!node_modules'Repository: QueueLab/QCX Length of output: 558 🏁 Script executed: # Search for sonner imports
rg "from ['\"]sonner['\"]" -g '!node_modules'Repository: QueueLab/QCX Length of output: 382 🏁 Script executed: # List the app entry/layout files to check for Toaster
fd -e tsx -e ts . -path '*/app*' -o -path '*/layout*' -o -path '*/main*' -o -path '*/index*' | head -20Repository: QueueLab/QCX Length of output: 224 Complete the sonner migration across the codebase. The migration from 🤖 Prompt for AI Agents |
||
| import { useSettingsStore } from '@/lib/store/settings' | ||
| import { useMapData } from './map/map-data-context' | ||
|
|
||
|
|
@@ -37,7 +37,11 @@ export function HeaderSearchButton() { | |
|
|
||
| const handleResolutionSearch = async () => { | ||
| if (mapProvider === 'mapbox' && !map) { | ||
| toast.error('Map is not available yet. Please wait for it to load.') | ||
| toast.error('Mapbox is not available yet. Please wait for it to load.') | ||
| return | ||
| } | ||
| if (mapProvider === 'google' && !mapData.cameraState) { | ||
| toast.error('Google Maps state is not available yet.') | ||
| return | ||
| } | ||
| if (!actions) { | ||
|
|
@@ -73,7 +77,7 @@ export function HeaderSearchButton() { | |
| const { center, range } = mapData.cameraState | ||
| const zoom = Math.round(Math.log2(40000000 / (range || 1))); | ||
|
|
||
| let staticMapUrl = `https://maps.googleapis.com/maps/api/staticmap?center=${center.lat},${center.lng}&zoom=${zoom}&size=640x480&maptype=satellite&key=${apiKey}`; | ||
| let staticMapUrl = `https://maps.googleapis.com/maps/api/staticmap?center=${center.lat},${center.lng}&zoom=${zoom}&size=640x480&scale=2&maptype=satellite&key=${apiKey}`; | ||
|
|
||
| const response = await fetch(staticMapUrl); | ||
| if (!response.ok) { | ||
|
|
@@ -107,7 +111,7 @@ export function HeaderSearchButton() { | |
| variant="ghost" | ||
| size="icon" | ||
| onClick={handleResolutionSearch} | ||
| disabled={isAnalyzing || !map || !actions} | ||
| disabled={isAnalyzing || !actions || (mapProvider === 'mapbox' && !map) || (mapProvider === 'google' && !mapData.cameraState)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Disable logic consistency is good but verbose. The disable condition is duplicated between desktop and mobile buttons. Consider extracting to a computed variable for maintainability. ♻️ Extract shared disable condition+ const isDisabled = isAnalyzing || !actions || (mapProvider === 'mapbox' && !map) || (mapProvider === 'google' && !mapData.cameraState)
+
const desktopButton = (
<Button
variant="ghost"
size="icon"
onClick={handleResolutionSearch}
- disabled={isAnalyzing || !actions || (mapProvider === 'mapbox' && !map) || (mapProvider === 'google' && !mapData.cameraState)}
+ disabled={isDisabled}
title="Analyze current map view"
>And similarly for Also applies to: 126-126 🤖 Prompt for AI Agents |
||
| title="Analyze current map view" | ||
| > | ||
| {isAnalyzing ? ( | ||
|
|
@@ -119,9 +123,8 @@ export function HeaderSearchButton() { | |
| ) | ||
|
|
||
| const mobileButton = ( | ||
| <Button variant="ghost" size="sm" onClick={handleResolutionSearch} disabled={isAnalyzing || !map || !actions}> | ||
| <Search className="h-4 w-4 mr-2" /> | ||
| Search | ||
| <Button variant="ghost" size="icon" onClick={handleResolutionSearch} disabled={isAnalyzing || !actions || (mapProvider === 'mapbox' && !map) || (mapProvider === 'google' && !mapData.cameraState)}> | ||
| <Search className="h-[1.2rem] w-[1.2rem]" /> | ||
| </Button> | ||
| ) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LICENSE boilerplate line is being edited to a specific person/year. This may be legally incorrect if the project is not solely authored/owned by that person, and it may conflict with repository ownership/CLA expectations.
This is not a code issue but it is a release-blocking compliance risk if inaccurate.
Suggestion
Confirm the correct copyright holder for the repository (individual vs organization) and ensure this line matches the project’s legal ownership and contribution model. If this was accidental, revert this line and manage attribution via
NOTICE/AUTHORSinstead.Reply with "@CharlieHelps yes please" if you'd like me to add a commit reverting the LICENSE line pending confirmation.