## Problem
In the Edge Function Edit secret sheet, a long secret value (for example
a multi-line private key) made the Value textarea grow without a limit.
On smaller screens this pushed the Cancel and Save buttons out of view,
so the secret couldn't be saved.
Fixes
[FE-4680](https://linear.app/supabase/issue/FE-4680/cannot-save-long-edge-function-secrets-on-smaller-screens).
## Solution
- Replace the hand-rolled auto-resize `Textarea` with the shared
`ExpandingTextArea`, the same component the Add new secrets form uses.
It grows with its content up to 320px, then scrolls inside itself.
- Make the sheet body the scroll area (`grow min-h-0 overflow-y-auto`),
so the footer with Cancel and Save stays visible on short windows.
- Move the show/hide (eye) toggle to `right-3 top-2` to match the add
form, and add right padding so it stays clear of the textarea's
scrollbar.
- Add a test that pastes a long multi-line value and checks that Save
becomes enabled.
## Review instructions
1. Open Edge Functions > Secrets and click Edit on any secret.
2. Paste a very long multi-line value into the Value field.
3. Confirm the field stops growing at about 320px and scrolls
internally.
4. Shrink the browser window height and confirm Cancel and Save remain
visible and Save is enabled.
5. Confirm the eye toggle doesn't overlap the textarea's scrollbar.
Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.
YES
## What kind of change does this PR introduce?
Right now our tests for API mocking is using vi.mock and mocking that
query or fetch handler. This is not the right approach IMO, 2 years ago
@jordienr added MSW with some very powerful helpers. The idea is to move
component test that rely on API using MSW within ViteTest. Principles
are simple:
- Mock API responses
- Mount your component that uses API responses
- Tests and assert on UI
- Added Skill for Clanker
This pattern is 100 times better than what we have
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Expanded and strengthened test suites for secrets, org lookup, support
flows, OAuth auth, and onboarding; mocks now use contract-backed
responses for more realistic coverage.
* **Documentation**
* Added a comprehensive guide describing a standardized pattern for
component tests that mock network requests.
* **Chores**
* Improved test helpers, typing for API mocks, and test runner
configuration for more reliable and maintainable tests.
<!-- review_stack_entry_start -->
[](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/46439?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>