8000 fix: use first app in order instead of latest_app_status for focus in tasks by blink-so[bot] · Pull Request #18239 · coder/coder · GitHub
[go: up one dir, main page]

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
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
< 8000 svg style="box-sizing: content-box; color: var(--color-icon-primary);" width="32" height="32" viewBox="0 0 16 16" fill="none" aria-hidden="true" data-view-component="true" class="anim-rotate"> Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: format TasksPage.tsx with biome
  • Loading branch information
blink-so[bot] committed Jun 5, 2025
commit b505578d6e1bb4a52737260acb0a2aa9834e8775
22 changes: 12 additions & 10 deletions site/src/pages/TasksPage/TasksPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,30 +329,32 @@ const TasksTable: FC<TasksTableProps> = ({ templates, filter }) => {
tasks.map(({ workspace, prompt }) => {
const templateDisplayName =
workspace.template_display_name ?? workspace.template_name;

// Get all apps from all agents, excluding the chat UI app
const allApps = workspace.latest_build.resources
.flatMap((r) => r.agents)
.filter((a) => !!a)
.flatMap((a) => a.apps)
.filter((app) => app.slug !== AI_APP_CHAT_SLUG);

// Use the first app in order instead of the most recently active app
const focusedApp = allApps[0];

// Find the agent that contains the focused app
const agent = workspace.latest_build.resources
.flatMap((r) => r.agents)
.filter((a) => !!a)
.find((a) => a.apps.some((app) => app.id === focusedApp?.id));

// Create a status object for the focused app, or fall back to latest_app_status
const status = focusedApp ? {
...workspace.latest_app_status,
app_id: focusedApp.id,
agent_id: agent?.id || workspace.latest_app_status?.agent_id,
} : workspace.latest_app_status;

const status = focusedApp
? {
...workspace.latest_app_status,
app_id: focusedApp.id,
agent_id: agent?.id || workspace.latest_app_status?.agent_id,
}
: workspace.latest_app_status;

const app = focusedApp;

return (
Expand Down
Loading
0