Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added isHosted gate to access homepage from settings, fixed context menu options

Type of Change

  • Bug fix

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 Jan 6, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 6, 2026 10:22pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 6, 2026

Greptile Summary

This PR addresses two UI bugs: context menu divider display and self-hosted Home Page button visibility.

Context Menu Fixes:

  • Fixed divider rendering logic in chunk, document, and knowledge base context menus
  • Divider now correctly appears before delete action only when other menu items are present above it
  • Previous logic only checked onToggleEnabled && onDelete, which caused divider to show even when no items were above it in multi-select mode

Settings Modal Fix:

  • Added isHosted gate to conditionally render "Home Page" button in settings
  • Button now only appears for hosted environments (www.sim.ai and staging.sim.ai)
  • Prevents self-hosted users from seeing navigation to public homepage

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Simple conditional rendering changes with clear logic, no behavioral side effects, proper use of existing feature flags, and fixes legitimate UI bugs
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/general/general.tsx Added isHosted gate to conditionally render Home Page button for hosted environments only
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/components/chunk-context-menu/chunk-context-menu.tsx Fixed divider logic before delete action to check for presence of any menu items above it
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/components/document-context-menu/document-context-menu.tsx Fixed divider logic before delete action to check for presence of any menu items above it
apps/sim/app/workspace/[workspaceId]/knowledge/components/knowledge-base-context-menu/knowledge-base-context-menu.tsx Fixed divider logic before delete action to check for presence of any menu items above it

Sequence Diagram

sequenceDiagram
    participant User
    participant Settings as Settings Modal
    participant ContextMenu as Context Menu
    participant FeatureFlags as Feature Flags

    alt Settings Modal Flow
        User->>Settings: Open settings
        Settings->>FeatureFlags: Check isHosted flag
        alt isHosted = true
            FeatureFlags-->>Settings: Return true (hosted environment)
            Settings->>User: Show "Home Page" button
        else isHosted = false
            FeatureFlags-->>Settings: Return false (self-hosted)
            Settings->>User: Hide "Home Page" button
        end
    end

    alt Context Menu Flow
        User->>ContextMenu: Right-click item
        ContextMenu->>ContextMenu: Evaluate menu items availability
        alt Has items above delete
            ContextMenu->>ContextMenu: Check (!isMultiSelect && onOpenInNewTab) OR<br/>(!isMultiSelect && onEdit) OR<br/>(!isMultiSelect && onCopyContent) OR<br/>onToggleEnabled
            ContextMenu->>User: Show divider + delete option
        else No items above delete
            ContextMenu->>User: Show delete option only (no divider)
        end
    end
Loading

@waleedlatif1 waleedlatif1 merged commit d248557 into staging Jan 6, 2026
5 of 6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/cm branch January 6, 2026 22:39
waleedlatif1 added a commit that referenced this pull request Jan 8, 2026
…fixed context menu options (#2694)

* fix(settings): added isHosted gate to access homepage from settings, fixed context menu options

* stronger typing
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