Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6eeae28
Integrate billing popup, usage sidebar, and credit preview toggle
CJWTRUST Jan 20, 2026
160e082
Recover lost commit 488b47c and restore branch head
google-labs-jules[bot] Jan 28, 2026
ae085cf
Merge pull request #456 from QueueLab/jules-16847885310673003402-db9c…
ngoiyaeric Jan 28, 2026
73c385c
Restore branch history to 488b47c and integrate latest fixes
google-labs-jules[bot] Jan 28, 2026
1508c04
Restore branch history to 488b47c and resolve build errors
google-labs-jules[bot] Jan 28, 2026
c8c028b
Restore branch history, fix build errors, and re-enable pricing popup
google-labs-jules[bot] Jan 28, 2026
e2c0615
Finalize recovery with performance optimizations and UI fixes
google-labs-jules[bot] Jan 28, 2026
43179e7
Synchronize with main, restore history, and optimize performance
google-labs-jules[bot] Jan 29, 2026
7d45e02
Finalize recovery with prioritized main branch code and usage UI
google-labs-jules[bot] Jan 29, 2026
5623831
Refine usage UI and Lottie animation visibility
google-labs-jules[bot] Jan 29, 2026
44e86b6
Complete recovery, synchronization with main, and usage UI integration
google-labs-jules[bot] Jan 29, 2026
0a48018
feat: recover branch state, optimize resolution search, and fix UI st…
google-labs-jules[bot] Jan 29, 2026
6acfbe5
fix: resolve build error and ESLint warnings
google-labs-jules[bot] Jan 29, 2026
8ae549a
Update LICENSE
ngoiyaeric Feb 1, 2026
3495da1
Update LICENSE
ngoiyaeric Feb 1, 2026
ba36e58
Merge pull request #469 from QueueLab/ngoiyaeric-patch-4
ngoiyaeric Feb 1, 2026
6431b41
fix: reduce padding in mobile chat input area
google-labs-jules[bot] Feb 1, 2026
8a04d49
Merge pull request #470 from QueueLab/fix/mobile-chat-input-padding-1…
ngoiyaeric Feb 1, 2026
10ab3fe
feat: update Stripe checkout links to new URL
google-labs-jules[bot] Feb 1, 2026
250283e
Merge pull request #471 from QueueLab/update-stripe-links-17354207767…
ngoiyaeric Feb 1, 2026
1b56819
feat: implement GeoJSON upload and tool ingestion pipeline
google-labs-jules[bot] Feb 1, 2026
9f79929
feat: implement GeoJSON upload and tool ingestion pipeline
google-labs-jules[bot] Feb 1, 2026
6554775
fix: ensure long sentences wrap to the next line across UI components
google-labs-jules[bot] Feb 1, 2026
bfe62f9
feat: support pasted GeoJSON and fix refresh loop
google-labs-jules[bot] Feb 1, 2026
9450b15
feat: enable GeoJSON uploads, paste support, and fix refresh loop
google-labs-jules[bot] Feb 1, 2026
e95a25b
Merge pull request #473 from QueueLab/fix/text-overflow-wrapping-4739…
ngoiyaeric Feb 1, 2026
f80c87f
Resolve merge conflicts and synchronize with main
CJWTRUST Feb 2, 2026
c4278e9
feat: final stability and performance improvements
google-labs-jules[bot] Feb 2, 2026
813d264
Resolve merge conflicts and synchronize with main, preserving branch …
google-labs-jules[bot] Feb 2, 2026
c868dcd
Merge branch 'feature/billing-integration-recovery-648258468266820429…
ngoiyaeric Feb 2, 2026
3b5ed27
Resolve merge conflicts: synchronization with main while preserving b…
google-labs-jules[bot] Feb 2, 2026
3984b9b
Restore missing features from commit c4278e9: tenttree usage UI, popu…
CJWTRUST Feb 2, 2026
f45f687
Merge branch 'main' into jules-8488824498232079115-26d4e4cd
ngoiyaeric Feb 2, 2026
67c26d5
Merge pull request #476 from QueueLab/jules-8488824498232079115-26d4e4cd
ngoiyaeric Feb 2, 2026
a842df1
chore: update stripe payment links
google-labs-jules[bot] Feb 2, 2026
184f678
Merge pull request #477 from QueueLab/update-stripe-links-20260202-15…
ngoiyaeric Feb 2, 2026
895bf37
Update UsageView to yearly refresh model
google-labs-jules[bot] Feb 2, 2026
dc345b9
Update usage-view.tsx
ngoiyaeric Feb 2, 2026
86013ed
Update usage-view.tsx
ngoiyaeric Feb 2, 2026
2ba1f9e
Merge pull request #479 from QueueLab/update-usage-view-to-yearly-ref…
ngoiyaeric Feb 2, 2026
dda7a32
fix: standardize header icon spacing and remove unused portals
google-labs-jules[bot] Feb 2, 2026
23a1d3f
Merge pull request #480 from QueueLab/fix-header-icon-spacing-1628392…
ngoiyaeric Feb 2, 2026
885dbbe
feat: make zoom controls conditional on drawing mode
google-labs-jules[bot] Feb 2, 2026
dd812c1
Merge pull request #482 from QueueLab/conditional-zoom-controls-22256…
ngoiyaeric Feb 2, 2026
00c2e1a
Update usage-view.tsx
ngoiyaeric Feb 2, 2026
54d9d6e
Update usage-view.tsx
ngoiyaeric Feb 2, 2026
c9bd9b2
Merge pull request #484 from QueueLab/ngoiyaeric-patch-5
ngoiyaeric Feb 2, 2026
85a85c5
Merge branch 'main' into feature/geojson-upload-pipeline-111249932693…
ngoiyaeric Feb 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restore branch history to 488b47c and integrate latest fixes
- Reset branch HEAD to historical recovery point 488b47c.
- Applied latest code fixes from orphan commit 166aee9, including Mapbox rendering optimizations and GeoJSON streaming.
- Improved type safety in app/actions.tsx by removing 'as any' casts and properly typing message arrays.
- Refined getModel utility to support vision-aware model fallback.
- Documented non-blocking background task pattern in server actions.
- Updated feature/billing-integration branch with the restored state.

