Skip to content

fix: sync client-side secret value visiblity to the type toggle state#941

Merged
nimish-ks merged 2 commits into
mainfrom
fix--cross-env-type-toggle-client-state
Jul 8, 2026
Merged

fix: sync client-side secret value visiblity to the type toggle state#941
nimish-ks merged 2 commits into
mainfrom
fix--cross-env-type-toggle-client-state

Conversation

@rohan-chaturvedi

Copy link
Copy Markdown
Member

🔍 Overview

On the single-env secrets editor, toggling a secret's type immediately updates value visibility — config → revealed, secret → masked, sealed → locked "Sealed" state. On the cross-env editor, the toggle had no visible effect: the change only appeared after deploying and doing a full page refresh.

💡 Proposed Changes

Two client-side fixes in AppSecretRow.tsx:

  • React to type toggles: EnvSecretComponent initialized its reveal state once on mount and never updated it. A new effect syncs visibility when the type changes (config → revealed, secret/sealed → masked), mirroring the single-env SecretRow behavior. It's a change-detector keyed on the previous type, so mount rules (new/empty values start revealed, "Add value" reveals) and boolean secrets are unaffected.
  • Compare server-side state in memo comparators: areAppSecretRowEqual ignored serverAppSecret entirely and areEnvSecretEqual only compared the server value. After a deploy + refetch, only the server copy changes (the client copy already matched), so re-renders were memo-blocked — isSealedAndSaved never activated and rows kept stale state until refresh. Both comparators now also compare server secret id/key/value/type. This also un-sticks the amber "modified" highlight after deploying a type-only change.

📝 Release Notes

  • Fixed: on the cross-env secrets view, changing a secret's type now immediately updates value visibility, and sealed secrets show their locked state right after deploying — no page refresh needed.

✨ How to Test the Changes Locally

  1. Open an app's overview (cross-env) view and expand a secret row.
  2. Toggle the type via the type selector in the key cell: config reveals the value in every environment, secret masks them again — instantly, before deploying.
  3. Set a secret to sealed and hit Deploy: rows switch to the disabled "Sealed" state immediately, without a refresh.

💚 Did You...

  • Ensure linting passes (code style checks)?
  • Verify the app builds locally? (tsc --noEmit clean)
  • Manually test the changes on different browsers/devices?

Signed-off-by: rohan <rohan.chaturvedi@protonmail.com>
@rohan-chaturvedi rohan-chaturvedi added bug Something isn't working frontend Change in frontend code labels Jul 3, 2026
@nimish-ks nimish-ks merged commit 44d5044 into main Jul 8, 2026
15 checks passed
@nimish-ks nimish-ks deleted the fix--cross-env-type-toggle-client-state branch July 8, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend Change in frontend code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants