Skip to content

feat: add search bar to home page with navigation to pulse#478

Merged
aldin4u merged 7 commits intostagingfrom
feature/home-search-navigation
Dec 16, 2025
Merged

feat: add search bar to home page with navigation to pulse#478
aldin4u merged 7 commits intostagingfrom
feature/home-search-navigation

Conversation

@aldin4u
Copy link
Collaborator

@aldin4u aldin4u commented Dec 11, 2025

Description

image

How Has This Been Tested?

Branch: feature/home-search-navigation
Changes: Search bar on home page, Pulse navigation, Tailwind refactor, bug fixes.
Verification: Tests passed, linting clean.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Summary by CodeRabbit

  • New Features

    • Added a search button (with icon) in the PillarX app in two locations to open Pulse search.
    • Pulse can auto-open search when a specific URL parameter is present.
  • Behavior

    • Closing search returns users to PillarX home when they arrived from the PillarX app.
    • Closing search no longer clears the URL parameter when auto-open is active.
  • Style

    • Adjusted header spacing for improved visual balance.
  • Tests

    • Added mocks to enable deployment-related scenarios in swap card tests.

✏️ Tip: You can customize this high-level summary in your review settings.

@aldin4u aldin4u requested a review from RanaBug December 11, 2025 12:26
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Walkthrough

Adds a Pulse Search entry in the pillarx-app that navigates to /pulse?searching=true; Pulse's AppWrapper reads this query to auto-open Search and records origin to navigate back to / when Search is closed. Search's query-cleanup and AppWrapper's closing flow were adapted; a wallet-deploy mock was added to a CardSwap test.

Changes

Cohort / File(s) Summary
PillarX app — Search entry & UI
src/apps/pillarx-app/index.tsx
Added useNavigate and a Pulse Search button (imports searchIcon) that invokes navigate('/pulse?searching=true'); adjusted HeaderContainer margins and responsive spacing.
Pulse app — Route-driven search open/close
src/apps/pulse/components/App/AppWrapper.tsx
Added useNavigate, introduced cameFromPillarXHome state; on init reads searching query param to auto-open Search and mark origin; replaced direct setSearching prop with handleSetSearching which navigates back to / when closing if originated from pillarx-app.
Pulse Search — conditional query cleanup
src/apps/pulse/components/Search/Search.tsx
handleClose now removes query params only when the searching URL param is not 'true'; reads searchingParam and defers navigation-on-close to AppWrapper.
Tests — wallet deploy mock
src/apps/the-exchange/components/CardsSwap/test/CardSwap.test.tsx
Added mock implementation for useDeployWallet exposing getWalletDeploymentCost, isWalletDeployed, and getGasPrice to avoid relying on real deployment logic in tests.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant PillarX as pillarx-app
    participant Router as Router
    participant AppWrapper as Pulse AppWrapper
    participant Search as Pulse Search

    User->>PillarX: Click "Pulse Search" button
    PillarX->>Router: navigate("/pulse?searching=true")
    Router->>AppWrapper: Mount /pulse with ?searching=true
    AppWrapper->>AppWrapper: read searching -> setSearching(true), cameFromPillarXHome = true
    AppWrapper->>Search: render with handleSetSearching callback
    Search->>Search: open search UI

    User->>Search: Close search
    Search->>AppWrapper: call handleSetSearching(false)
    AppWrapper->>AppWrapper: sees cameFromPillarXHome == true
    AppWrapper->>Router: navigate("/")
    AppWrapper->>AppWrapper: setSearching(false), cameFromPillarXHome = false
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify query-param parsing for /pulse opened directly vs via pillarx-app.
  • Confirm cameFromPillarXHome lifecycle across repeated opens, route changes, and back/forward navigation.
  • Ensure Search.handleClose conditional removal of query params and the new handler do not leave stale query state.

Possibly related PRs

Suggested reviewers

  • RanaBug
  • IAmKio