Co-authored-by: ngoiyaeric <115367894+ngoiyaeric@users.noreply.github.com>
  • Loading branch information
google-labs-jules[bot] and ngoiyaeric committed Jan 28, 2026
commit 73c385cba5f970485aea7423a34f397f2db7bbe3
148 changes: 87 additions & 61 deletions app/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ async function submit(formData?: FormData, skip?: boolean) {
const dataUrl = `data:${file.type};base64,${Buffer.from(buffer).toString('base64')}`;

// Get the current messages, excluding tool-related ones.
const messages: CoreMessage[] = [...(aiState.get().messages as any[])].filter(
const messages: CoreMessage[] = (aiState.get().messages as AIMessage[]).filter(
message =>
message.role !== 'tool' &&
message.type !== 'followup' &&
message.type !== 'related' &&
message.type !== 'end'
);
message.type !== 'end' &&
message.type !== 'resolution_search_result'
) as unknown as CoreMessage[];

// The user's prompt for this action is static.
const userInput = 'Analyze this map view.';
Expand All @@ -75,79 +76,103 @@ async function submit(formData?: FormData, skip?: boolean) {
...aiState.get(),
messages: [
...aiState.get().messages,
{ id: nanoid(), role: 'user', content }
{ id: nanoid(), role: 'user', content, type: 'input' }
]
});
messages.push({ role: 'user', content });

// Call the simplified agent, which now returns data directly.
const analysisResult = await resolutionSearch(messages) as any;
// Create a streamable value for the summary.
const summaryStream = createStreamableValue<string>('');

