When using a Shared Environment Variable, creating a non-shared environment variable for one Preview branch hides the shared variable for all preview branches.
Reproduction
Create a Shared Environment Variable: FOO=BAR. Attach it to all environments.
Attach the variable to your project.
Create a non-shared variable in your project. Click “Select custom branch.” Select a valid branch. Set the value to FOO=BAZ.
Build the main preview branch, e.g. main. The build has no value for FOO.
Why I think this is wrong
In (3), I specified that FOO=BAZ only applied to my custom branch. If FOO=BAR had been set as a non-shared environment variable, FOO=BAZ would apply to my custom branch, but FOO=BAR would continue to apply to all other preview builds.
It would be really nice to have that limitation made clearer in the UI. There’s a small strikethrough the shared environment variable at the bottom of the page, but the system should alert the user that they’re about to do something dumb. This broke our app for some users for a week and we had no way to know about it.