Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added permissions to workspace popover
  • added kb popover to view tags, edit description and kb name

Type of Change

  • Bug fix
  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Dec 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Dec 30, 2025 2:50am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 30, 2025

Greptile Summary

This PR enhances knowledge base management by adding context menu interactions with edit, delete, and tag viewing capabilities. The implementation replaces the previous Link-based navigation with an interactive card that supports right-click context menus while maintaining keyboard accessibility.

Key changes:

  • Converted BaseCard from Link wrapper to interactive div with role="button" and keyboard handlers
  • Added three new modal components: EditKnowledgeBaseModal, DeleteKnowledgeBaseModal, and KnowledgeBaseContextMenu
  • Implemented API integration for PUT and DELETE operations on knowledge bases
  • Added permission checks using userPermissions.canEdit to disable edit/delete actions appropriately
  • Updated workspace header to use captured workspace permissions instead of context provider for menu actions
  • All new components follow established patterns with proper TypeScript interfaces and TSDoc comments

Confidence Score: 4/5

  • This PR is safe to merge with minor considerations around error handling
  • The implementation is solid with proper permission checks, API integration, and follows established patterns. The score reflects good code quality with proper error handling in modals and API calls. The main consideration is that the BaseCard component has grown significantly in complexity, but this is acceptable given the new interactive features.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/knowledge/components/base-card/base-card.tsx Converted Link-based card to interactive div with context menu, added edit/delete/tags modals with permission checks
apps/sim/app/workspace/[workspaceId]/knowledge/knowledge.tsx Added update and delete handlers that call API endpoints and update store, passed handlers to BaseCard components
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsx Replaced context provider with captured workspace permissions for menu actions

Sequence Diagram

sequenceDiagram
    participant User
    participant BaseCard
    participant ContextMenu
    participant EditModal
    participant DeleteModal
    participant TagsModal
    participant API
    participant Store

    User->>BaseCard: Right-click card
    BaseCard->>ContextMenu: Open context menu
    
    alt Edit Knowledge Base
        User->>ContextMenu: Click "Edit"
        ContextMenu->>EditModal: Open modal with initial data
        User->>EditModal: Update name/description
        EditModal->>API: PUT /api/knowledge/{id}
        API-->>EditModal: Success response
        EditModal->>Store: updateKnowledgeBase(id, updates)
        EditModal->>BaseCard: Trigger refreshList()
        BaseCard-->>User: Display updated card
    end
    
    alt Delete Knowledge Base
        User->>ContextMenu: Click "Delete"
        ContextMenu->>DeleteModal: Open confirmation modal
        User->>DeleteModal: Confirm delete
        DeleteModal->>API: DELETE /api/knowledge/{id}
        API-->>DeleteModal: Success response
        DeleteModal->>Store: removeKnowledgeBase(id)
        DeleteModal-->>User: Card removed from view
    end
    
    alt View Tags
        User->>ContextMenu: Click "View tags"
        ContextMenu->>TagsModal: Open with knowledgeBaseId
        TagsModal-->>User: Display tags interface
    end
    
    alt Open in New Tab
        User->>ContextMenu: Click "Open in new tab"
        ContextMenu->>User: Opens KB page in new tab
    end

Loading

@waleedlatif1 waleedlatif1 merged commit 97a9295 into staging Dec 30, 2025
11 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/workspace-popover branch December 30, 2025 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants