Skip to content

feat: Improve Home Screen#38

Merged
StoynovAngel merged 26 commits into
mainfrom
feat/improve-home-screen
Apr 18, 2026
Merged

feat: Improve Home Screen#38
StoynovAngel merged 26 commits into
mainfrom
feat/improve-home-screen

Conversation

@StoynovAngel
Copy link
Copy Markdown
Owner

@StoynovAngel StoynovAngel commented Apr 14, 2026

Summary by CodeRabbit

  • New Features

    • New company discovery flow: select service, view service options, and browse searchable company lists with company cards (logo, type, description, address).
    • Background Blobs toggle added to Accessibility Menu to enable/disable decorative background shapes.
    • Client-side company loading (search + caching) enabled for smoother browsing.
  • Permissions

    • Company listing is now accessible to customers, drivers, company admins, and admins.
  • Localization

    • Home and common copy updated to support the new discovery/search UI.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@StoynovAngel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 46 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 46 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5cfd2a95-6c7d-4bd9-8557-7f980dd385bb

📥 Commits

Reviewing files that changed from the base of the PR and between ca4a90c and da956f9.

⛔ Files ignored due to path filters (1)
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (13)
  • backend/src/test/java/com/angel/autonow/company/CompanyControllerIT.java
  • frontend/package.json
  • frontend/src/components/AccessibilityMenu/AccessibilityMenu.styles.ts
  • frontend/src/components/AccessibilityMenu/AccessibilityMenu.tsx
  • frontend/src/components/BackButton/BackButton.styles.ts
  • frontend/src/components/BackgroundShapes/BackgroundShapes.tsx
  • frontend/src/components/LogoutButton/LogoutButton.styles.ts
  • frontend/src/components/LogoutButton/LogoutButton.tsx
  • frontend/src/navigation/HomeStack.tsx
  • frontend/src/navigation/MainTabs.tsx
  • frontend/src/navigation/navigation.styles.ts
  • frontend/src/screens/BrowseCompanies/BrowseCompaniesScreen.tsx
  • frontend/src/screens/ServiceOptions/ServiceOptionsScreen.tsx
📝 Walkthrough

Walkthrough

Backend expands GET /api/companies access to multiple roles; frontend adds company browsing UI (search, list, cards), related components, types, hooks, theme persistence for a "blobs" background toggle, and navigation/header adjustments.

Changes

Cohort / File(s) Summary
Backend: Authorization
backend/src/main/java/com/angel/autonow/company/CompanyController.java
Changed @PreAuthorize on getAllCompanies() from hasRole('ADMIN')hasAnyRole('ADMIN','CUSTOMER','DRIVER','COMPANY_ADMIN').
API + Query Hook
frontend/src/api/companies.ts, frontend/src/hooks/useCompanies.ts
Added getCompanies() API call and useCompanies() React Query hook using ["companies"] key.
Types
frontend/src/types/api.ts, frontend/src/types/navigation.ts
Added CompanyType union and Company interface; added HomeStackParamList and updated MainTabParamList.
Screens: Service Flow
frontend/src/screens/SelectService/..., frontend/src/screens/ServiceOptions/..., frontend/src/navigation/HomeStack.tsx
Added SelectService, ServiceOptions screens and HomeStack navigator wiring with header behavior.
Screens: Browse Companies
frontend/src/screens/BrowseCompanies/BrowseCompaniesScreen.tsx, .../BrowseCompaniesScreen.styles.ts
New BrowseCompanies screen: fetches companies, filters by serviceType and search, shows loading/error/empty states and CompanyCard list.
Components: UI primitives
frontend/src/components/{GlassCard,CompanyCard,SearchInput,ScreenContainer,BackButton}/*
Added GlassCard, CompanyCard, SearchInput, ScreenContainer, BackButton components and their styles.
Background decorations & accessibility
frontend/src/components/BackgroundShapes/*, frontend/src/components/AccessibilityMenu/*
Added BackgroundShapes component and styles; AccessibilityMenu now exposes a persistent blobs toggle and updated trigger styling.
Styling & Theme tokens
frontend/src/constants/theme.ts, frontend/src/screens/.../*.styles.ts, frontend/src/components/*/*.styles.ts, frontend/src/navigation/navigation.styles.ts
Added glass color tokens, multiple new style factories, and createHeaderTitleStyle; header background hardcoded to #00E8C5.
Store: Theme persistence
frontend/src/stores/themeStore.ts
Added showBlobs boolean to ThemeState, toggleBlobs action, BLOBS_KEY persistence via SecureStore, and hydration for showBlobs.
Localization
frontend/src/constants/locales/en.json, frontend/src/constants/locales/bg.json
Replaced several home keys for service browsing (search/empty messages, serviceTypes) and added common.blobs.
Removed / Renamed Home
frontend/src/screens/Home/HomeScreen.tsx, frontend/src/screens/Home/HomeScreen.styles.ts, frontend/src/navigation/MainTabs.tsx
Removed old Home screen and styles; MainTabs updated to hide tab bar and rename HomeHomeStack.

