fix: use first app in order instead of latest_app_status for focus in tasks #18239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The tasks page (both list view and individual task view) was auto-focusing on Claude terminal apps instead of respecting the defined app order. This happened because the focus logic used
latest_app_status.app_id
, which always points to the most recently active app. Since Claude apps report status updates frequently, they would always become the "latest" app and auto-focus.Solution
Modified both components to use the first app in order instead of the most recently active app:
Changes Made
TasksPage.tsx (tasks list view):
allApps[0]
(first app) instead oflatest_app_status.app_id
TaskApps.tsx (individual task view):
apps[0]
(first app) instead oflatest_app_status.app_id
for initial focusBehavior Change
This makes the focus behavior consistent with the visual tab ordering that users see and expect.
Testing