choo121600 commented on PR #54059:
URL: https://github.com/apache/airflow/pull/54059#issuecomment-3153341134

   1. There’s a difference in how search works between components like 
Variables/Pools and DagList/AssetList. The former use modals, so search state 
is preserved via the URL query alone. But for DagList and AssetList, navigating 
to a detail page causes the search state to be lost.
   
   A common workaround is to include return paths or search state in the URL, 
but this results in long and cluttered URLs like 
/assets/1?returnTo=%2Fassets.... I felt that detail page URLs should remain 
clean, reflecting only the unique resource path — which is why I explored 
alternatives to URL-based state management.
   
   2. Initially I solved this by combining `localStorage` with useEffect, but 
it wasn't satisfied with the need to rely on useEffect.
   
https://github.com/apache/airflow/pull/54059/commits/efb9dce4c2c8edff0a799991e58b4b5f369dea15
   
   So I looked for a way to preserve state without useEffect, and that’s when I 
considered sessionStorage.
   
   ---
   If using sessionStorage goes against project conventions, here are a couple 
of alternatives we could consider:
   * Pass the search query in the URL when navigating to the detail view(URLs 
may get a bit long.)
   * localStorage + useEffect
   
   Since this week is a bit packed with internal schedules, I’ll plan to 
revisit this next week and follow up with a PR to apply the best approach. I’ll 
leave a issue to make sure it doesn’t get lost.
   
   If you have any better ideas or hints, I’d really appreciate it if you could 
share them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to