Sequence Diagram

sequenceDiagram
    actor User
    participant UI as App UI
    participant Screen as BrowseCompaniesScreen
    participant Query as ReactQuery
    participant API as Backend API
    participant ThemeStore
    participant Bg as BackgroundShapes
    participant Access as AccessibilityMenu

    User->>UI: Open app / navigate to BrowseCompanies
    UI->>Screen: mount (params: serviceType)
    Screen->>Query: useCompanies() (queryKey: ["companies"])
    Query->>API: GET /api/companies
    API-->>Query: Company[]
    Query-->>Screen: data / isLoading / error
    Screen->>Screen: filter by serviceType and search
    Screen-->>UI: render CompanyCard list or empty/error/loading

    User->>Access: Toggle blobs
    Access->>ThemeStore: toggleBlobs()
    ThemeStore->>ThemeStore: persist BLOBS_KEY
    ThemeStore-->>Bg: showBlobs updated
    Bg-->>UI: show/hide decorations
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

  • feat: Add initial frontend #33: Introduces/changes navigation.styles.ts and AccessibilityMenu foundations; overlaps with header style and blobs toggle integration.

Poem

🐰
I nibble code beneath the moon,
Blobs appear — a soft cocoon,
Companies list in tidy rows,
Search and toggle — off it goes,
A hop, a patch, the UI glows!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Improve Home Screen' is overly broad and vague. While the PR does make changes to home-related functionality, the actual scope is significantly broader—it includes a complete redesign replacing the old Home screen with a multi-screen service discovery flow, adding background blob animations, accessibility improvements, and comprehensive API/component infrastructure. Consider a more specific title such as 'feat: Add service discovery flow with company browsing' or 'feat: Replace home screen with multi-step service selection UI' to better reflect the substantial architectural changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/improve-home-screen

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/src/components/AccessibilityMenu/AccessibilityMenu.tsx`:
- Around line 83-95: The TouchableOpacity used for the blobs toggle in
AccessibilityMenu should expose switch semantics for screen readers: update the
TouchableOpacity (where toggleBlobs is passed to onPress and showBlobs controls
visuals) to include accessibilityRole="switch" and accessibilityState={{
checked: showBlobs }} so assistive tech announces it as a switch with the
correct checked state; keep existing styles and onPress logic unchanged.

In `@frontend/src/components/BackgroundShapes/BackgroundShapes.tsx`:
- Around line 1-5: The module-level Dimensions.get("window") is fixed at load
time so blob positions won't update on rotation; inside the BackgroundShapes
component replace the top-level const { width: W, height: H } =
Dimensions.get("window") with React Native's useWindowDimensions() hook (import
useWindowDimensions) and compute W and H from that within the component (update
any uses in BackgroundShapes and BackgroundShapes.styles consumers so blob
positions are derived from the hook values), removing the module-scope
Dimensions.get call so the component re-renders and recomputes positions on
window size changes.

In `@frontend/src/navigation/navigation.styles.ts`:
- Around line 8-17: The headerStyle currently hard-codes backgroundColor
("#00E8C5") which breaks theme-driven dark/light contrast; replace that literal
with a theme token by adding a header background (and optionally header
foreground) to the ThemeColors type and use that token in headerStyle (e.g.,
headerStyle.backgroundColor = colors.headerBackground) and keep
createHeaderTitleStyle using colors.headerForeground or colors.text for
consistent contrast; update any related typings/usages (ThemeColors and
createHeaderTitleStyle) so the header colors come from the active theme rather
than a hard-coded value.

In `@frontend/src/screens/Home/HomeScreen.tsx`:
- Around line 57-70: Loading and error branches render only styles.centered and
bypass the themed background; update both Views (the isLoading and error return
blocks) to combine the container background with the centering by using
styles.container along with styles.centered (e.g., pass an array or merged style
to the View) so the themed background/colors.background from styles.container is
preserved while still centering ActivityIndicator and Text; update references
around isLoading, error, styles.centered, and styles.container accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df2dd9e7-1bd8-447d-86ac-6e247acc4ee4

📥 Commits

Reviewing files that changed from the base of the PR and between 9f08420 and 1c232ed.

📒 Files selected for processing (15)
  • backend/src/main/java/com/angel/autonow/company/CompanyController.java
  • frontend/src/api/companies.ts
  • frontend/src/components/AccessibilityMenu/AccessibilityMenu.styles.ts
  • frontend/src/components/AccessibilityMenu/AccessibilityMenu.tsx
  • frontend/src/components/BackgroundShapes/BackgroundShapes.styles.ts
  • frontend/src/components/BackgroundShapes/BackgroundShapes.tsx
  • frontend/src/constants/locales/bg.json
  • frontend/src/constants/locales/en.json
  • frontend/src/hooks/useCompanies.ts
  • frontend/src/navigation/MainTabs.tsx
  • frontend/src/navigation/navigation.styles.ts
  • frontend/src/screens/Home/HomeScreen.styles.ts
  • frontend/src/screens/Home/HomeScreen.tsx
  • frontend/src/stores/themeStore.ts
  • frontend/src/types/api.ts

Comment thread frontend/src/components/AccessibilityMenu/AccessibilityMenu.tsx
Comment thread frontend/src/components/BackgroundShapes/BackgroundShapes.tsx Outdated
Comment thread frontend/src/navigation/navigation.styles.ts Outdated
Comment thread frontend/src/screens/Home/HomeScreen.tsx Outdated
Stoynov added 6 commits April 17, 2026 16:50
Add transparent glass colors for iOS-style liquid glass UI effects.
Use varied border radii per corner for more unpredictable, amorphous forms.
Add keys for service types, selection prompts, and browse options.
- GlassCard: Semi-transparent card with press animation
- BackButton: Positioned back navigation
- ScreenContainer: Screen wrapper with optional blobs
- SearchInput: Styled text input
- CompanyCard: Company info display card
- SelectServiceScreen: Service type selection grid
- ServiceOptionsScreen: Options after selecting service
- BrowseCompaniesScreen: Search and list companies
Replace monolithic HomeScreen with stack-based navigation flow.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (6)
frontend/src/components/BackButton/BackButton.tsx (1)

15-19: Consider accessibility props and a proper back glyph.

TouchableOpacity here has no accessibilityRole/accessibilityLabel, so screen readers will announce just the raw text "< Back". Also, using the ASCII < as a back indicator is visually thinner than the conventional chevron/arrow and can look like stray punctuation. Consider using , , or an icon, and marking the control as a button for assistive tech.

♻️ Suggested refinement
-        <TouchableOpacity onPress={onPress} style={styles.button}>
-            <Text style={styles.text}>{"<"} {label}</Text>
-        </TouchableOpacity>
+        <TouchableOpacity
+            onPress={onPress}
+            style={styles.button}
+            accessibilityRole="button"
+            accessibilityLabel={label}
+            hitSlop={{top: 8, bottom: 8, left: 8, right: 8}}
+        >
+            <Text style={styles.text}>{"‹ "}{label}</Text>
+        </TouchableOpacity>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/BackButton/BackButton.tsx` around lines 15 - 19, In
the BackButton component, improve accessibility and visual affordance by marking
the TouchableOpacity as a button (add accessibilityRole="button") and supplying
an accessibilityLabel (e.g., `${label} back`) and optional accessibilityHint;
replace the ASCII "<" with a proper glyph or icon (e.g., "←", "‹" or a chevron
icon) when rendering the text or use an Icon component, keeping the onPress
handler and styles (styles.button, styles.text) intact so screen readers
announce a clear control and users see a conventional back symbol.
frontend/src/navigation/HomeStack.tsx (1)

