Skip to content
Closed
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions app/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ async function submit(formData?: FormData, skip?: boolean) {

if (userInput.toLowerCase().trim() === 'what is a planet computer?' || userInput.toLowerCase().trim() === 'what is qcx-terra?') {
const definition = userInput.toLowerCase().trim() === 'what is a planet computer?'
? `A planet computer is a proprietary environment aware system that interoperates weather forecasting, mapping and scheduling using cutting edge multi-agents to streamline automation and exploration on a planet. Available for our Pro and Enterprise customers. [QCX Pricing](https://www.queue.cx/#pricing)`
? `A planet computer is a proprietary environment aware system that interoperates weather forecasting, mapping and scheduling using cutting edge multi-agents to streamline automation and exploration on a planet. Available for our Pro and Enterprise customers.`

: `QCX-Terra is a model garden of pixel level precision geospatial foundational models for efficient land feature predictions from satellite imagery. Available for our Pro and Enterprise customers. [QCX Pricing] (https://www.queue.cx/#pricing)`;
: `QCX-Terra is a model garden of pixel level precision geospatial foundational models for efficient land feature predictions from satellite imagery. Available for our Pro and Enterprise customers.`;
Comment on lines +138 to +140

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

LGTM! Pricing links successfully removed.

The definitions now end cleanly without the pricing link, accomplishing the PR objective. Both strings maintain consistent formatting and messaging.

Optional refactor for maintainability:

Consider extracting these hardcoded definitions to a constants file or configuration object. This would make future updates easier and keep the submit function focused on flow control.

// constants/definitions.ts
export const QUERY_DEFINITIONS = {
  'what is a planet computer?': 
    'A planet computer is a proprietary environment aware system that interoperates weather forecasting, mapping and scheduling using cutting edge multi-agents to streamline automation and exploration on a planet. Available for our Pro and Enterprise customers.',
  'what is qcx-terra?':
    'QCX-Terra is a model garden of pixel level precision geospatial foundational models for efficient land feature predictions from satellite imagery. Available for our Pro and Enterprise customers.'
} as const;

Then in this file:

+import { QUERY_DEFINITIONS } from '@/constants/definitions'
+
+// ...
+
+  const normalizedInput = userInput.toLowerCase().trim();
-  if (userInput.toLowerCase().trim() === 'what is a planet computer?' || userInput.toLowerCase().trim() === 'what is qcx-terra?') {
-    const definition = userInput.toLowerCase().trim() === 'what is a planet computer?'
-      ? `A planet computer is a proprietary environment aware system that interoperates weather forecasting, mapping and scheduling using cutting edge multi-agents to streamline automation and exploration on a planet. Available for our Pro and Enterprise customers.`
-      : `QCX-Terra is a model garden of pixel level precision geospatial foundational models for efficient land feature predictions from satellite imagery. Available for our Pro and Enterprise customers.`;
+  const definition = QUERY_DEFINITIONS[normalizedInput as keyof typeof QUERY_DEFINITIONS];
+  if (definition) {

This also eliminates the duplicate toLowerCase().trim() calls.

🤖 Prompt for AI Agents
In app/actions.tsx around lines 138 to 140, the two long hardcoded definition
strings should be moved into a dedicated constants/config file and referenced
from there to improve maintainability; create a constants file (e.g.,
constants/definitions.ts) exporting a map of query keys to definition strings,
import that map into app/actions.tsx, replace the inline literals with lookups
into the map, and consolidate any repeated toLowerCase().trim() calls by
normalizing the input once before the lookup so you eliminate duplicated string
transforms.


const content = JSON.stringify(Object.fromEntries(formData!));
const type = 'input';
Expand Down