"I hopped from header to a pulse-lit trail,
A search flag waved like a tiny sail.
I nudged the query, opened the door,
Then home we bounced — a rabbit encore. 🐇"

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. Required sections lack sufficient detail: the Description section is mostly empty except for an image; 'How Has This Been Tested' provides only vague statements without test details; and none of the change type checkboxes are marked. Expand the Description section with details of all changes made (search bar, navigation, Tailwind refactor, bug fixes); provide specific test cases and environments tested; mark the appropriate 'New feature' checkbox to clarify the change type.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a search bar to the home page with navigation to the pulse app.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/home-search-navigation

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bcd2692 and 49314ac.

📒 Files selected for processing (1)
  • src/apps/pillarx-app/index.tsx (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/apps/pillarx-app/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: lint
  • GitHub Check: unit-tests
  • GitHub Check: build
  • GitHub Check: Cloudflare Pages: pillarx-debug

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.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 11, 2025

Deploying pillarx-debug with  Cloudflare Pages  Cloudflare Pages

Latest commit: aa7a1ad
Status: ✅  Deploy successful!
Preview URL: https://bb62a752.pillarx-debug.pages.dev
Branch Preview URL: https://feature-home-search-navigati.pillarx-debug.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 11, 2025

Deploying x with  Cloudflare Pages  Cloudflare Pages

Latest commit: aa7a1ad
Status: ✅  Deploy successful!
Preview URL: https://f2a8a359.x-e62.pages.dev
Branch Preview URL: https://feature-home-search-navigati.x-e62.pages.dev

View logs

className="w-[6px] h-[6px] opacity-60"
/>
</div>
<span className="font-['Poppins'] font-normal text-[13px] leading-[13px] tracking-[-0.02em] text-white opacity-50 ml-[10px] select-none">
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need the font-['Poppins'], it automatically picks up that font - bit not a showstopper of course

Copy link
Contributor

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b9f381 and 4ac3c94.

⛔ Files ignored due to path filters (1)
  • src/apps/the-exchange/components/CardsSwap/test/__snapshots__/CardSwap.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • src/apps/pillarx-app/index.tsx (6 hunks)
  • src/apps/pulse/components/App/AppWrapper.tsx (4 hunks)
  • src/apps/pulse/components/Search/Search.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-03-28T09:22:22.712Z
Learnt from: RanaBug
Repo: pillarwallet/x PR: 275
File: src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx:180-195
Timestamp: 2025-03-28T09:22:22.712Z
Learning: In the Exchange app, `swapTokenList` and `receiveTokenList` are derived from `searchTokenResult` when search is active, so including `searchToken` in the useEffect dependency array that uses these lists would be redundant as the lists will update when search results change.

Applied to files:

  • src/apps/pulse/components/App/AppWrapper.tsx
📚 Learning: 2025-08-20T09:14:16.888Z
Learnt from: RanaBug
Repo: pillarwallet/x PR: 374
File: src/apps/pillarx-app/index.tsx:12-12
Timestamp: 2025-08-20T09:14:16.888Z
Learning: In this codebase, Transaction Kit providers are set up at the container level (src/containers/Authorized.tsx), not at individual app component levels. App components like src/apps/pillarx-app/index.tsx are children that consume the context through the provider tree.

Applied to files:

  • src/apps/pulse/components/App/AppWrapper.tsx
📚 Learning: 2025-11-04T14:34:00.373Z
Learnt from: RanaBug
Repo: pillarwallet/x PR: 445
File: src/containers/Authorized.tsx:63-77
Timestamp: 2025-11-04T14:34:00.373Z
Learning: In src/containers/Authorized.tsx, the tempKit useEffect intentionally excludes chainId from its dependency array because the kit is used by useWalletModeVerification to check wallet mode across all supported chains, regardless of the currently selected chainId. The chainId parameter is only used for initial kit configuration and does not affect the multi-chain verification results.

Applied to files:

  • src/apps/pulse/components/App/AppWrapper.tsx
📚 Learning: 2025-10-15T10:31:06.760Z
Learnt from: IAmKio
Repo: pillarwallet/x PR: 432
File: src/containers/Main.tsx:135-141
Timestamp: 2025-10-15T10:31:06.760Z
Learning: In src/containers/Main.tsx, the React Native webview messaging setup intentionally only activates when the `devicePlatform` URL parameter is present ('ios' or 'android'). On reloads or direct navigation without URL params, the site should behave normally and not attempt to re-establish RN messaging. This is by design to ensure the site functions properly in both RN webview and standard browser contexts.

Applied to files:

  • src/apps/pillarx-app/index.tsx
🧬 Code graph analysis (1)
src/apps/pillarx-app/index.tsx (1)
src/pages/Landing.jsx (1)
  • navigate (51-51)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: unit-tests
  • GitHub Check: lint
  • GitHub Check: build
  • GitHub Check: Cloudflare Pages: pillarx-debug
🔇 Additional comments (4)
src/apps/pillarx-app/index.tsx (3)

13-13: Pulse search navigation wiring looks consistent

Importing useNavigate, creating navigate, and using handleSearchClick to go to /pulse?searching=true lines up with the new searching-param behavior in AppWrapper and Search. No issues from a routing or state perspective.

Also applies to: 44-44, 64-64, 343-346


365-381: Home search bar button implementation looks good

The search bar is correctly implemented as a <button> with a visible “Search” label and reasonable hit area and styling. Semantics and accessibility are fine for this use case; nothing blocking here.


434-438: Header spacing adjustment is safe

Reducing margin-bottom on HeaderContainer for desktop and mobile is purely presentational and doesn’t affect behavior or layout structure elsewhere. Looks fine.

src/apps/pulse/components/Search/Search.tsx (1)

234-250: handleClose correctly defers navigation when searching=true, but verify behavior across entrypoints

Conditionally skipping removeQueryParams() when the searching query param is 'true' matches the intent to let AppWrapper decide how to navigate back (e.g., to PillarX home) for /pulse?searching=true entries, while preserving the old behavior for other URLs.

Please double‑check the following flows to confirm they behave as expected:

  1. From PillarX home (/pulse?searching=true):
    • Close via back button / ESC / outside click → search closes and you end up back on the PillarX home page.
  2. Existing deep links (e.g. ?asset=..., ?relayBuy=...):
    • Close search → stays within Pulse and query params are cleaned up as before.

If any of these diverge from the desired UX, this is the place to refine the searchingParam condition.

@github-actions github-actions bot temporarily deployed to Preview (feature/home-search-navigation) December 11, 2025 14:06 Inactive
Copy link
Contributor

@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: 0

♻️ Duplicate comments (1)
src/apps/pillarx-app/index.tsx (1)

428-432: Double‑check reduced header bottom margin against the action bar layout

The reduced margin-bottom (20px / 16px on mobile) tightens the header spacing and likely better matches the search bar design, but there was a previous issue where larger spacing helped avoid clashes with the action bar. Please re‑verify on smaller viewports and with the action bar visible that there’s no overlap or visual regression.

🧹 Nitpick comments (1)
src/apps/pillarx-app/index.tsx (1)

44-45: Tweak search icon semantics for better screen‑reader behavior

The search button structure looks good and matches the described UX, but since the button already has visible text “Search”, consider making the icon decorative to avoid duplicate announcements by screen readers:

-        <img src={searchIcon} alt="search" className="w-[14px] h-[14px] opacity-60" />
+        <img
+          src={searchIcon}
+          alt=""
+          aria-hidden="true"
+          className="w-[14px] h-[14px] opacity-60"
+        />

This keeps the visual design while improving a11y.

Also applies to: 365-375

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ac3c94 and 83f2fe1.

📒 Files selected for processing (1)
  • src/apps/pillarx-app/index.tsx (6 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: aldin4u
Repo: pillarwallet/x PR: 478
File: src/apps/pulse/components/App/AppWrapper.tsx:22-23
Timestamp: 2025-12-11T12:40:02.519Z
Learning: In the Pulse app's AppWrapper component (src/apps/pulse/components/App/AppWrapper.tsx), when users enter via `/pulse?searching=true` from PillarX home and select a token or market, they should continue into Pulse to complete their transaction, not navigate back to home. Only when closing the search without making a selection should they return to PillarX home.
📚 Learning: 2025-12-11T12:40:02.519Z
Learnt from: aldin4u
Repo: pillarwallet/x PR: 478
File: src/apps/pulse/components/App/AppWrapper.tsx:22-23
Timestamp: 2025-12-11T12:40:02.519Z
Learning: In the Pulse app's AppWrapper component (src/apps/pulse/components/App/AppWrapper.tsx), when users enter via `/pulse?searching=true` from PillarX home and select a token or market, they should continue into Pulse to complete their transaction, not navigate back to home. Only when closing the search without making a selection should they return to PillarX home.

Applied to files:

  • src/apps/pillarx-app/index.tsx
📚 Learning: 2025-10-15T10:31:06.760Z
Learnt from: IAmKio
Repo: pillarwallet/x PR: 432
File: src/containers/Main.tsx:135-141
Timestamp: 2025-10-15T10:31:06.760Z
Learning: In src/containers/Main.tsx, the React Native webview messaging setup intentionally only activates when the `devicePlatform` URL parameter is present ('ios' or 'android'). On reloads or direct navigation without URL params, the site should behave normally and not attempt to re-establish RN messaging. This is by design to ensure the site functions properly in both RN webview and standard browser contexts.

Applied to files:

  • src/apps/pillarx-app/index.tsx
🧬 Code graph analysis (1)
src/apps/pillarx-app/index.tsx (1)
src/pages/Landing.jsx (1)
  • navigate (51-51)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: unit-tests
  • GitHub Check: lint
  • GitHub Check: build
🔇 Additional comments (1)
src/apps/pillarx-app/index.tsx (1)

13-13: Pulse search navigation wiring matches the intended /pulse?searching=true flow

Using useNavigate plus handleSearchClick to route to /pulse?searching=true is consistent with the Pulse AppWrapper behavior for opening search from PillarX home, and keeps the routing logic local and simple. Please just re‑verify both flows (selecting a token/market vs closing search without selection) still behave as expected end‑to‑end with this new entry point. Based on learnings, this matches the intended Pulse entry behavior.

Also applies to: 64-65, 343-346

@github-actions github-actions bot temporarily deployed to Preview (feature/home-search-navigation) December 11, 2025 14:54 Inactive
Copy link
Contributor

@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: 0

♻️ Duplicate comments (1)
src/apps/pillarx-app/index.tsx (1)

376-376: Font declaration not necessary.

As noted in previous review comments, the font-['Poppins'] declaration is unnecessary as the font is automatically picked up. While not a blocker, it can be safely removed for cleaner code.

🧹 Nitpick comments (1)
src/apps/pillarx-app/index.tsx (1)

366-379: Consider adding an aria-label for improved accessibility.

While the button has visible text content, adding an aria-label="Search tokens and markets" would provide clearer context for screen reader users about what the search functionality does.

Apply this diff:

 <button
   type="button"
   onClick={handleSearchClick}
+  aria-label="Search tokens and markets"
   className="flex items-center w-full max-w-[645px] h-8 mx-auto mb-5 mobile:mb-4 bg-[rgba(30,29,36,0.3)] border-2 border-[#1e1d24] shadow-[inset_0px_2px_0px_2px_#121116] rounded-[10px] px-[10px] cursor-pointer"
 >
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83f2fe1 and f8eb29a.

📒 Files selected for processing (1)
  • src/apps/pillarx-app/index.tsx (6 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: aldin4u
Repo: pillarwallet/x PR: 478
File: src/apps/pulse/components/App/AppWrapper.tsx:22-23
Timestamp: 2025-12-11T12:40:02.519Z
Learning: In the Pulse app's AppWrapper component (src/apps/pulse/components/App/AppWrapper.tsx), when users enter via `/pulse?searching=true` from PillarX home and select a token or market, they should continue into Pulse to complete their transaction, not navigate back to home. Only when closing the search without making a selection should they return to PillarX home.
📚 Learning: 2025-12-11T12:40:02.519Z
Learnt from: aldin4u
Repo: pillarwallet/x PR: 478
File: src/apps/pulse/components/App/AppWrapper.tsx:22-23
Timestamp: 2025-12-11T12:40:02.519Z
Learning: In the Pulse app's AppWrapper component (src/apps/pulse/components/App/AppWrapper.tsx), when users enter via `/pulse?searching=true` from PillarX home and select a token or market, they should continue into Pulse to complete their transaction, not navigate back to home. Only when closing the search without making a selection should they return to PillarX home.

Applied to files:

  • src/apps/pillarx-app/index.tsx
📚 Learning: 2025-10-15T10:31:06.760Z
Learnt from: IAmKio
Repo: pillarwallet/x PR: 432
File: src/containers/Main.tsx:135-141
Timestamp: 2025-10-15T10:31:06.760Z
Learning: In src/containers/Main.tsx, the React Native webview messaging setup intentionally only activates when the `devicePlatform` URL parameter is present ('ios' or 'android'). On reloads or direct navigation without URL params, the site should behave normally and not attempt to re-establish RN messaging. This is by design to ensure the site functions properly in both RN webview and standard browser contexts.

Applied to files:

  • src/apps/pillarx-app/index.tsx
🧬 Code graph analysis (1)
src/apps/pillarx-app/index.tsx (1)
src/pages/Landing.jsx (1)
  • navigate (51-51)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: unit-tests
  • GitHub Check: lint
  • GitHub Check: build
  • GitHub Check: Cloudflare Pages: pillarx-debug
🔇 Additional comments (2)
src/apps/pillarx-app/index.tsx (2)

343-346: Navigation logic is correct.

The handler correctly navigates to /pulse?searching=true, which triggers the Pulse app's search interface as designed. Based on learnings, the Pulse AppWrapper will read this query parameter to auto-open the search view.


432-435: Margin adjustments align with design requirements.

The reduced margins were previously discussed and are intentional to accommodate the new search bar layout per design specifications.

@github-actions github-actions bot temporarily deployed to Preview (feature/home-search-navigation) December 16, 2025 09:13 Inactive
Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
src/apps/the-exchange/components/CardsSwap/test/CardSwap.test.tsx (1)

144-151: Add test coverage for wallet deployment scenarios in SwapReceiveCard.

The mock provides optimistic defaults (wallet deployed, zero cost) but the test suite doesn't verify how SwapReceiveCard handles different deployment conditions. Since SwapReceiveCard adjusts token balance based on deployment cost for native tokens, consider adding tests for:

  • Wallet not deployed (isWalletDeployed returns false)
  • Non-zero deployment costs
  • Deployment cost or gas price retrieval failures

Additionally, the mock is missing clearWalletDeployedLocalStorageStatus from the hook's exported interface—though this function currently isn't used, maintaining parity with the actual hook API would improve maintainability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f8eb29a and bcd2692.

📒 Files selected for processing (1)
  • src/apps/the-exchange/components/CardsSwap/test/CardSwap.test.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: aldin4u
Repo: pillarwallet/x PR: 478
File: src/apps/pulse/components/App/AppWrapper.tsx:22-23
Timestamp: 2025-12-11T12:40:02.519Z
Learning: In the Pulse app's AppWrapper component (src/apps/pulse/components/App/AppWrapper.tsx), when users enter via `/pulse?searching=true` from PillarX home and select a token or market, they should continue into Pulse to complete their transaction, not navigate back to home. Only when closing the search without making a selection should they return to PillarX home.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: lint
  • GitHub Check: unit-tests
  • GitHub Check: build
  • GitHub Check: Cloudflare Pages: pillarx-debug

@github-actions github-actions bot temporarily deployed to Preview (feature/home-search-navigation) December 16, 2025 09:19 Inactive
@github-actions github-actions bot temporarily deployed to Preview (feature/home-search-navigation) December 16, 2025 10:39 Inactive
@aldin4u aldin4u merged commit d0cd220 into staging Dec 16, 2025
7 checks passed
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.

2 participants