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.
Here’s a clear, comprehensive set of changes you can paste into your PR description.
Summary
runed
for scroll state & UI reactivity.What changed
Dependencies
Add
runed@^0.34.0
to app dependencies (package.json
/package-lock.json
).runed
peer deps:svelte ^5.7.0
, optional@sveltejs/kit ^2.21.0
.dequal
,esm-env
, andlz-string
as deps.Lockfile flags: several packages switched from
"dev": true
to"devOptional": true
inpackage-lock.json
(e.g.,@sveltejs/kit
,@sveltejs/vite-plugin-svelte
, inspector,cookie
,deepmerge
,devalue
,kleur
,mri
,sade
,set-cookie-parser
,vitefu
).Lockfile cleanups: removed some
"peer": true"
markers (dequal
,lz-string
).Chat UI & interactions
CopyToClipBoardBtn.svelte
~icons/carbon/checkmark
) when copy succeeds.Icon
that toggles between copy and checkmark based onisSuccess
.ChatMessage.svelte
Edit flow:
editedContent
binding.editedContent
directly.Copy button: remove component-local
isCopied
wiring—now relies onCopyToClipBoardBtn
’s internal success feedback.Avatar:
MessageAvatar
becomes sticky (sticky top-4
), slightly larger (size-5
) to improve alignment during streaming.Edit chip:
opacity-0 group-hover:opacity-100
) instead of togglingdisplay
to avoid layout shift.Minor import tidy-ups & derived values (
hasClientThink
, etc.).MessageAvatar.svelte
Animation refactor:
animating
is true; pause on cleanup.<animate>
fill
tofreeze
for consistent frame retention.<filter>
blur with CSS blur (blur-[1.2px]
) for simpler, faster rendering.width
/height
attributes; sizing via class.Scrolling controls (moved to
runed
)ScrollToBottomBtn.svelte and ScrollToPreviousBtn.svelte
Replace manual
ResizeObserver
+scroll
listeners withruned
’sScrollState
.Visibility now derived from arrival state:
!scrollState.arrived.bottom
(offset 200).!scrollState.arrived.top
(offset 100).Removes custom cleanup logic and reduces event wiring.
Navigation & layout
NavMenu.svelte
conversations.length === 0
.ExpandNavigation.svelte
items-center
→items-end
to better line up with sidebar edge.routes/+layout.svelte
text-smd
→text-sm
.ExpandNavigation
inside a relative container next to the nav (absolute … -right-2
), rather than offsetting from grid columns—prevents overlap and improves responsiveness.Settings: models list UX
routes/settings/(nav)/+layout.svelte
Change model entries from clickable
<button>
withgoto()
to<a href>
anchors—improves semantics and supports open-in-new-tab.Introduce masked, fading scroll container (
.masked-overflow
) for the models list:Minor spacing tweaks (e.g., input wrapper padding) and containment (
overflow-hidden
on outer, scroll on inner).Conversation data flow & API
Client-side IDs & tree utilities
Pre-seed UUIDs on the client and send them to the server:
userMessageId
and/orassistantMessageId
viav4()
inroutes/conversation/[id]/+page.svelte
.Tree helpers (
addChildren
,addSibling
):id
on new nodes; otherwise still generate viav4()
.NewNode<T>
now allows an object withid
(Omit<TreeNode<T>, "id"> | TreeNode<T>
).Message updates request
src/lib/utils/messageUpdates.ts
:MessageUpdateRequestOptions
getscreatedMessageIds
.created_message_ids
to the request form data.Server
routes/conversation/[id]/+server.ts
:created_message_ids
in request body (Zod schema).UUID import fix
routes/conversation/[id]/+page.svelte
: changeimport type { v4 }
→import { v4 }
to actually call the function.Rationale
runed
replaces ad‑hoc scroll/observer code with declarative state—less code and fewer edge cases.Testing / QA checklist
Copy to clipboard
Edit flow
Scroll buttons
With long chat content:
New conversation / empty state
Sidebar toggle
Settings models list
Message ID stability
During normal send, retry (assistant), and retry with alternate prompt (user):
Notes / Potential impacts
runed@0.34.0
expectssvelte >= 5.7.0
and optionally@sveltejs/kit >= 2.21.0
; our versions should satisfy this (verify in CI).devOptional
) came from resolver updates; they shouldn’t affect runtime, but call out in case your deploy pipeline treatsoptional
dev deps differently.MessageAvatar
slightly changes the glow; visually similar but less GPU work.Files touched
Dependencies:
package.json
,package-lock.json
Chat UI:
src/lib/components/CopyToClipBoardBtn.svelte
src/lib/components/chat/ChatMessage.svelte
src/lib/components/chat/MessageAvatar.svelte
Scrolling:
src/lib/components/ScrollToBottomBtn.svelte
src/lib/components/ScrollToPreviousBtn.svelte
Navigation/Layout:
src/lib/components/ExpandNavigation.svelte
src/lib/components/NavMenu.svelte
src/routes/+layout.svelte
Settings:
src/routes/settings/(nav)/+layout.svelte
(+ new masked overflow CSS)Data model & API:
src/lib/utils/tree/addChildren.ts
src/lib/utils/tree/addSibling.ts
src/lib/utils/tree/tree.d.ts
src/lib/utils/messageUpdates.ts
src/routes/conversation/[id]/+page.svelte
src/routes/conversation/[id]/+server.ts
If you want, I can condense this into a shorter “Release notes” style section as well.