24-45: Deduplicate identical options callbacks for ServiceOptions and BrowseCompanies.

Both screens declare the same options shape. Extract a helper to keep them in sync and reduce boilerplate:

♻️ Proposed refactor
+    const serviceHeaderOptions = useMemo(
+        () => ({route}: {route: {params: {serviceType: string}}}) => ({
+            headerShown: true,
+            headerTitle: t(`home.serviceTypes.${route.params.serviceType}`),
+            headerStyle: {backgroundColor: colors.background},
+            headerTintColor: colors.primary,
+            headerShadowVisible: false,
+        }),
+        [colors, t],
+    );
@@
-            <Stack.Screen
-                name="ServiceOptions"
-                component={ServiceOptionsScreen}
-                options={({route}) => ({
-                    headerShown: true,
-                    headerTitle: t(`home.serviceTypes.${route.params.serviceType}`),
-                    headerStyle: {backgroundColor: colors.background},
-                    headerTintColor: colors.primary,
-                    headerShadowVisible: false,
-                })}
-            />
-            <Stack.Screen
-                name="BrowseCompanies"
-                component={BrowseCompaniesScreen}
-                options={({route}) => ({
-                    headerShown: true,
-                    headerTitle: t(`home.serviceTypes.${route.params.serviceType}`),
-                    headerStyle: {backgroundColor: colors.background},
-                    headerTintColor: colors.primary,
-                    headerShadowVisible: false,
-                })}
-            />
+            <Stack.Screen name="ServiceOptions" component={ServiceOptionsScreen} options={serviceHeaderOptions} />
+            <Stack.Screen name="BrowseCompanies" component={BrowseCompaniesScreen} options={serviceHeaderOptions} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/navigation/HomeStack.tsx` around lines 24 - 45, The two
Stack.Screen entries for ServiceOptions and BrowseCompanies both use identical
options callbacks; extract a shared helper function (e.g.,
getServiceHeaderOptions or buildHeaderOptions) that accepts the route (or
serviceType) and returns the options object (headerShown, headerTitle:
t(`home.serviceTypes.${route.params.serviceType}`), headerStyle:
{backgroundColor: colors.background}, headerTintColor: colors.primary,
headerShadowVisible: false), then replace the inline options={({route}) =>
({...})} on both ServiceOptions and BrowseCompanies with
options={getServiceHeaderOptions} (or options={({route}) =>
getServiceHeaderOptions(route)}) to remove duplication and keep behavior
identical.
frontend/src/components/CompanyCard/CompanyCard.tsx (1)

18-20: Optional: add accessibility label to the logo image.

The remote Image has no accessibilityLabel/accessible prop, so screen readers won't announce meaningful context for the company logo. Consider passing the company name:

-                <Image source={{uri: company.logoUrl}} style={styles.image} />
+                <Image
+                    source={{uri: company.logoUrl}}
+                    style={styles.image}
+                    accessible
+                    accessibilityLabel={company.name}
+                />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/CompanyCard/CompanyCard.tsx` around lines 18 - 20, In
CompanyCard, the remote Image rendered when company.logoUrl is truthy lacks
accessibility props; update the JSX that renders Image (the Image with source
{{uri: company.logoUrl}} and style={styles.image}) to include an
accessibilityLabel (e.g., using company.name or `${company.name} logo`) and set
accessible={true} so screen readers announce the logo; ensure company.name is
used defensively (fallback text if missing) when constructing the label.
frontend/src/screens/SelectService/SelectServiceScreen.tsx (1)

