Skip to content

Conversation

@jrmartin
Copy link
Collaborator

@jrmartin jrmartin commented Jan 13, 2026

This pull request introduces several improvements to how queries are managed and displayed in the Virtual Fly Brain application. The main focus is on better validation and error handling in the backend, optimizing query data fetching and caching in the frontend, and enhancing the user interface to make query access more intuitive and responsive.

Backend improvements:

  • Added validation for the query_type parameter in the run_query function in queries.py, ensuring that it is provided and valid; an informative error is raised if not.
  • Improved error handling for unknown query types in run_query, raising a clear error message instead of returning a result.

Frontend data handling and caching:

  • Updated get_queries in query.js to return only the necessary queries array and name, minimizing the response payload.
  • Enhanced the getQueries action in queries.js to check for cached instance data before making network calls, reducing unnecessary requests and improving performance.
  • Refactored the QueriesReducer to store queries as objects keyed by query name, ensuring efficient updates and lookups.

User interface enhancements:

  • Updated the Header component to display a "Queries" button only when relevant queries are available for the focused instance, and to handle loading queries on demand when the button is clicked. [1] [2] [3]

@jrmartin jrmartin changed the title #VFB-226 - Enhance query validation and improve query handling in fro… #VFB-226 - Enhance query validation and improve query handling in frontend components Jan 13, 2026
@jrmartin jrmartin marked this pull request as draft January 13, 2026 17:13
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9f9a60f4b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9f9a60f4b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jrmartin jrmartin requested a review from ddelpiano January 15, 2026 00:16
@jrmartin jrmartin changed the title #VFB-226 - Enhance query validation and improve query handling in frontend components #VFB-226 - Query flow refactoring and connect top-right corner button to the queries Jan 15, 2026
@jrmartin jrmartin marked this pull request as ready for review January 15, 2026 00:19
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a0ac86cbd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 83 to 84
} catch (error) {
store.dispatch(getQueriesFailure(error.message, short_form))

Choose a reason for hiding this comment

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

P2 Badge Clear loading state on query fetch errors

In the new getQueries flow, the catch path only dispatches GET_QUERIES_FAILURE. The reducer’s failure handler doesn’t reset isLoading, so any thrown error (e.g., network outage or invalid JSON) leaves state.queries.isLoading stuck true, and the query UI spinner never clears. Consider dispatching a completion action here or updating the failure reducer to set isLoading: false so error paths unwind correctly.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants