mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-21 08:15:23 -04:00
[PR #211] [MERGED] Feature/frontend fix #240
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/211
Author: @sirozha
Created: 3/17/2026
Status: ✅ Merged
Merged: 3/17/2026
Merged by: @asdek
Base:
master← Head:feature/frontend-fix📝 Commits (4)
64cc993fix: PAGI-61713b5b5fix: PAGI-64b8b7a2cfix: PAGI-613380d0cMerge branch 'master' into feature/frontend-fix📊 Changes
13 files changed (+666 additions, -686 deletions)
View changed files
📝
frontend/package-lock.json(+26 -2)📝
frontend/src/features/flows/agents/flow-agents.tsx(+33 -23)📝
frontend/src/features/flows/messages/flow-assistant-messages.tsx(+21 -26)📝
frontend/src/features/flows/messages/flow-automation-messages.tsx(+9 -5)📝
frontend/src/features/flows/screenshots/flow-screenshots.tsx(+36 -9)📝
frontend/src/features/flows/tasks/flow-task.tsx(+2 -2)📝
frontend/src/features/flows/tasks/flow-tasks.tsx(+34 -10)📝
frontend/src/features/flows/tools/flow-tools.tsx(+33 -23)📝
frontend/src/features/flows/vector-stores/flow-vector-stores.tsx(+33 -24)➕
frontend/src/hooks/use-auto-scroll.ts(+127 -0)➖
frontend/src/hooks/use-chat-scroll.ts(+0 -166)📝
frontend/src/lib/apollo.ts(+309 -394)📝
frontend/src/providers/flow-provider.tsx(+3 -2)📄 Description
Description of the Change
Problem
Critical data inconsistency bugs when working with multiple flows:
PAGI-61: Cache pollution between flows
PAGI-64: Excessive re-renders in task list
Solution
Apollo Client Architecture Refactoring:
apollo.tswith clear separation of concerns: constants, types, pure utilities, link helpersAuto-scroll State Isolation:
useAutoScrollhook with flow-specific state tracking viaresetKeyparameteruse-chat-scrollthat didn't properly reset state between flowsOptimized Re-rendering:
FinishedandFailedstatusesCloses PAGI-61, PAGI-64
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
Test Results
npm run lintpassedSecurity Considerations
No Security Impact:
Performance Impact
Improvements:
Testing:
Documentation Updates
Deployment Notes
No Special Requirements:
Deployment Steps:
docker compose build frontenddocker compose up -dBackward Compatibility:
Checklist
Code Quality
go fmtandgo vet(for Go code)npm run lint(for TypeScript/JavaScript code)Security
Compatibility
Documentation
Additional Notes
Key Changes by Category
Cache Isolation Fix (PAGI-61)
Root Cause:
When users created multiple flows and switched between them without page refresh, Apollo Client cache was not properly isolating data by flow ID. This caused:
File:
frontend/src/lib/apollo.tsGRAPHQL_ENDPOINT,ASSISTANT_LOG_TYPENAME, cache settingsStreamingLogEntry,SubscriptionActionconcatStrings,resolveSubscriptionAction,isSubscriptionOperationcreateInterceptLinkfor cleaner subscription handlingState Isolation via Auto-scroll Rewrite (PAGI-61)
Old Hook Issues (
use-chat-scroll):New Hook:
frontend/src/hooks/use-auto-scroll.tsresetKeyparameter (typically flow ID) to reset stateComponents Migrated (7 files):
flow-agents.tsx- Agent execution listflow-assistant-messages.tsx- AI assistant conversationsflow-automation-messages.tsx- System automation logsflow-screenshots.tsx- Screenshot galleryflow-tasks.tsx- Task list viewflow-tools.tsx- Tool execution resultsflow-vector-stores.tsx- Vector store operationsRe-render Optimization (PAGI-64)
File:
frontend/src/features/flows/tasks/flow-task.tsxStatusType.Finishedsubtasks for completionStatusType.FinishedandStatusType.FailedReproduction Steps (Before Fix)
To reproduce the original bugs:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.