Skip to content

Improvements to navigation, provider display, and flow process management#25

Merged
asdek merged 4 commits intomasterfrom
24-no-operation-provided
Mar 28, 2025
Merged

Improvements to navigation, provider display, and flow process management#25
asdek merged 4 commits intomasterfrom
24-no-operation-provided

Conversation

@asdek
Copy link
Copy Markdown
Contributor

@asdek asdek commented Mar 28, 2025

Description of the Change

Problem

The application suffers from several UX and stability issues:

  1. Provider selection not working correctly on first login (no default provider selected)
  2. Navigation issues after login (not returning to the previously accessed page)
  3. Missing visual indicators for flow statuses and provider types in the UI
  4. Inconsistent flow and task termination in the backend causing zombie processes
  5. Inefficient listing of flows, tasks, and subtasks without consistent ordering
  6. Sidebar component issues with menu indicators and icon behavior

Solution

  1. Improved login and navigation experience:

    • Added logic to save and restore the previous URL when redirecting to login
    • Changed default navigation paths to "/chat/new" for better user experience
    • Updated navigation handling across the application
  2. Enhanced UI components:

    • Added provider icons (Anthropic, Custom) for better visual identification
    • Fixed issues with the sidebar menu indicator for running flows
    • Fixed visibility behavior of the MoreHorizontal icon in dropdown menus
  3. Improved backend flow management:

    • Added proper task and subtask finishing logic when a flow is terminated
    • Updated SQL queries to properly handle 'waiting' status for subtasks
    • Fixed message chain result handling in providers
    • Added consistent sorting for flows, tasks, and subtasks by ID

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Configuration change
  • 🧪 Test update
  • 🛡️ Security update

Areas Affected

  • Core Services (Frontend UI/Backend API)
  • AI Agents (Researcher/Developer/Executor)
  • Security Tools Integration
  • Memory System (Vector Store/Knowledge Base)
  • Monitoring Stack (Grafana/OpenTelemetry)
  • Analytics Platform (Langfuse)
  • External Integrations (LLM/Search APIs)
  • Documentation
  • Infrastructure/DevOps

Testing and Verification

Test Configuration

PentAGI Version: latest
Docker Version: 28.0.1
Host OS: macOS 15.3.2
LLM Provider: OpenAI, Anthropic, Custom
Enabled Features: [Langfuse, OpenTelemetry]

Test Steps

  1. Log out and then attempt to access a specific chat page
  2. Verify redirect to login followed by return to original URL after successful login
  3. Create new flows with different providers to verify provider icon display
  4. Start multiple flows and verify correct status indicators in the sidebar
  5. Cancel running flows and verify proper cleanup of tasks and subtasks
  6. Test interaction with sidebar menu, verifying correct icon behavior when opening/closing menus
  7. Verify Langfuse and OpenTelemetry integration with monitoring dashboards

Test Results

The application now functions correctly:

  • First-time login automatically selects the first available provider
  • Users are redirected to their intended destination after login
  • Provider icons display correctly in the UI
  • Flow status indicators function properly in the sidebar
  • Canceled flows properly terminate all associated tasks and subtasks
  • Sidebar menu interaction is consistent without visual glitches
  • Monitoring shows proper telemetry data

Security Considerations

No significant security implications. The changes focus on UI improvements, navigation logic, and backend process management without introducing new security concerns.

Performance Impact

These changes improve performance in several ways:

  • Better flow termination prevents orphaned processes in the backend
  • Consistent sorting of flows, tasks, and subtasks improves predictability
  • Fixed handling of message chain results prevents potential memory issues
  • More efficient navigation reduces unnecessary page reloads

Documentation Updates

  • README.md updates
  • API documentation updates
  • Configuration documentation updates
  • GraphQL schema updates
  • Other: Code comments explaining navigation logic and provider icons

Deployment Notes

Checklist

Code Quality

  • My code follows the project's coding standards
  • I have added/updated necessary documentation
  • I have added tests to cover my changes
  • All new and existing tests pass
  • I have run go fmt and go vet (for Go code)
  • I have run npm run lint (for TypeScript/JavaScript code)

Security

  • I have considered security implications
  • Changes maintain or improve the security model
  • Sensitive information has been properly handled

Compatibility

  • Changes are backward compatible
  • Breaking changes are clearly marked and documented
  • Dependencies are properly updated

Documentation

  • Documentation is clear and complete
  • Comments are added for non-obvious code
  • API changes are documented

Additional Notes

The provider icons and flow status indicators are important visual improvements that make the application more intuitive to use. The navigation enhancements significantly improve the user experience, especially for users who are redirected to login from specific pages.

asdek added 4 commits March 29, 2025 00:39
- Updated navigation logic to preserve the current path when redirecting to the login page, allowing users to return to their original location after authentication.
- Adjusted the default route for unauthenticated users to redirect to '/chat/new' instead of '/'.
- Improved provider selection handling in the Chat component to ensure valid providers are used and saved correctly.
- Enhanced the LoginForm to accept a returnUrl prop for better user experience during login.
- Introduced new SVG icons for Anthropic, Custom, and OpenAI.
- Enhanced Breadcrumb component to include BreadcrumbStatus and BreadcrumbProvider for better status and provider representation.
- Added SidebarMenuIndicator to improve user experience in the sidebar.
- Updated ChatSidebar to integrate new breadcrumb features and manage flow indicators effectively.
- Added Finish method to taskWorker to ensure all subtasks are completed before marking the task as finished.
- Introduced Finish method to subtaskWorker to update the status of subtasks upon completion.
- Enhanced flowWorker's Finish method to complete all tasks before finalizing the flow status.
- Implemented sorting for tasks and subtasks in their respective List methods for better organization.
- Updated SQL queries to include 'waiting' status for subtasks to improve data retrieval accuracy.
- Removed unused icon imports to streamline the code.
- Updated TooltipContent in BreadcrumbStatus to display status in lowercase for consistency.
@asdek asdek self-assigned this Mar 28, 2025
@asdek asdek linked an issue Mar 28, 2025 that may be closed by this pull request
@asdek asdek added bug Something isn't working enhancement New feature or request labels Mar 28, 2025
@asdek asdek removed a link to an issue Mar 28, 2025
@asdek asdek merged commit ea52e8e into master Mar 28, 2025
6 checks passed
@asdek asdek deleted the 24-no-operation-provided branch March 28, 2025 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant