-
Notifications
You must be signed in to change notification settings - Fork 5.4k
added sidebar contextual information for firefox #5433
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -474,6 +474,10 @@ async function loadSessionIfExists() { | |
| resumeDiv.innerHTML = `<em>Session resumed: ${sessionData.messages.length} messages loaded</em>`; | ||
| messagesContainer.appendChild(resumeDiv); | ||
|
|
||
| // Load all messages from session | ||
| sessionData.messages.forEach(msg => { | ||
| addMessage(msg.content, msg.role, msg.timestamp); | ||
| }); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this related?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, accidentally added that to the commit
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, so please remove? |
||
|
|
||
| // Update page title with session description if available | ||
| if (sessionData.metadata && sessionData.metadata.description) { | ||
|
|
@@ -509,6 +513,25 @@ messageInput.addEventListener('input', () => { | |
| // Initialize WebSocket connection | ||
| connectWebSocket(); | ||
|
|
||
| // Read 'q' parameter from URL and set it to the message input | ||
| function getQueryParam() { | ||
| const urlParams = new URLSearchParams(window.location.search); | ||
| const queryParam = urlParams.get('q'); | ||
| if (queryParam) { | ||
| messageInput.value = queryParam; | ||
| urlParams.delete('q'); | ||
|
|
||
| let newUrl = window.location.pathname; | ||
| if (urlParams.toString()) { | ||
| newUrl = `${window.location.pathname}?${urlParams.toString()}`; | ||
| } | ||
| window.history.replaceState({}, '', newUrl); | ||
| } | ||
| } | ||
|
|
||
| // Populate query parameter if present | ||
|
michaelneale marked this conversation as resolved.
Outdated
|
||
| getQueryParam(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this means if you reload the page, we put the query into the box again? is that what you want?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in my new pr, it removes the q parameter from the URL so that it wouldn't keep adding the text into the box on reload. open webui does something similar where it submits the message when the q= parameter is included.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is your new PR?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I meant new changes to the current pr
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using the URL class seems cleaner, something like: function getQueryParam() { } |
||
|
|
||
| // Focus on input | ||
| messageInput.focus(); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.