[PR #1627] [MERGED] feat: #1541 adding search history #1870

Closed
opened 2026-03-02 11:59:33 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/karakeep-app/karakeep/pull/1627
Author: @lexafaxine
Created: 6/17/2025
Status: Merged
Merged: 7/14/2025
Merged by: @MohamedBassem

Base: mainHead: feat-search-history


📝 Commits (10+)

  • c8f6084 feat: adding search history
  • a4c820e fix popover should close when no matched history
  • ca082fb remove unnecessary react import
  • 51e9b33 replace current Input component with CommandInput for better UX
  • b33cdb0 add i18n for recent searches label
  • b5e0acf fix bug
  • 4e214bf refactor local storage logic to make code reusable
  • 6f83a20 using zod schema to validate search history and revert debounce change
  • 1bafb74 resolve conflict
  • a0c0dc2 Merge branch 'main' into feat-search-history

📊 Changes

7 files changed (+416 additions, -47 deletions)

View changed files

📝 apps/mobile/app/dashboard/search.tsx (+115 -14)
📝 apps/mobile/package.json (+1 -0)
📝 apps/web/components/dashboard/header/Header.tsx (+1 -1)
📝 apps/web/components/dashboard/search/SearchInput.tsx (+167 -30)
📝 apps/web/lib/i18n/locales/en/translation.json (+2 -1)
packages/shared-react/hooks/search-history.ts (+102 -0)
📝 pnpm-lock.yaml (+28 -1)

📄 Description

closes #1541

Changes

Add search history for web

Use local storage to store last 5 search history,
The popover showing search history will appear when input is focused.
According to the current search query implementation, history will only be saved to local storage after the input is blur, to prevent unintended saving.

Add search history for mobile

Use react-native async-storage to store last 5 search history,
Because we are showing user search history now in the search screen, user need to hit return to submit a search.
(Please refer to the demo video)

Demo video

web: https://drive.google.com/file/d/1VCfapgyx8nqwxw7JajyC8HlXiJYvjNR7/view?usp=sharing
https://drive.google.com/file/d/1sNfqTqymk3r3Mhbd9mvdOwWNMYvjobzK/view?usp=sharing
mobile: https://drive.google.com/file/d/1b5Xj5ekeFxb6IrzoWVUmZpMLWBHpCnBk/view?usp=sharing


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/karakeep-app/karakeep/pull/1627 **Author:** [@lexafaxine](https://github.com/lexafaxine) **Created:** 6/17/2025 **Status:** ✅ Merged **Merged:** 7/14/2025 **Merged by:** [@MohamedBassem](https://github.com/MohamedBassem) **Base:** `main` ← **Head:** `feat-search-history` --- ### 📝 Commits (10+) - [`c8f6084`](https://github.com/karakeep-app/karakeep/commit/c8f6084b914cba40b80eb510e76fb88f7b154f70) feat: adding search history - [`a4c820e`](https://github.com/karakeep-app/karakeep/commit/a4c820ea365e77d2a29d4f91e9fc94e5f38b90e1) fix popover should close when no matched history - [`ca082fb`](https://github.com/karakeep-app/karakeep/commit/ca082fb0d147db52ddc14bf0268abfece323d584) remove unnecessary react import - [`51e9b33`](https://github.com/karakeep-app/karakeep/commit/51e9b33cce703211a041d93efd40da3c3327bc3d) replace current Input component with CommandInput for better UX - [`b33cdb0`](https://github.com/karakeep-app/karakeep/commit/b33cdb097560871ccb74fbb033c99964ba0e0193) add i18n for recent searches label - [`b5e0acf`](https://github.com/karakeep-app/karakeep/commit/b5e0acfc843b824be8591b7131456add8e03450e) fix bug - [`4e214bf`](https://github.com/karakeep-app/karakeep/commit/4e214bfd44bd209ba2d4f8b62afed3398b0c5bf9) refactor local storage logic to make code reusable - [`6f83a20`](https://github.com/karakeep-app/karakeep/commit/6f83a208f4b1ca7dea32dd37d919e4a584f72f90) using zod schema to validate search history and revert debounce change - [`1bafb74`](https://github.com/karakeep-app/karakeep/commit/1bafb74917af8ed04e0527fc7fdb891b80375abc) resolve conflict - [`a0c0dc2`](https://github.com/karakeep-app/karakeep/commit/a0c0dc257f057db1345ec428bce29c7de798085d) Merge branch 'main' into feat-search-history ### 📊 Changes **7 files changed** (+416 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `apps/mobile/app/dashboard/search.tsx` (+115 -14) 📝 `apps/mobile/package.json` (+1 -0) 📝 `apps/web/components/dashboard/header/Header.tsx` (+1 -1) 📝 `apps/web/components/dashboard/search/SearchInput.tsx` (+167 -30) 📝 `apps/web/lib/i18n/locales/en/translation.json` (+2 -1) ➕ `packages/shared-react/hooks/search-history.ts` (+102 -0) 📝 `pnpm-lock.yaml` (+28 -1) </details> ### 📄 Description closes #1541 ### Changes #### Add search history for web Use local storage to store last 5 search history, The popover showing search history will appear when input is focused. According to the current search query implementation, history will only be saved to local storage after the input is blur, to prevent unintended saving. #### Add search history for mobile Use react-native async-storage to store last 5 search history, Because we are showing user search history now in the search screen, user need to hit return to submit a search. (Please refer to the demo video) ### Demo video web: ~~https://drive.google.com/file/d/1VCfapgyx8nqwxw7JajyC8HlXiJYvjNR7/view?usp=sharing~~ https://drive.google.com/file/d/1sNfqTqymk3r3Mhbd9mvdOwWNMYvjobzK/view?usp=sharing mobile: https://drive.google.com/file/d/1b5Xj5ekeFxb6IrzoWVUmZpMLWBHpCnBk/view?usp=sharing --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 11:59:33 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1870
No description provided.