Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR implements dynamic loading of "Special Thanks" data from a Supabase-backed API. It adds a new Changes
Sequence DiagramsequenceDiagram
participant Component as SpecialThanks Component
participant Repo as ThanksRepository
participant Client as HonoClient
participant Backend as Backend Handler
participant Supabase as Supabase DB
Component->>Component: onMounted()
Component->>Repo: getSpecialThanks()
Repo->>Client: getSpecialThanks()
Client->>Backend: GET /api/special-thanks
Backend->>Supabase: Query special_thanks table
Supabase-->>Backend: Return rows (name, category, display_order)
Backend->>Backend: Filter by category<br/>(host, mentor, feedback)
Backend-->>Client: Return filtered JSON array
Client->>Client: Normalize response<br/>(validate name & category)
Client-->>Repo: Return ThanksMember[]
Repo-->>Component: Return ThanksMember[]
Component->>Component: Update members state<br/>Set isLoading = false
Component->>Component: Compute hosts/mentors/feedbacks<br/>by category
Component->>Component: Render in template
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/frontend/src/components/SpecialThanks.vue (1)
30-39: Consider showing an error state to users.Currently, errors are only logged to the console. Users will see empty sections with "No entries yet." when the API fails, which may be confusing. Consider adding an error state to inform users when data couldn't be loaded.
Example enhancement
const members = ref<ThanksMember[]>([]); const isLoading = ref(true); +const hasError = ref(false); async function fetchThanksMembers() { try { + hasError.value = false; members.value = await thanksRepository.getSpecialThanks(); } catch (error) { const message = error instanceof Error ? error.message : String(error); console.error('Failed to load special_thanks:', message); + hasError.value = true; } finally { isLoading.value = false; } }Then in the template:
<p v-if="hasError" class="error-text">Failed to load. Please try again later.</p>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/frontend/src/components/SpecialThanks.vue` around lines 30 - 39, The fetchThanksMembers function only logs errors to console and never updates UI state; introduce a reactive error flag (e.g., hasError ref) and set hasError.value = false before the request and hasError.value = true inside the catch block, keep setting isLoading.value = false in finally, and update callers/template to render an error message when hasError is true (e.g., show a "Failed to load. Please try again later." paragraph) so users see a proper error state instead of an empty list; refer to fetchThanksMembers, members, isLoading and add/consume hasError in the component.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/frontend/src/api/supabase.ts`:
- Around line 3-4: The code uses import.meta.env.SUPABASE_URL and
import.meta.env.SUPABASE_ANON_KEY fallbacks which are not available in Vite
client builds; update the logic around supabaseUrl and supabaseAnonKey to only
read the VITE-prefixed variables (supabaseUrl =
import.meta.env.VITE_SUPABASE_URL, supabaseAnonKey =
import.meta.env.VITE_SUPABASE_ANON_KEY) and add a runtime check that throws or
logs a clear error if either VITE variable is missing so consumers of the
Supabase client (references: supabaseUrl, supabaseAnonKey) don't silently get
undefined values.
In `@apps/frontend/src/vite-env.d.ts`:
- Around line 8-9: The declarations SUPABASE_URL and SUPABASE_ANON_KEY in
vite-env.d.ts are misleading because Vite only exposes VITE_-prefixed env vars
to the browser; remove these non-prefixed typings or replace them with
VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY (and update all usages to the VITE_
names) so the type declarations accurately reflect the actual environment
variables exposed by Vite.
---
Nitpick comments:
In `@apps/frontend/src/components/SpecialThanks.vue`:
- Around line 30-39: The fetchThanksMembers function only logs errors to console
and never updates UI state; introduce a reactive error flag (e.g., hasError ref)
and set hasError.value = false before the request and hasError.value = true
inside the catch block, keep setting isLoading.value = false in finally, and
update callers/template to render an error message when hasError is true (e.g.,
show a "Failed to load. Please try again later." paragraph) so users see a
proper error state instead of an empty list; refer to fetchThanksMembers,
members, isLoading and add/consume hasError in the component.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 02cea0b1-7227-4605-a58b-272c87adf093
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (8)
apps/backend/src/index.tsapps/frontend/package.jsonapps/frontend/src/api/honoClient.tsapps/frontend/src/api/supabase.tsapps/frontend/src/api/thanksRepository.tsapps/frontend/src/components/SpecialThanks.vueapps/frontend/src/types/thanks.tsapps/frontend/src/vite-env.d.ts
apps/frontend/src/api/supabase.ts
Outdated
| const supabaseUrl = import.meta.env.VITE_SUPABASE_URL || import.meta.env.SUPABASE_URL; | ||
| const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY || import.meta.env.SUPABASE_ANON_KEY; |
There was a problem hiding this comment.
Non-prefixed env vars won't be available in Vite client builds.
Vite only exposes environment variables prefixed with VITE_ to the browser. The fallbacks import.meta.env.SUPABASE_URL and import.meta.env.SUPABASE_ANON_KEY will always be undefined at runtime in the client.
Proposed fix
-const supabaseUrl = import.meta.env.VITE_SUPABASE_URL || import.meta.env.SUPABASE_URL;
-const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY || import.meta.env.SUPABASE_ANON_KEY;
+const supabaseUrl = import.meta.env.VITE_SUPABASE_URL;
+const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const supabaseUrl = import.meta.env.VITE_SUPABASE_URL || import.meta.env.SUPABASE_URL; | |
| const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY || import.meta.env.SUPABASE_ANON_KEY; | |
| const supabaseUrl = import.meta.env.VITE_SUPABASE_URL; | |
| const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/frontend/src/api/supabase.ts` around lines 3 - 4, The code uses
import.meta.env.SUPABASE_URL and import.meta.env.SUPABASE_ANON_KEY fallbacks
which are not available in Vite client builds; update the logic around
supabaseUrl and supabaseAnonKey to only read the VITE-prefixed variables
(supabaseUrl = import.meta.env.VITE_SUPABASE_URL, supabaseAnonKey =
import.meta.env.VITE_SUPABASE_ANON_KEY) and add a runtime check that throws or
logs a clear error if either VITE variable is missing so consumers of the
Supabase client (references: supabaseUrl, supabaseAnonKey) don't silently get
undefined values.
| readonly SUPABASE_URL?: string; | ||
| readonly SUPABASE_ANON_KEY?: string; |
There was a problem hiding this comment.
Remove non-prefixed env var typings.
SUPABASE_URL and SUPABASE_ANON_KEY without the VITE_ prefix won't be exposed to the browser by Vite. These type declarations are misleading.
Proposed fix
interface ImportMetaEnv {
readonly VITE_API_MODE?: 'tauri' | 'hono';
readonly VITE_HONO_BASE_URL: string;
readonly VITE_SUPABASE_URL?: string;
readonly VITE_SUPABASE_ANON_KEY?: string;
- readonly SUPABASE_URL?: string;
- readonly SUPABASE_ANON_KEY?: string;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| readonly SUPABASE_URL?: string; | |
| readonly SUPABASE_ANON_KEY?: string; | |
| interface ImportMetaEnv { | |
| readonly VITE_API_MODE?: 'tauri' | 'hono'; | |
| readonly VITE_HONO_BASE_URL: string; | |
| readonly VITE_SUPABASE_URL?: string; | |
| readonly VITE_SUPABASE_ANON_KEY?: string; | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@apps/frontend/src/vite-env.d.ts` around lines 8 - 9, The declarations
SUPABASE_URL and SUPABASE_ANON_KEY in vite-env.d.ts are misleading because Vite
only exposes VITE_-prefixed env vars to the browser; remove these non-prefixed
typings or replace them with VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY (and
update all usages to the VITE_ names) so the type declarations accurately
reflect the actual environment variables exposed by Vite.
close #77
Summary by CodeRabbit