jargonsdev / jargonsdev/jargons.dev
Add Recent Searched Words to Default View in Search Dialog
Nessuno ha ancora preso questa issue.
- Lingua principale
- MDX
- Stelle
- 56
- Fork
- 45
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
We currently have a default view in our search dialog, which is displayed when the user opens the search without any input. To improve user experience, we would like to enhance this functionality by showing recently searched words if there have been any recent searches. This enhancement is inspired by the implementation found on the TailwindCSS documentation site.
Current Implementation
When a user opens the search dialog, a default view is displayed regardless of any previous searches. Below is a screenshot of our current default search dialog:
Desired Implementation
We would like to display recently searched words in place of the current default view when there have been recent searches. This change aims to make it easier for users to quickly access their recent searches.
An example of the desired implementation can be seen on the TailwindCSS documentation site. Below is a screenshot of their search dialog displaying recent searches:
Implementation Details
The enhancement will be implemented in the components/islands/search.jsx file. The steps to achieve this are as follows:
- Utilize Stored Recent Searches: Use the existing
jargons.dev:recent_searchesobject fromlocalStorageto fetch recent search terms. - Update Default View: Modify the search dialog component to check for recent searches and display them instead of the current default view.
- Display Logic: Ensure that the recent searches are displayed in a user-friendly manner, similar to the TailwindCSS documentation example.
Acceptance Criteria
- Recent searches are displayed in the search dialog when the user opens it and there have been recent searches.
- If no recent searches are available, the current default view is displayed.
- The implementation is done in the
components/islands/search.jsxfile. - The functionality is tested and verified for consistent behavior.
Additional Information
- Feel free to ask for more details or clarifications if needed. This enhancement aims to improve the overall usability and efficiency of our search functionality.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da components/islands/search.jsx, tracciando la vista predefinita esistente e il modo in cui viene gestito l'oggetto localStorage jargon.dev:recent_searches. Aggiorna lo stato di apertura senza input in modo da mostrare i termini recenti quando disponibili e mantieni altrimenti la vista predefinita attuale. Verifica entrambi i comportamenti nella finestra di dialogo di ricerca.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, react, tailwindcss
- Ambito
- frontend, search, web-dev
- Tipo di issue
- Funzionalità
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 48/100