Repository navigation
✨(frontend) add top parent on sub docs search - #1952
Conversation
|
Size Change: -254 B (-0.01%) Total Size: 4.33 MB 📦 View Changed
|
0bf9667 to
c89909b
Compare
c89909b to
d213b2e
Compare
bab36fd to
c93a524
Compare
|
🚀 Preview will be available at https://1952-docs.ppr-docs.beta.numerique.gouv.fr/ You can use the existing account with these credentials:
You can also create a new account if you want to. Once this Pull Request is merged, the preview will be destroyed. |
511add0 to
5039cb2
Compare
5039cb2 to
c5974a8
Compare
a1df949 to
e2caf4f
Compare
Ovgodd
left a comment
There was a problem hiding this comment.
It works well on my side, just a few suggestions in terms of accessibility and readability.
| }, [search]); | ||
|
|
||
| useEffect(() => { | ||
| setFilter(defaultFilters); |
There was a problem hiding this comment.
| setFilter(defaultFilters); | |
| setFilter(defaultFilters); | |
| return () => setFilter('all'); |
Should we cleanup the filter ? if the user opens the modal, toggle the filter, then closes and reposens on the same doc, defaultFilter don't change so the store will keep the old value ?
There was a problem hiding this comment.
I don't think it keeps the old filter, try again maybe ?
I don't clean it because depends some states of the doc, the default filter is different:
There was a problem hiding this comment.
OK I see ! thanks for the explanations
| useEffect(() => { | ||
| setFilter('current'); | ||
| }, [setFilter]); |
There was a problem hiding this comment.
| useEffect(() => { | |
| setFilter('current'); | |
| }, [setFilter]); | |
| useEffect(() => { | |
| setFilter('current'); | |
| return () => setFilter('all') | |
| }, [setFilter]); |
Should we cleanup here the filter ? . If the user closes the interlinking and then opens the search modal, the filter will still be not reset ?
There was a problem hiding this comment.
There is not a static default filter, depend the state of the doc, the default change, so we force onMount the default filter that we want to use.
e2caf4f to
ca46c93
Compare
ca46c93 to
e50ca93
Compare
In the search endpoint, we were returning all the parents for a document mathing the search. We want instead to return only the top parent the user has access to.
In the search modal, under the sub docs, we now display the top parent of the doc, to give more context to the user about the doc they are looking for. We refactorize the filters to get more flexibility and avoid too much props drilling.
The search ui has been updated to fit the design mockup. It includes: - the search feature - the move doc modal - the interlinking search part
Improve accessibility of search components by adding appropriate ARIA attributes and enhancing screen reader compatibility.
e50ca93 to
6ce8533
Compare
Added - ✨(backend) add limit on distinct reactions per comment #1978 - ✨(frontend) leave a document #2410 - ✨(frontend) add top parent on sub docs search #1952 - ✨(frontend) unauthenticated users can search #2407 - ✨(backend) specific user delete method to delete its relations #2437 Changed - 👷(CI) remove test-e2e-other-browser job #2404 - ♿️(frontend) use heading element for pinned documents section title #2380 - ♿️(frontend) use anchor links for table of contents entries #2390 - ♿️(frontend) improve presenter mode screen reader and keyboard support #2383 - ♿️(frontend) link export modal name to its heading #2422 Fixed - 🐛(frontend) overlap of block menu dropdown #2406 - ⚡️(backend) fix N+1 queries when serializing thread comments #2415
Purpose
In the search modal, under the sub docs, we now display the top parent of the doc, to give more context to the user about the doc they are looking for.
We refactorize the filters to get more flexibility and avoid too much props drilling.
Demo
Enregistrement.2026-06-05.111227.mp4