13-13: Optional: enforce exhaustiveness against CompanyType.

SERVICE_TYPES is hardcoded. If a new value is added to the CompanyType union in frontend/src/types/api.ts, this list will silently drift out of sync. Consider a compile-time guard:

-const SERVICE_TYPES: CompanyType[] = ["TAXI", "LOGISTICS", "AMBULANCE", "MOVING", "RENTAL"];
+const SERVICE_TYPES = ["TAXI", "LOGISTICS", "AMBULANCE", "MOVING", "RENTAL"] as const satisfies readonly CompanyType[];
+type _Exhaustive = Exclude<CompanyType, (typeof SERVICE_TYPES)[number]> extends never ? true : never;

Or derive it from a single source of truth shared with the backend/types.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/screens/SelectService/SelectServiceScreen.tsx` at line 13,
SERVICE_TYPES is hardcoded and can drift from the CompanyType union; update the
code so SERVICE_TYPES is derived or verified against CompanyType at compile
time: either (a) derive the list from the single source of truth (e.g., import
an enum/object of company types from your shared types and use its values
instead of a hardcoded array) or (b) keep SERVICE_TYPES but add a compile-time
exhaustiveness check by creating a const SERVICE_TYPES array and an
assertNever/assertUnreachable helper that you call with any missing CompanyType
members to force TS to error when CompanyType changes; reference SERVICE_TYPES
and CompanyType when making the change so the compiler enforces synchronization.
frontend/src/screens/BrowseCompanies/BrowseCompaniesScreen.tsx (2)

27-33: Optional: precompute the lowercased query once.

Minor nit — search.trim() is invoked twice and .toLowerCase() runs inside the filter callback per item (acceptable, but readability can improve):

♻️ Proposed refactor
     const filtered = useMemo(() => {
         if (!companies) return [];
         const byType = companies.filter((c) => c.companyType === serviceType);
-        if (!search.trim()) return byType;
-        const query = search.trim().toLowerCase();
+        const query = search.trim().toLowerCase();
+        if (!query) return byType;
         return byType.filter((c) => c.name.toLowerCase().includes(query));
     }, [companies, serviceType, search]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/screens/BrowseCompanies/BrowseCompaniesScreen.tsx` around lines
