Fix conv list refresh#12
Open
leidaozi wants to merge 2 commits into
Open
Conversation
Fire refresh-conv-list instead of broken load retrigger
htmx.trigger('#conv-list', 'load') in newConversation() and
sendMessage() never actually refreshed the sidebar, since 'load'
only fires once and has no listener to catch a manual re-trigger.
Switching both calls to refresh-conv-list uses the new trigger
added in the previous commit, so the sidebar now updates
immediately when a conversation is created.
Add refresh-conv-list trigger to #conv-list hx-trigger="load" only fires once and can't be re-triggered later, so the existing code calling htmx.trigger(elt, 'load') after creating a conversation was a no-op. Adding a second trigger name fixes that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes new conversations not appearing in the sidebar until a full app restart. The #conv-list element used hx-trigger="load", which fires once on initial render and cannot be re-triggered. The existing code called htmx.trigger('#conv-list', 'load') after creating a conversation, which was a silent no-op since 'load' has no persistent listener. Added a second trigger name (refresh-conv-list) that can actually be fired manually, and updated both call sites to use it.
Affected packages
packages/psycherospackages/entity-corepackages/entity-loompackages/launcherChecklist
deno checkpasses for the affected entry pointsdeno lintpasses (templates.ts checked clean; web/js/ is excluded from lint by this repo's own deno.json)deno fmt --checkpasses (templates.ts checked clean; web/js/ is excluded from fmt by this repo's own deno.json)docs/orCLAUDE.mdis updateddeno checkcould not be verified locally. It attempted to resolve type definitions from jsr.io and download a native binary, and neither was reachable in my environment. The change itself is limited to a string literal in an HTML template and two function-call arguments, so it's unlikely to affect type checking, but this was not confirmed directly.Related issues
N/A — found while debugging locally, not filed as a separate issue first.