Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Description

use getEnv on the client-side when we need to inject vars for docker runtime, fix folder container & removed folder/subfolder creation modals

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Tested manually to ensure environments are read properly, even on the client

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

…runtime, fix folder container & removed folder/subfolder creation modals
@vercel
Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 11:07pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jul 22, 2025 11:07pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR addresses Docker runtime environment variable injection issues and improves the folder management UX. The primary change replaces static env object usage with the dynamic getEnv() function across client-side components to support Docker deployments where environment variables are injected at runtime rather than build time.

The getEnv() function provides universal environment variable access by first attempting to use next-runtime-env (which supports Docker runtime injection) and falling back to process.env when needed. This change affects critical components including socket connections, authentication, deployment modals, file selectors, and various workflow utilities that rely on NEXT_PUBLIC_* variables.

Additionally, the PR introduces significant UX improvements to folder management by removing modal dialogs for folder/subfolder creation and implementing automatic name generation using incremental patterns ("Folder 1", "Folder 2", etc.). A new centralized naming utility (lib/naming.ts) consolidates naming logic for workspaces, folders, and workflows, while maintaining creative naming for workflows using adjective-noun combinations.

Minor CSS fixes were also included to improve text truncation in folder and workflow items by adding min-w-0 classes to flex containers.

Confidence score: 2/5

• This PR has architectural inconsistencies that could cause environment variable issues in Docker deployments
• The env.ts file reverts experimental runtime environment configuration to use process.env directly, contradicting the PR's goal of Docker runtime support
• Files that need more attention: lib/env.ts (inconsistent runtime configuration), lib/naming.ts (new centralized utility needs review), and components using getEnv() to ensure proper fallback behavior

21 files reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

@delve-auditor
Copy link

delve-auditor bot commented Jul 22, 2025

No security or compliance issues detected. Reviewed everything up to 061d2e3.

Security Overview
  • 🔎 Scanned files: 22 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► naming.ts
    Add utility functions for generating names
► deploy-modal.tsx
    Update environment variable usage
► file-selector-input.tsx
    Update environment variable usage
► folder-context-menu.tsx
    Simplify folder creation flow
► create-menu.tsx
    Streamline folder creation process
Refactor ► env.ts
    Refactor environment variable handling
► folder-item.tsx
    Improve folder name display styling
► workflow-item.tsx
    Improve workflow name display styling

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@vercel vercel bot temporarily deployed to Preview – docs July 22, 2025 23:04 Inactive
@waleedlatif1 waleedlatif1 merged commit a217dac into staging Jul 22, 2025
5 of 6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/d branch July 23, 2025 18:27
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
…rs for docker runtime, fix folder container & removed folder/subfolder creation modals (simstudioai#751)

* use getEnv on the client-side when we need to inject vars for docker runtime, fix folder container & removed folder/subfolder creation modals

* consolidated naming utils

* additional type safety
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