Skip to content

fix: use first app in order instead of latest_app_status for focus in tasks #18239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

blink-so[bot]
Copy link
Contributor

@blink-so blink-so bot commented Jun 4, 2025

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

  1. TasksPage.tsx (tasks list view):

    • Get all apps from all agents, excluding chat UI app
    • Use allApps[0] (first app) instead of latest_app_status.app_id
    • Create a synthetic status object for the focused app
  2. TaskApps.tsx (individual task view):

    • Use apps[0] (first app) instead of latest_app_status.app_id for initial focus
    • Maintains user's ability to switch between apps after initial load

Behavior Change

  • Before: Claude terminal apps always auto-focused due to frequent status updates
  • After: The first app in the defined order gets focus, respecting template configuration

This makes the focus behavior consistent with the visual tab ordering that users see and expect.

Testing

  • Verified TypeScript compilation
  • Changes maintain existing functionality while fixing the focus issue
  • No breaking changes to existing APIs

… tasks

This change modifies both the tasks page (list view) and individual task page
to focus on the first app in order rather than the most recently active app.

Previously, Claude terminal apps would auto-focus because they report status
updates frequently, making them the 'latest_app_status'. Now the focus
respects the app ordering as defined in templates.

Changes:
- TasksPage: Use first app from all agents instead of latest_app_status.app_id
- TaskApps: Use first app in apps array instead of latest_app_status.app_id
- Both components now exclude AI_APP_CHAT_SLUG consistently

Fixes the issue where Claude terminal apps always auto-focus instead of
respecting the defined app order in templates.
@bpmct bpmct assigned code-asher and unassigned code-asher Jun 4, 2025
@bpmct bpmct requested review from hugodutka and code-asher June 4, 2025 23:12
bpmct pushed a commit that referenced this pull request Jun 5, 2025
@bpmct bpmct closed this Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants