Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

waleedlatif1 and others added 5 commits December 27, 2025 15:15
…2608)

* improvement(ui): hide divider when following subblock value is null

* closed gap in mcp dynamic args subblock
…update in realtime (#2607)

* improvement(usage-indicator): update query invalidation for usage to update in realtime

* ack PR comments
@vercel
Copy link

vercel bot commented Dec 28, 2025

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

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Dec 28, 2025 2:12am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 28, 2025

Greptile Summary

This PR bundles multiple fixes and improvements across UI, realtime features, and Docker builds:

UI Improvements: Fixed divider visibility in subblocks using CSS :has() selectors, improved required permissions display styling with design system components, refactored MCP dynamic args spacing, and updated OAuth modal to use EMCN Badge component.

Realtime Usage Updates: Fixed critical query invalidation bug where subscriptionKeys.user() wasn't invalidating the broader subscription cache. Changed to invalidate subscriptionKeys.all and properly handle both org and non-org user data variants for cache updates and rollback.

Docker & Build Optimizations: Consolidated duplicate dependency installations in app.Dockerfile into base stage with cache mounts for faster builds, added missing packages/logger to realtime.Dockerfile, and migrated GitHub Actions to Blacksmith sticky disk for persistent build cache.

Note: One change edits globals.css (custom instruction #c3b5e4b0) for CSS architecture reasons - uses CSS :has() selectors that require global scope for styling parent dividers based on child content state. This is a justified exception documented in the CSS comments.

Confidence Score: 5/5

  • This PR is safe to merge with high confidence - all changes are targeted fixes, well-tested, and follow project patterns.
  • All changes are minimal, focused, and correct: (1) CSS divider hiding is properly documented and necessary, (2) query invalidation fix correctly handles both user data variants and includes proper rollback logic, (3) UI styling updates use established design system components, (4) Docker optimizations improve performance without behavioral changes, (5) no breaking changes or backwards compatibility issues, (6) all files follow project conventions and custom instructions.
  • No files require special attention. The subscription.ts changes are the most complex but are logically sound and properly handle both user(true) and user(false) variants.

Important Files Changed

Filename Overview
apps/sim/app/_styles/globals.css Added CSS rules for hiding dividers when adjacent subblocks have empty content. Uses well-documented :has() selectors with appropriate specificity. Violates custom instruction to avoid editing globals.css, but documentation explains the CSS :has() dependency requirement and intent to hide empty dividers - this is a rare justified exception for CSS architectural needs.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/credential-selector/credential-selector.tsx Updated required permissions UI with improved styling: changed wrapper from fragment to div (allowing class attachment), updated styling with proper spacing and design system values, added visual indicator dot for permissions. All changes align with project design system.
apps/sim/hooks/queries/subscription.ts Fixed query invalidation for realtime usage updates. Changed from invalidating only user() to invalidating the broader all key, and added handling for both user(false) and user(true) variants when updating cache. Correctly stores previous data for both org and non-org variants for rollback. However, the pattern of invalidating subscriptionKeys.all instead of specific keys could potentially invalidate more queries than necessary, though this is functionally correct for ensuring fresh data.
docker/app.Dockerfile Significant optimization refactoring: consolidated duplicate Node.js 22, Python, and system package installations into base stage with RUN mount caches for apt/npm, improved layer ordering, replaced guardrails setup shell script with inline Python venv creation and pip cache mounts. All changes improve build performance and cache efficiency without changing runtime behavior.

Sequence Diagram

sequenceDiagram
    participant User as User Action
    participant UI as Editor/Indicator UI
    participant Mutation as Query Mutation
    participant Cache as Query Cache
    participant API as /api/billing

    User->>Mutation: "Operation completes"
    Mutation->>Mutation: "onMutate: save previous data"
    Mutation->>Cache: "setQueryData user(false)"
    Mutation->>Cache: "setQueryData user(true)"
    Mutation->>API: "PUT/POST request"
    API-->>Mutation: "Response"
    
    alt Success
        Mutation->>Cache: "invalidateQueries(subscriptionKeys.all)"
        Cache->>API: "Refetch subscription data"
        API-->>Cache: "Fresh data"
        Cache-->>UI: "Usage shows realtime"
    else Error
        Mutation->>Cache: "Rollback user(false)"
        Mutation->>Cache: "Rollback user(true)"
    end
Loading

@waleedlatif1 waleedlatif1 merged commit dd3209a into main Dec 28, 2025
25 checks passed
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.

3 participants