bbovenzi commented on code in PR #76483:
URL: https://github.com/apache/airflow/pull/76483#discussion_r4668004857
##########
airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/Logs.tsx:
##########
@@ -134,9 +140,36 @@ export const Logs = () => {
return indices;
})();
+ // Local state keeps the highlighting responsive; the url follows
(debounced) so the query survives a
+ // tab change and can be shared.
+ const syncSearchParam = useDebouncedCallback((query: string) => {
+ setSearchParams(
+ (params) => {
+ if (query === "") {
+ params.delete(LOG_SEARCH_PARAMS.search);
+ } else {
+ params.set(LOG_SEARCH_PARAMS.search, query);
+ }
+
+ return params;
+ },
+ { replace: true },
+ );
+ }, debounceDelay);
+
+ // Back/Forward can change the url without remounting; adopt it unless a
typed edit is still pending.
+ if (urlSearchQuery !== lastUrlSearchQuery) {
+ setLastUrlSearchQuery(urlSearchQuery);
+ if (!syncSearchParam.isPending()) {
Review Comment:
Applied your suggestion in be80a9e63e4, with a test that pressed Enter
before the debounced write and failed (2 of 4 → 1 of 4) without it.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
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]