Skip to content

Feat/env var form layout#4269

Closed
logical-tech wants to merge 5 commits intoDokploy:canaryfrom
logical-tech:feat/env-var-form-layout
Closed

Feat/env var form layout#4269
logical-tech wants to merge 5 commits intoDokploy:canaryfrom
logical-tech:feat/env-var-form-layout

Conversation

@logical-tech
Copy link
Copy Markdown

@logical-tech logical-tech commented Apr 21, 2026

What is this PR about?

Added a toggle in the env editors to toggle between code editor and vercel style editor for env variables.
Pasting a copied env file content will automatically populate env variables
Variables can be reordered just by dragging

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related (if applicable)

none

Screenshots (if applicable)

Without anything inside
Screenshot 2026-04-21 alle 09 25 52

After pasting the .env.example
Screenshot 2026-04-21 alle 09 26 02

Reordering
Screenshot 2026-04-21 alle 09 26 14

Greptile Summary

This PR adds a new EnvEditor component that wraps the existing CodeEditor and introduces a toggleable rows-based view (Vercel-style) with drag-to-reorder and smart paste. The component replaces the raw CodeEditor in both project-environment.tsx and secrets.tsx.

  • Raw editor disabled on first load: isObscured defaults to true, which also sets disabled={isObscured || disabled} on the raw CodeEditor. Any user with write access will find the raw editor completely uneditable until they click the eye toggle — a clear regression from the previous behaviour.
  • Paste interception breaks values containing =: looksLikeEnvPaste returns true for any single-line text that includes =, so pasting a URL with query params, a Base64 string, or similar into a VALUE field will be silently intercepted and split on = instead of inserted as a literal string.
  • Silent data loss on round-trip: parseEnv strips surrounding quotes from values but serializeRows never re-adds them, permanently altering quoted values (e.g. those containing spaces) after one save in rows mode.

Confidence Score: 2/5

Not safe to merge — three P1 defects will affect all users of the new component.

Three distinct P1 issues exist in the new EnvEditor: the raw editor is disabled on first load blocking normal editing, single-line paste interception corrupts values containing =, and a parse/serialize asymmetry silently drops quotes from values causing data loss. All three are present on the changed code path and will affect real users.

apps/dokploy/components/ui/env-editor.tsx requires attention on the default isObscured state, looksLikeEnvPaste logic, and the parseEnv/serializeRows quote handling.

Reviews (1): Last reviewed commit: "feat: replace CodeEditor with EnvEditor ..." | Re-trigger Greptile

Greptile also left 3 inline comments on this PR.

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 21, 2026
Comment thread apps/dokploy/components/ui/env-editor.tsx Outdated
Comment thread apps/dokploy/components/ui/env-editor.tsx
Comment thread apps/dokploy/components/ui/env-editor.tsx
logical-tech and others added 3 commits April 21, 2026 09:44
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants