feat: Fix Web UI re-rendering and scroll position loss#114
Merged
Conversation
**Problem**: - SSE events triggered full page re-renders, causing scroll position loss - All server cards were destroyed and recreated on any data update - Similar issues across Servers, Secrets, Tool Calls, and Repositories views - Jarring UX with flickering and jumping content **Solution**: 1. **Smart Data Merging in Servers Store**: - Implemented `mergeServers()` function to update server objects in-place - Preserves object references to prevent unnecessary component re-renders - Added silent background refresh mode to avoid loading states during SSE updates - Uses Object.assign for efficient property updates 2. **Vue Best Practices**: - Added `TransitionGroup` components for smooth list animations - Implemented `v-memo` directive on ServerCard to skip re-renders when props unchanged - Used stable, unique keys for all list items (server.name, secret_ref.name, call.id) - Background data updates no longer show loading spinners 3. **Smooth CSS Transitions**: - Added enter/leave/move animations for all list components - Fade and scale effects for adding/removing items - Cubic bezier timing functions for smooth, professional animations 4. **Views Updated**: - Servers.vue: TransitionGroup with v-memo optimization - Secrets.vue: TransitionGroup for secrets and env vars - ToolCalls.vue: Stable keys with preserved expanded state - Repositories.vue: TransitionGroup for search results **Benefits**: - ✅ Scroll position maintained during SSE updates - ✅ Individual cards update without full page re-render - ✅ Smooth animations when servers added/removed - ✅ Reduced flickering and jumping content - ✅ Better performance with large server lists - ✅ Improved overall UX 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
📦 Build Artifacts for PR #114Version: Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 18980085294 --repo smart-mcp-proxy/mcpproxy-go
# Or download a specific artifact:
gh run download 18980085294 --name dmg-darwin-arm64
|
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
This PR fixes the jarring Web UI experience where pages lose scroll position and flash/jump during updates. The issue was caused by SSE events triggering full array replacements in the store, which caused Vue to destroy and recreate all components.
Problem
Solution
1. Smart Data Merging in Servers Store
mergeServers()function that updates server objects in-placefetchServers(true)) to skip loading states during SSE updatesObject.assign()for efficient property updatesKey changes in
stores/servers.ts:2. Vue Best Practices
3. Smooth CSS Transitions
Added professional enter/leave/move animations:
4. Files Modified
src/stores/servers.ts- Smart merging + silent refresh modesrc/views/Servers.vue- TransitionGroup + v-memosrc/views/Secrets.vue- TransitionGroup with unique keyssrc/views/ToolCalls.vue- Stable keys for preserved expanded statesrc/views/Repositories.vue- TransitionGroup for search resultssrc/assets/main.css- Smooth transition stylesBenefits
Testing
Visual Improvements
Before:
After:
Implementation Notes
The core insight was to stop replacing arrays and instead update objects in-place. Vue's reactivity system can detect property changes on existing objects without destroying components, as long as we preserve the object references.
The
v-memodirective ensures Vue only re-renders ServerCard when specific props actually change, not just when the parent re-renders.TransitionGroup provides smooth animations during list changes, making the UI feel polished and professional.
🤖 Generated with Claude Code