Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
blink-so wants to merge3 commits intomainfromfix/tasks-page-app-focus-order
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletionssite/src/pages/TaskPage/TaskApps.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,11 +33,12 @@ export const TaskApps: FC<TaskAppsProps> = ({ task }) => {
.filter((a) => !!a && a.slug !== AI_APP_CHAT_SLUG);

const [activeAppId, setActiveAppId] = useState<string>(() => {
const appId = task.workspace.latest_app_status?.app_id;
if (!appId) {
throw new Error("No active app found in task");
// Use the first app in order instead of the most recently active app
const firstApp = apps[0];
if (!firstApp) {
throw new Error("No apps found in task");
}
returnappId;
returnfirstApp.id;
});

const activeApp = apps.find((app) => app.id === activeAppId);
Expand Down
29 changes: 26 additions & 3 deletionssite/src/pages/TasksPage/TasksPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,6 +39,7 @@ import { Link as RouterLink } from "react-router-dom";
import TextareaAutosize from "react-textarea-autosize";
import { pageTitle } from "utils/page";
import { relativeTime } from "utils/time";
import { AI_APP_CHAT_SLUG } from "../TaskPage/constants";
import { type UserOption, UsersCombobox } from "./UsersCombobox";

type TasksFilter = {
Expand DownExpand Up@@ -328,11 +329,33 @@ const TasksTable: FC<TasksTableProps> = ({ templates, filter }) => {
tasks.map(({ workspace, prompt }) => {
const templateDisplayName =
workspace.template_display_name ?? workspace.template_name;
const status = workspace.latest_app_status;

// 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)
.find((a) => a?.id === status?.agent_id);
const app = agent?.apps.find((a) => a.id === status?.app_id);
.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 app = focusedApp;

return (
<TableRow key={workspace.id} className="relative" hover>
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp