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

proper removal of previous entries #125

Merged
merged 2 commits into from
Nov 5, 2023
Merged

proper removal of previous entries #125

merged 2 commits into from
Nov 5, 2023

Conversation

mruwnik
Copy link
Collaborator

@mruwnik mruwnik commented Nov 4, 2023

This is mainly a lot of reshuffling of the code. The previous code would display a history of previous interactions, each of which could be deleted, but this wouldn't have any effect on the current search. Which was annoying when you wanted to delete the last response and try again - it would delete it, but then you'd still have to copy your search phrase over.
Now when the last item is deleted, it will return to editing the previous query

session_id = request.json.get('sessionId')
history = request.json.get('history', [])
settings = request.json.get('settings', {})

if query is None:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this allows querying by:

  • just a query string
  • a query string + history
  • just history (as the last item is going to be the query)

web/src/components/chat.tsx Show resolved Hide resolved
web/src/components/chat.tsx Outdated Show resolved Hide resolved
setQuery(v);
onQuery && onQuery(v);
}}
abortSearch={() => controller.abort()}

Choose a reason for hiding this comment

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

if multiple things are started (e.g. <Followups onClick={...}>, you only want to abort the last one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

you're right - fixed

web/src/pages/semantic.tsx Outdated Show resolved Hide resolved
@mruwnik mruwnik merged commit be895a4 into main Nov 5, 2023
1 check passed
@mruwnik mruwnik deleted the proper-removal branch November 5, 2023 22:47
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