Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix agent modal scrolling and add edit functionality #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
90stm wants to merge 2 commits into winfunc:main
base: main
Choose a base branch
Loading
from 90stm:fix/agent-modal-scrolling-and-edit

Conversation

@90stm
Copy link

@90stm 90stm commented Aug 7, 2025

Summary

This PR fixes two issues with the Agent Management modal:

  1. Fixes scrolling issue preventing users from viewing all agents (No ability to edit already existing agents #259 )
  2. Adds missing edit functionality for agents (No ability to edit already existing agents #259 )

Changes Made

1. Fixed Agent Modal Scrolling

  • Replaced ScrollArea component with native overflow-y-scroll in AgentsModal.tsx
  • Changed container from overflow-hidden to min-h-0 to allow proper scrolling
  • Added max-h-[400px] constraint to ensure scrollbar appears
  • Added custom scrollbar styling for better UX

2. Added Edit Functionality

  • Added Edit button to each agent card in the modal
  • Implemented event system to pass agent data to CreateAgent component
  • Modified CreateAgent component to accept editing data via localStorage
  • Added proper cleanup logic for localStorage
  • Updated tab management to show "Edit: [Agent Name]" when editing

Testing

  • Verified all 11 agents are now visible with working scrollbar
  • Tested edit functionality with existing agents
  • Confirmed agent data properly loads in edit mode
  • Tested creating new agents still works as expected

90stm added 2 commits August 7, 2025 10:33
- Changed overflow-hidden to min-h-0 in AgentsModal to enable proper scrolling
- Added max-h constraint and overflow-y-scroll to agent list container
- Removed conflicting height constraints that prevented scrolling
- Now all agents are visible with proper scrollbar functionality
Fixes issue where users couldn't see all their agents in the modal
- Added Edit button to each agent in the Agent Management modal
- Implemented event system to pass agent data to CreateAgent component
- Modified CreateAgent to accept editing data from localStorage
- Added proper cleanup of localStorage after editing
Closes winfunc#259 - Users can now edit existing agents
Copy link
Member

@claude please review this

claude[bot] reacted with eyes emoji

Copy link

claude bot commented Oct 10, 2025
edited
Loading

Claude encountered an error —— View job

Failed with exit code 128

I'll analyze this and get back to you.

Copy link
Member

@claude please review this

claude[bot] reacted with eyes emoji

Copy link

claude bot commented Oct 10, 2025
edited
Loading

Claude encountered an error —— View job

Failed with exit code 128

I'll analyze this and get back to you.

Copy link
Member

Hi, thanks for the PR. I just ran it through claude. Can you take a look at these suggestions?

  1. Remove localStorage, use React Context or Props

    // Better approach: Use a shared context or props
    interface EditAgentContextType {
     editingAgent: Agent | null;
     setEditingAgent: (agent: Agent | null) => void;
    }
    const EditAgentContext = createContext<EditAgentContextType>(/* ... */);
  2. Add Error Handling

    // Wrap JSON.parse in try-catch
    try {
     const stored = window.localStorage.getItem('editingAgent');
     if (stored) {
     return JSON.parse(stored);
     }
    } catch (error) {
     console.error('Failed to parse editing agent data:', error);
     // Clear corrupted data
     window.localStorage.removeItem('editingAgent');
    }
  3. Remove Arbitrary Timeouts

    • Use proper React lifecycle methods instead of setTimeout
    • If tab update is async, use callbacks or promises
  4. Type Custom Events

    // Create typed event definitions
    interface OpenEditAgentTabEvent extends CustomEvent {
     detail: {
     agent: Agent;
     };
    }
    declare global {
     interface WindowEventMap {
     'open-edit-agent-tab': OpenEditAgentTabEvent;
     }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /