Skip to content

feat(environment): Add option to assign colors to environments#3797

Open
jirkavrba wants to merge 4 commits intoDokploy:canaryfrom
jirkavrba:feat/environment-color
Open

feat(environment): Add option to assign colors to environments#3797
jirkavrba wants to merge 4 commits intoDokploy:canaryfrom
jirkavrba:feat/environment-color

Conversation

@jirkavrba
Copy link
Contributor

@jirkavrba jirkavrba commented Feb 25, 2026

What is this PR about?

This PR adds an option to assign color to specific environment. This makes it clear that you're working for example on a production environment.

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)

Screenshots (if applicable)

Here's a video:
dokploy-environments.webm


Environment without a color:
image

Environment with a red color assigned to it:
image

Dialog for selecting colors:

Screenshot from 2026-02-24 20-51-55

Greptile Summary

Adds optional color field to environments with UI selector and visual indicator.

Changes:

  • Database schema: Added nullable color text column to environment table
  • API: Extended create, update, and duplicate endpoints to accept optional color parameter
  • UI: Added ColorSelector component with 7 preset colors (blue, red, yellow, green, teal, purple, pink) and "no color" option
  • Display: Environment cards now show colored background when color is assigned
  • Router fix: Improved default environment update logic to allow color/description changes without requiring name change

Issue found:

  • Duplicate operation missing color field - duplicated environments won't preserve the original's color

Confidence Score: 4/5

  • Safe to merge with one bug fix needed for duplicate functionality
  • The PR implements a straightforward feature with proper database migration, schema validation, and UI components. One logic bug exists where the duplicate function doesn't copy the color field, and there's a minor UI inconsistency in the color selector. The database migration is simple and safe (adding nullable column). Tests were updated to reflect schema changes.
  • apps/dokploy/components/dashboard/project/advanced-environment-selector.tsx - fix missing color in duplicate function

Last reviewed commit: b9014cf

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.

9 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@jirkavrba jirkavrba marked this pull request as draft February 26, 2026 19:06
@jirkavrba jirkavrba marked this pull request as ready for review February 26, 2026 19:06
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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@jirkavrba jirkavrba force-pushed the feat/environment-color branch from ce1d077 to e2727d7 Compare February 27, 2026 15:24
@jirkavrba jirkavrba marked this pull request as draft March 1, 2026 09:35
@jirkavrba jirkavrba marked this pull request as ready for review March 1, 2026 09:35
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Mar 1, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 1, 2026

Additional Comments (1)

apps/dokploy/components/dashboard/project/advanced-environment-selector.tsx
missing color field in duplicate call - the color won't be copied to the duplicated environment

		const result = await duplicateEnvironment.mutateAsync({
			environmentId: environment.environmentId,
			name: `${environment.name}-copy`,
			description: environment.description || undefined,
			color: environment.color || undefined,
		});

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.

1 participant