27 - 33, The memoized filtered computation calls search.trim() and toLowerCase
repeatedly; precompute a single lowercased trimmed query outside the filter to
avoid duplicate work: inside the useMemo for filtered, after the early returns
compute const query = search.trim(); if (!query) return byType; const lowerQuery
= query.toLowerCase(); then use lowerQuery in the byType.filter callback
(referring to companies, serviceType, search, filtered/useMemo to locate the
block).

55-61: Consider a user-friendly error fallback.

Rendering error.message directly surfaces raw error text (potentially from Axios/fetch internals) to end users, which may be untranslated and leak implementation details. Consider showing a localized generic message (e.g., t("common.errorLoading")) and logging the technical details separately.

♻️ Proposed refactor
     if (error) {
         return (
             <ScreenContainer centered>
-                <Text style={styles.errorText}>{error.message}</Text>
+                <Text style={styles.errorText}>{t("common.errorLoading")}</Text>
             </ScreenContainer>
         );
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/screens/BrowseCompanies/BrowseCompaniesScreen.tsx` around lines
55 - 61, The current BrowseCompaniesScreen renders raw error.message inside
<ScreenContainer> which may expose internals; replace the UI text with a
localized generic message (e.g., use t("common.errorLoading") from the i18n
hook) instead of error.message in the component return, and move the technical
details into a diagnostic log (e.g., console.error or the app's error logger)
when handling the error; update the JSX that uses styles.errorText and the error
branch in BrowseCompaniesScreen to show the friendly message while logging the
original error object for debugging.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@frontend/src/components/BackButton/BackButton.tsx`:
- Around line 15-19: In the BackButton component, improve accessibility and
visual affordance by marking the TouchableOpacity as a button (add
accessibilityRole="button") and supplying an accessibilityLabel (e.g., `${label}
back`) and optional accessibilityHint; replace the ASCII "<" with a proper glyph
or icon (e.g., "←", "‹" or a chevron icon) when rendering the text or use an
Icon component, keeping the onPress handler and styles (styles.button,
styles.text) intact so screen readers announce a clear control and users see a
conventional back symbol.

In `@frontend/src/components/CompanyCard/CompanyCard.tsx`:
- Around line 18-20: In CompanyCard, the remote Image rendered when
company.logoUrl is truthy lacks accessibility props; update the JSX that renders
Image (the Image with source {{uri: company.logoUrl}} and style={styles.image})
to include an accessibilityLabel (e.g., using company.name or `${company.name}
logo`) and set accessible={true} so screen readers announce the logo; ensure
company.name is used defensively (fallback text if missing) when constructing
the label.

In `@frontend/src/navigation/HomeStack.tsx`:
- Around line 24-45: The two Stack.Screen entries for ServiceOptions and
BrowseCompanies both use identical options callbacks; extract a shared helper
function (e.g., getServiceHeaderOptions or buildHeaderOptions) that accepts the
route (or serviceType) and returns the options object (headerShown, headerTitle:
t(`home.serviceTypes.${route.params.serviceType}`), headerStyle:
{backgroundColor: colors.background}, headerTintColor: colors.primary,
headerShadowVisible: false), then replace the inline options={({route}) =>
({...})} on both ServiceOptions and BrowseCompanies with
options={getServiceHeaderOptions} (or options={({route}) =>
getServiceHeaderOptions(route)}) to remove duplication and keep behavior
identical.

In `@frontend/src/screens/BrowseCompanies/BrowseCompaniesScreen.tsx`:
- Around line 27-33: The memoized filtered computation calls search.trim() and
toLowerCase repeatedly; precompute a single lowercased trimmed query outside the
filter to avoid duplicate work: inside the useMemo for filtered, after the early
returns compute const query = search.trim(); if (!query) return byType; const
lowerQuery = query.toLowerCase(); then use lowerQuery in the byType.filter
callback (referring to companies, serviceType, search, filtered/useMemo to
locate the block).
- Around line 55-61: The current BrowseCompaniesScreen renders raw error.message
inside <ScreenContainer> which may expose internals; replace the UI text with a
localized generic message (e.g., use t("common.errorLoading") from the i18n
hook) instead of error.message in the component return, and move the technical
details into a diagnostic log (e.g., console.error or the app's error logger)
when handling the error; update the JSX that uses styles.errorText and the error
branch in BrowseCompaniesScreen to show the friendly message while logging the
original error object for debugging.

In `@frontend/src/screens/SelectService/SelectServiceScreen.tsx`:
- Line 13: SERVICE_TYPES is hardcoded and can drift from the CompanyType union;
update the code so SERVICE_TYPES is derived or verified against CompanyType at
compile time: either (a) derive the list from the single source of truth (e.g.,
import an enum/object of company types from your shared types and use its values
instead of a hardcoded array) or (b) keep SERVICE_TYPES but add a compile-time
exhaustiveness check by creating a const SERVICE_TYPES array and an
assertNever/assertUnreachable helper that you call with any missing CompanyType
members to force TS to error when CompanyType changes; reference SERVICE_TYPES
and CompanyType when making the change so the compiler enforces synchronization.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aef8cf8f-426d-46f5-8562-de1baa668196

📥 Commits

Reviewing files that changed from the base of the PR and between 1c232ed and ca4a90c.

📒 Files selected for processing (25)
  • frontend/src/components/BackButton/BackButton.styles.ts
  • frontend/src/components/BackButton/BackButton.tsx
  • frontend/src/components/BackgroundShapes/BackgroundShapes.tsx
  • frontend/src/components/CompanyCard/CompanyCard.styles.ts
  • frontend/src/components/CompanyCard/CompanyCard.tsx
  • frontend/src/components/GlassCard/GlassCard.styles.ts
  • frontend/src/components/GlassCard/GlassCard.tsx
  • frontend/src/components/ScreenContainer/ScreenContainer.styles.ts
  • frontend/src/components/ScreenContainer/ScreenContainer.tsx
  • frontend/src/components/SearchInput/SearchInput.styles.ts
  • frontend/src/components/SearchInput/SearchInput.tsx
  • frontend/src/constants/locales/bg.json
  • frontend/src/constants/locales/en.json
  • frontend/src/constants/theme.ts
  • frontend/src/navigation/HomeStack.tsx
  • frontend/src/navigation/MainTabs.tsx
  • frontend/src/screens/BrowseCompanies/BrowseCompaniesScreen.styles.ts
  • frontend/src/screens/BrowseCompanies/BrowseCompaniesScreen.tsx
  • frontend/src/screens/Home/HomeScreen.styles.ts
  • frontend/src/screens/Home/HomeScreen.tsx
  • frontend/src/screens/SelectService/SelectServiceScreen.styles.ts
  • frontend/src/screens/SelectService/SelectServiceScreen.tsx
  • frontend/src/screens/ServiceOptions/ServiceOptionsScreen.styles.ts
  • frontend/src/screens/ServiceOptions/ServiceOptionsScreen.tsx
  • frontend/src/types/navigation.ts
💤 Files with no reviewable changes (2)
  • frontend/src/screens/Home/HomeScreen.styles.ts
  • frontend/src/screens/Home/HomeScreen.tsx
✅ Files skipped from review due to trivial changes (12)
  • frontend/src/constants/theme.ts
  • frontend/src/components/BackButton/BackButton.styles.ts
  • frontend/src/components/GlassCard/GlassCard.styles.ts
  • frontend/src/components/ScreenContainer/ScreenContainer.styles.ts
  • frontend/src/components/SearchInput/SearchInput.styles.ts
  • frontend/src/screens/BrowseCompanies/BrowseCompaniesScreen.styles.ts
  • frontend/src/screens/SelectService/SelectServiceScreen.styles.ts
  • frontend/src/screens/ServiceOptions/ServiceOptionsScreen.styles.ts
  • frontend/src/navigation/MainTabs.tsx
  • frontend/src/components/BackgroundShapes/BackgroundShapes.tsx
  • frontend/src/constants/locales/bg.json
  • frontend/src/components/SearchInput/SearchInput.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/constants/locales/en.json

Stoynov added 9 commits April 17, 2026 17:35
Remove native stack headers in favor of custom BackButton component.
Change from absolute to relative positioning.
- Clean header with surface background and hairline border
- Accessibility button as green pill shape
Red circle with standard logout icon next to accessibility menu.
@sonarqubecloud
Copy link
Copy Markdown

@StoynovAngel StoynovAngel merged commit 5866c6c into main Apr 18, 2026
9 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant