Skip to content

feat(frontend): add support for adding environments on the overview page#5514

Merged
scott-ray-wilson merged 1 commit intomainfrom
SECRETS-90
Feb 23, 2026
Merged

feat(frontend): add support for adding environments on the overview page#5514
scott-ray-wilson merged 1 commit intomainfrom
SECRETS-90

Conversation

@scott-ray-wilson
Copy link
Contributor

Context

This PR adds the ability to create environments from the overview page.

It also corrects the secret import callback usage to prevent an error on environment addition

Screenshots

CleanShot 2026-02-18 at 17 13 56@2x

Steps to verify the change

  • test adding an environment

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
  • Tested locally
  • Updated docs (if needed)
  • Read the contributing guide

@linear
Copy link

linear bot commented Feb 19, 2026

@maidul98
Copy link
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 19, 2026

Greptile Summary

This PR adds the ability to create environments directly from the overview page's environment selector dropdown. This is a UX improvement that prevents users from having to navigate to the settings page to add environments.

Key changes:

  • Integrated AddEnvironmentModal into the environment dropdown with proper permission checks (ProjectPermissionActions.Create on ProjectPermissionSub.Environments)
  • Added subscription limit validation to show upgrade prompt when environment limit is reached
  • Fixed a critical React Hooks violation in useGetImportedSecretsAllEnvs where useCallback was being called inside a map function
  • The fix ensures the sourceEnv is correctly passed through by restructuring the query function to return both data and env
  • Adjusted spacing in CommandEmpty component for better visual consistency

The implementation follows existing patterns used in EnvironmentTabs and EnvironmentSection for permission checks and modal integration.

Confidence Score: 4/5

  • This PR is safe to merge with minimal risk - it adds new functionality without breaking existing features
  • The changes are well-structured and follow existing patterns in the codebase. The React Hooks fix is important and correct. The only minor concern is the use of an undocumented alwaysRender prop on CommandSeparator, which may not have any effect but doesn't appear to cause runtime errors.
  • No files require special attention - all changes are straightforward improvements

Important Files Changed

Filename Overview
frontend/src/components/v3/generic/Command/Command.tsx Reduced vertical padding in CommandEmpty from py-6 to py-2.5 for better spacing
frontend/src/hooks/api/secretImports/queries.tsx Fixed React Hooks violation by moving useCallback outside the map function, also passed env through queryFn to ensure correct sourceEnv assignment
frontend/src/pages/secret-manager/OverviewPage/components/EnvironmentSelect/EnvironmentSelect.tsx Added ability to create new environments from the dropdown with permission checks, subscription limits, and upgrade prompts. Includes query refetch after environment creation

Last reviewed commit: e0cb95a

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.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@scott-ray-wilson scott-ray-wilson merged commit 4f26c25 into main Feb 23, 2026
8 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