Skip to content

fix: Collapsible content never renders in controlled mode#8776

Closed
ofried-acutis wants to merge 2 commits intomakeplane:previewfrom
ofried-acutis:fix/collapsible-toggle
Closed

fix: Collapsible content never renders in controlled mode#8776
ofried-acutis wants to merge 2 commits intomakeplane:previewfrom
ofried-acutis:fix/collapsible-toggle

Conversation

@ofried-acutis
Copy link

@ofried-acutis ofried-acutis commented Mar 19, 2026

Summary

The Collapsible component in packages/ui never shows its content when used in controlled mode (isOpen prop). This breaks sub-work items on issue detail pages — clicking the toggle arrow changes the arrow direction but the content never appears.

Root Cause

The Transition component from @headlessui/react with grid-rows-[0fr]/grid-rows-[1fr] animation classes doesn't produce a visible expand/collapse effect, preventing content from rendering.

Fix

Replace Transition with simple conditional rendering ({localIsOpen && <div>...). The grid-rows animation wasn't visually working anyway, so there is no visual regression.

Steps to Reproduce

  1. Create an issue with sub-work items (sub-issues)
  2. Open the issue detail page
  3. Click the sub-work items toggle arrow
  4. Expected: Sub-work items list appears
  5. Actual: Arrow toggles but content never shows

Test Plan

  • Sub-work items collapsible expands and shows content on click
  • Toggling open/closed works correctly
  • Uncontrolled mode (no isOpen prop) still works
  • No TypeScript errors

Summary by CodeRabbit

Release Notes

  • New Features

    • Added entity linking system to connect issues with policies and claims
    • Introduced entity search functionality with real-time query results for quick entity discovery
    • Added entity filtering capability to filter issues based on linked entities
  • UI/UX

    • New entity link panel displays connected entities in issue details
    • Integrated entity search dropdown in issue creation modal
    • Enhanced issue creation flow with entity selection support
  • Translations

    • Updated Spanish language translations across the application

The Transition component with grid-rows-[0fr]/[1fr] animation
prevents collapsible content from appearing. This affects sub-work
items on issue detail pages — clicking the toggle arrow changes
the arrow direction but the content never shows.

Replace Transition with simple conditional rendering. The Transition
animation classes (grid-rows-[0fr] to grid-rows-[1fr]) don't
produce a visible expand/collapse effect, so removing them has no
visual regression while fixing the broken toggle.

Steps to reproduce:
1. Create an issue with sub-work items (sub-issues)
2. Open the issue detail page
3. Click the sub-work items toggle arrow
4. Content never appears despite arrow toggling
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces case entity linking functionality for associating Plane issues with external entities (policies, claims), including backend models, serializers, API endpoints, search/resolution utilities, frontend UI components, and internationalization updates.

Changes

Cohort / File(s) Summary
Database Layer
apps/api/plane/db/models/case_entity_link.py, apps/api/plane/db/migrations/0121_caseentitylink_and_more.py
New Django model and migration for CaseEntityLink, linking issues to external entities with conditional uniqueness constraint for active records.
Serializers
apps/api/plane/app/serializers/case_entity_link.py, apps/api/plane/app/serializers/__init__.py
Added CaseEntityLinkSerializer and CaseEntityLinkCreateSerializer with read-only computed label field and restricted write fields.
API Views & Endpoints
apps/api/plane/app/views/case/entity_link.py, apps/api/plane/app/views/case/entity_search.py, apps/api/plane/app/views/__init__.py, apps/api/plane/app/views/case/__init__.py
New ViewSets and endpoints: CaseEntityLinkViewSet (list/create/update/delete), ResolveEntityEndpoint, and EntitySearchEndpoint with role-based access control and entity resolution logic.
URL Routing
apps/api/plane/app/urls/case_entity_link.py, apps/api/plane/app/urls/__init__.py
New route patterns for entity links, resolution, and search endpoints under issue-scoped paths.
Backend Utilities
apps/api/plane/utils/core_db_resolver.py, apps/api/plane/utils/entity_search.py
Database resolver functions for policy/claim lookups with label computation, and parameterized search utilities using PostgreSQL ILIKE matching.
Backend Infrastructure
.gitattributes, apps/api/plane/db/management/commands/seed_case_config.py, apps/api/plane/db/models/__init__.py
Updated merge driver configuration, new Django management command for seeding case projects/states, and model exports.
Issue Filtering
apps/api/plane/app/views/issue/base.py
Extended IssueViewSet.list to filter issues by entity_id query parameter via entity links.
Frontend Service
apps/web/core/services/case/entity-link.service.ts, apps/web/core/services/case/index.ts
New EntityLinkService with methods for list/create/update/remove/search/resolve operations on entity links.
Frontend Components
apps/web/core/components/cases/entity-link-panel.tsx, apps/web/core/components/cases/entity-search-dropdown.tsx
Display panel for entity links and debounced search dropdown for selecting policies/claims with result prioritization.
Issue Modal Integration
apps/web/core/components/issues/issue-modal/base.tsx, apps/web/core/components/issues/issue-modal/form.tsx, apps/web/core/components/issues/issue-modal/components/default-properties.tsx
Wired entity link creation into issue creation flow; added entity type selector and search dropdown to modal; captures link data for post-creation API call.
Issue UI
apps/web/core/components/issues/peek-overview/properties.tsx, apps/web/ce/components/issues/header.tsx
Added EntityLinkPanel to peek overview properties; updated breadcrumb label to use i18n translation.
Frontend Types
packages/types/src/cases/case-entity-link.ts, packages/types/src/cases/index.ts, packages/types/src/index.ts
New TypeScript types for TCaseEntityLink, TResolvedPolicy, TResolvedClaim, TCaseEntityLinkCreatePayload, TResolvedEntity, and TEntitySearchResult; re-exported through module hierarchy.
Translations
packages/i18n/src/locales/es/translations.ts
Comprehensive Spanish translation updates replacing "elemento(s) de trabajo" with "caso(s)" and adding new preference/navigation keys.
UI Components (Utility)
packages/ui/src/collapsible/collapsible.tsx
Refactored from Headless UI Disclosure to plain React DOM with conditional rendering; improved state initialization logic.
Documentation & Plans
plans/plan.md, plans/keyboard-nav-plan.md, plans/project-case-type-plan.md, plans/work-model-research.md, plans/plane-extensibility-research.md, plans/policy-claims-searching.md
Comprehensive implementation plans and research documentation for case features, keyboard navigation, project structure, work model architecture, and extensibility mechanisms.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Modal as Issue Creation Modal
    participant EntityService as EntityLinkService
    participant API as Backend API
    participant DB as Database

    User->>Modal: Enter issue details & select entity
    Modal->>EntityService: search(type, query)
    EntityService->>API: GET /search-entities?type=policy&q=...
    API->>DB: Query policies via ILIKE
    DB-->>API: Policy results
    API-->>EntityService: {results: [...]}
    EntityService-->>Modal: Search results
    User->>Modal: Select policy from dropdown
    Modal->>Modal: Store entityLink in pending state
    User->>Modal: Submit form to create issue
    Modal->>API: POST /issues/ (issue payload)
    API->>DB: Create Issue
    DB-->>API: Issue with ID
    API-->>Modal: Issue created
    Modal->>EntityService: create(issueId, entity_type, entity_id)
    EntityService->>API: POST /issues/{id}/entity-links/
    API->>API: resolve_entity(entity_type, entity_id)
    API->>DB: Lookup policy/claim detail
    DB-->>API: Entity detail
    API->>DB: Create CaseEntityLink
    DB-->>API: Link created
    API-->>EntityService: Link response
    EntityService-->>Modal: Success
    Modal->>User: Issue created with entity link
Loading
sequenceDiagram
    participant User as User
    participant IssueView as Issue Peek Overview
    participant Panel as EntityLinkPanel
    participant Service as EntityLinkService
    participant API as Backend API
    participant DB as Database

    User->>IssueView: Open issue
    IssueView->>Panel: Mount with issueId
    Panel->>Service: list(workspaceSlug, projectId, issueId)
    Service->>API: GET /issues/{id}/entity-links/
    API->>DB: Query CaseEntityLink records
    DB-->>API: Links with issue_id
    API->>API: Resolve entity details for each link
    API->>DB: Lookup policies/claims
    DB-->>API: Entity details
    API-->>Service: {data: [{entity_type, label, role, detail}]}
    Service-->>Panel: Links array
    Panel->>Panel: Render link list
    Panel-->>User: Display entity links in panel
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 A hop and a link through the policy maze,
Entity resolution brightens our days!
From claims to the web, from search to the store,
Case linking magic opens each door! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: replacing Transition with conditional rendering to fix controlled mode content rendering in the Collapsible component.
Description check ✅ Passed The PR description comprehensively covers the issue, root cause, fix, reproduction steps, and test plan. It maps well to the template's expectations for a bug fix, though Type of Change checkboxes and Screenshots sections were not explicitly completed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can enable review details to help with troubleshooting, context usage and more.

Enable the reviews.review_details setting to include review details such as the model used, the time taken for each step and more in the review comments.

@CLAassistant
Copy link

CLAassistant commented Mar 19, 2026

CLA assistant check
All committers have signed the CLA.

@ofried-acutis ofried-acutis deleted the fix/collapsible-toggle branch March 19, 2026 17:53
@ofried-acutis
Copy link
Author

This PR was opened in error and includes commits that should not have been included. Could a maintainer please delete this PR entirely? It has been replaced by #8777 which contains only the intended fix. Thank you.

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