// Create a streamable value for the summary and mark it as done.
const summaryStream = createStreamableValue<string>();
summaryStream.done(analysisResult.summary || 'Analysis complete.');
async function processResolutionSearch() {
try {
// Call the simplified agent, which now returns data directly.
const analysisResult = await resolutionSearch(messages);

// Update the UI stream with the BotMessage component.
uiStream.update(
<BotMessage content={summaryStream.value} />
);
// Mark the summary stream as done with the result.
summaryStream.done(analysisResult.summary || 'Analysis complete.');

messages.push({ role: 'assistant', content: analysisResult.summary || 'Analysis complete.' });
// Append the GeoJSON layer to the UI stream so it appears on the map immediately.
if (analysisResult.geoJson) {
uiStream.append(
<GeoJsonLayer id={nanoid()} data={analysisResult.geoJson} />
);
}

const sanitizedMessages: CoreMessage[] = messages.map(m => {
if (Array.isArray(m.content)) {
return {
...m,
content: m.content.filter(part => part.type !== 'image')
} as CoreMessage
}
return m
})
messages.push({ role: 'assistant', content: analysisResult.summary || 'Analysis complete.' });

const relatedQueries = await querySuggestor(uiStream, sanitizedMessages);
uiStream.append(
<Section title="Follow-up">
const sanitizedMessages: CoreMessage[] = messages.map(m => {
if (Array.isArray(m.content)) {
return {
...m,
content: m.content.filter(part => part.type !== 'image')
} as CoreMessage
}
return m
})

const relatedQueries = await querySuggestor(uiStream, sanitizedMessages);
uiStream.append(
<Section title="Follow-up">
<FollowupPanel />
</Section>
);
</Section>
);

await new Promise(resolve => setTimeout(resolve, 500));
await new Promise(resolve => setTimeout(resolve, 500));

const groupeId = nanoid();
const groupeId = nanoid();

aiState.done({
...aiState.get(),
messages: [
aiState.done({
...aiState.get(),
messages: [
...aiState.get().messages,
{
id: groupeId,
role: 'assistant',
content: analysisResult.summary || 'Analysis complete.',
type: 'response'
id: groupeId,
role: 'assistant',
content: analysisResult.summary || 'Analysis complete.',
type: 'response'
},
{
id: groupeId,
role: 'assistant',
content: JSON.stringify(analysisResult),
type: 'resolution_search_result'
id: groupeId,
role: 'assistant',
content: JSON.stringify(analysisResult),
type: 'resolution_search_result'
},
{
id: groupeId,
role: 'assistant',
content: JSON.stringify(relatedQueries),
type: 'related'
id: groupeId,
role: 'assistant',
content: JSON.stringify(relatedQueries),
type: 'related'
},
{
id: groupeId,
role: 'assistant',
content: 'followup',
type: 'followup'
id: groupeId,
role: 'assistant',
content: 'followup',
type: 'followup'
}
]
});
]
});
} catch (error) {
console.error('Error in resolution search:', error);
summaryStream.error(error);
} finally {
isGenerating.done(false);
uiStream.done();
}
}

// Start the background process without awaiting it to allow the UI to
// stream the response section and summary immediately while the
// analysis runs in the background.
processResolutionSearch();

// Immediately update the UI stream with the BotMessage component.
uiStream.update(
<Section title="response">
<BotMessage content={summaryStream.value} />
</Section>
);

isGenerating.done(false);
uiStream.done();
return {
id: nanoid(),
isGenerating: isGenerating.value,
Expand All @@ -156,13 +181,14 @@ async function submit(formData?: FormData, skip?: boolean) {
};
}

const messages: CoreMessage[] = [...(aiState.get().messages as any[])].filter(
const messages: CoreMessage[] = (aiState.get().messages as AIMessage[]).filter(
message =>
message.role !== 'tool' &&
message.type !== 'followup' &&
message.type !== 'related' &&
message.type !== 'end'
)
message.type !== 'end' &&
message.type !== 'resolution_search_result'
) as unknown as CoreMessage[];

const groupeId = nanoid()
const useSpecificAPI = process.env.USE_SPECIFIC_API_FOR_WRITER === 'true'
Expand Down Expand Up @@ -196,7 +222,7 @@ async function submit(formData?: FormData, skip?: boolean) {
],
});

const definitionStream = createStreamableValue();
const definitionStream = createStreamableValue('');
definitionStream.done(definition);

