Skip to content
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

Ensure shared assistants accessible via query params #2740

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

pablonyx
Copy link
Contributor

@pablonyx pablonyx commented Oct 9, 2024

Description

[Provide a brief description of the changes in this PR]

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Accepted Risk

[Any know risks or failure modes to point out to reviewers]

Related Issue(s)

[If applicable, link to the issue(s) this PR addresses]

Checklist:

  • All of the automated tests pass
  • All PR comments are addressed and marked resolved
  • If there are migrations, they have been rebased to latest main
  • If there are new dependencies, they are added to the requirements
  • If there are new environment variables, they are added to all of the deployment methods
  • If there are new APIs that don't require auth, they are added to PUBLIC_ENDPOINT_SPECS
  • Docker images build and basic functionalities work
  • Author has done a final read through of the PR right before merge

Copy link

vercel bot commented Oct 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 9, 2024 6:40pm

@pablonyx pablonyx marked this pull request as ready for review October 9, 2024 18:39
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR ensures shared assistants are accessible via query parameters by updating the ChatPage component and fetchChatData function.

  • Modified web/src/app/chat/ChatPage.tsx to improve assistant selection logic
  • Updated web/src/lib/chat/fetchChatData.ts to handle shared and hidden assistants correctly
  • Changes affect how assistants are displayed and used in the chat interface
  • Improves accessibility of shared assistants through query parameters

2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings

Comment on lines 697 to 699
setSelectedAssistant(
finalAssistants.find((persona) => persona.id === defaultAssistantId)
availableAssistants.find((persona) => persona.id === defaultAssistantId)
);
Copy link

Choose a reason for hiding this comment

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

logic: Changing from finalAssistants to availableAssistants might include assistants that were previously filtered out. Verify this is the intended behavior.

);
}
}, [defaultAssistantId, finalAssistants, messageHistory.length]);
}, [defaultAssistantId, availableAssistants, messageHistory.length]);
Copy link

Choose a reason for hiding this comment

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

style: The dependency array now includes availableAssistants instead of finalAssistants. Ensure this doesn't cause unnecessary re-renders.

@Weves Weves added this pull request to the merge queue Oct 10, 2024
Merged via the queue into main with commit b4417fa Oct 10, 2024
7 checks passed
@pablonyx pablonyx deleted the assistant_query_params branch October 17, 2024 23:14
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