Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/FORKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ The deployment automatically detects your repository name and sets the correct b

## Supabase Setup

While Supabase env vars are unset, you'll see a yellow "Setup required" banner on every page of the running app. This is intentional — it disappears automatically once `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY` are populated. The banner is also dismissible via the × button if you want to focus on non-Supabase features first.

### 1. Create Supabase Project

1. Go to [supabase.com](https://supabase.com) and create a new project
Expand Down
13 changes: 12 additions & 1 deletion src/components/SetupBanner/SetupBanner.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,21 @@ describe('SetupBanner', () => {
const link = screen.getByText('View setup guide');
expect(link).toHaveAttribute(
'href',
'https://github.com/TortoiseWolfe/ScriptHammer#supabase-setup'
'https://github.com/TortoiseWolfe/ScriptHammer/blob/main/docs/FORKING.md#supabase-setup'
);
});

it('should name both required env vars in default message', () => {
// Fork users seeing the banner need to know exactly which two
// NEXT_PUBLIC_* vars to populate. Pin both names so a future copy
// refactor doesn't drop one.
render(<SetupBanner show={true} />);
expect(screen.getByText(/NEXT_PUBLIC_SUPABASE_URL/)).toBeInTheDocument();
expect(
screen.getByText(/NEXT_PUBLIC_SUPABASE_ANON_KEY/)
).toBeInTheDocument();
});

it('should render setup guide link with custom URL', () => {
render(<SetupBanner show={true} docsUrl="https://custom-docs.com" />);

Expand Down
4 changes: 2 additions & 2 deletions src/components/SetupBanner/SetupBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const STORAGE_KEY = 'supabase_setup_banner_dismissed';
* Auto-detects Supabase configuration status when show prop is not provided.
*/
export function SetupBanner({
message = 'Supabase is not configured. Some features may be unavailable.',
docsUrl = 'https://github.com/TortoiseWolfe/ScriptHammer#supabase-setup',
message = 'Supabase is not configured: set NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY in your .env file.',
docsUrl = 'https://github.com/TortoiseWolfe/ScriptHammer/blob/main/docs/FORKING.md#supabase-setup',
show,
}: SetupBannerProps) {
const [isDismissed, setIsDismissed] = useState(true); // Start hidden to avoid flash
Expand Down
Loading