const answerSection = (
Expand Down Expand Up @@ -293,7 +319,7 @@ async function submit(formData?: FormData, skip?: boolean) {
const hasImage = messageParts.some(part => part.type === 'image')
// Properly type the content based on whether it contains images
const content: CoreMessage['content'] = hasImage
? messageParts as CoreMessage['content']
? (messageParts as CoreMessage['content'])
: messageParts.map(part => part.text).join('\n')

const type = skip
Expand All @@ -312,7 +338,7 @@ async function submit(formData?: FormData, skip?: boolean) {
{
id: nanoid(),
role: 'user',
content,
content: content as string, // content can be string or array, but AIMessage expects string | any
type
}
]
Expand All @@ -329,7 +355,7 @@ async function submit(formData?: FormData, skip?: boolean) {
const mapProvider = formData?.get('mapProvider') as 'mapbox' | 'google'

async function processEvents() {
let action: any = { object: { next: 'proceed' } }
let action: { object: { next: string } } = { object: { next: 'proceed' } }
if (!skip) {
const taskManagerResult = await taskManager(messages)
if (taskManagerResult) {
Expand Down Expand Up @@ -360,7 +386,7 @@ async function submit(formData?: FormData, skip?: boolean) {
let answer = ''
let toolOutputs: ToolResultPart[] = []
let errorOccurred = false
const streamText = createStreamableValue<string>()
const streamText = createStreamableValue<string>('')
uiStream.update(<Spinner />)

while (
Expand Down
4 changes: 0 additions & 4 deletions components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ export const Header = () => {
toggleUsage()
}

useEffect(() => {
// Open payment popup as soon as application opens
setIsPurchaseOpen(true)
}, [])

return (
<>
Expand Down
38 changes: 21 additions & 17 deletions components/map/mapbox-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -448,29 +448,33 @@ export const Mapbox: React.FC<{ position?: { latitude: number; longitude: number
map.current.on('drag', handleUserInteraction)
map.current.on('zoom', handleUserInteraction)

map.current.on('load', () => {
map.current.on('style.load', () => {
if (!map.current) return
setMap(map.current) // Set map instance in context

// Add terrain and sky
map.current.addSource('mapbox-dem', {
type: 'raster-dem',
url: 'mapbox://mapbox.mapbox-terrain-dem-v1',
tileSize: 512,
maxzoom: 14,
})
if (!map.current.getSource('mapbox-dem')) {
map.current.addSource('mapbox-dem', {
type: 'raster-dem',
url: 'mapbox://mapbox.mapbox-terrain-dem-v1',
tileSize: 512,
maxzoom: 14,
})
}

map.current.setTerrain({ source: 'mapbox-dem', exaggeration: 1.5 })

map.current.addLayer({
id: 'sky',
type: 'sky',
paint: {
'sky-type': 'atmosphere',
'sky-atmosphere-sun': [0.0, 0.0],
'sky-atmosphere-sun-intensity': 15,
},
})
if (!map.current.getLayer('sky')) {
map.current.addLayer({
id: 'sky',
type: 'sky',
paint: {
'sky-type': 'atmosphere',
'sky-atmosphere-sun': [0.0, 0.0],
'sky-atmosphere-sun-intensity': 15,
},
})
}

// Initialize drawing tools based on initial mode
if (mapType === MapToggleEnum.DrawingMode) {
Expand All @@ -483,7 +487,7 @@ export const Mapbox: React.FC<{ position?: { latitude: number; longitude: number
}

initializedRef.current = true
setIsMapLoaded(true) // Set map loaded state to true
setIsMapLoaded(true) // Set map loaded state to true earlier on style.load
setupGeolocationWatcher()
})
}
Expand Down
2 changes: 1 addition & 1 deletion components/profile-toggle-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export const useProfileToggle = () => {
throw new Error('Profile toggle context must be used within a ProfileToggleProvider')
}
return context
}
}
9 changes: 7 additions & 2 deletions components/sidebar/chat-history-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
import { toast } from 'sonner';
import { Spinner } from '@/components/ui/spinner';
import { Zap, ChevronDown, ChevronUp } from 'lucide-react';
import { useHistoryToggle } from '../history-toggle-context';
import HistoryItem from '@/components/history-item'; // Adjust path if HistoryItem is moved or renamed
import type { Chat as DrizzleChat } from '@/lib/actions/chat-db'; // Use the Drizzle-based Chat type

Expand All @@ -33,6 +34,7 @@ export function ChatHistoryClient({}: ChatHistoryClientProps) {
const [isClearPending, startClearTransition] = useTransition();
const [isAlertDialogOpen, setIsAlertDialogOpen] = useState(false);
const [isCreditsVisible, setIsCreditsVisible] = useState(false);
const { isHistoryOpen } = useHistoryToggle();
const router = useRouter();

useEffect(() => {
Expand Down Expand Up @@ -60,8 +62,11 @@ export function ChatHistoryClient({}: ChatHistoryClientProps) {
setIsLoading(false);
}
}
fetchChats();
}, []);

if (isHistoryOpen) {
fetchChats();
}
}, [isHistoryOpen]);

const handleClearHistory = async () => {
startClearTransition(async () => {
Expand Down
7 changes: 6 additions & 1 deletion lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export async function getModel(requireVision: boolean = false) {
switch (selectedModel) {
case 'Grok 4.2':
if (xaiApiKey) {
if (requireVision) {
console.warn('Selected model "Grok 4.2" might not support vision, falling back to GPT-4o for vision task.');
break; // Fall through to default behavior or next case
}
const xai = createXai({
apiKey: xaiApiKey,
baseURL: 'https://api.x.ai/v1',
Expand Down Expand Up @@ -75,7 +79,8 @@ export async function getModel(requireVision: boolean = false) {
}

// Default behavior: Grok -> Gemini -> Bedrock -> OpenAI
if (xaiApiKey) {
// If vision is required, we skip models that might not support it well in this context
if (xaiApiKey && !requireVision) {
const xai = createXai({
apiKey: xaiApiKey,
baseURL: 'https://api.x.ai/v1',
Expand Down