feat(FN-2998): scope ResearchView bottom safe-area padding to mobile
The merge brings in a fix (FN-2998) that scopes the bottom safe-area padding in ResearchView to mobile devices only, correcting an over-application of the padding on desktop or larger screens. Fusion-Task-Id: FN-2998
This commit is contained in:
@@ -30,7 +30,7 @@ import { join } from "node:path";
|
||||
import { mkdtempSync, existsSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import * as projectMemory from "../project-memory.js";
|
||||
import type { Task } from "../types.js";
|
||||
import { buildResearchDocumentKey, type Task } from "../types.js";
|
||||
|
||||
function makeTmpDir(): string {
|
||||
return mkdtempSync(join(tmpdir(), "kb-store-test-"));
|
||||
@@ -7402,6 +7402,41 @@ Task with acceptance criteria
|
||||
expect(fetched.sourceAgentId).toBe("agent-auto");
|
||||
expect(fetched.sourceMetadata).toEqual({ trigger: "nightly" });
|
||||
});
|
||||
|
||||
it("persists research provenance metadata", async () => {
|
||||
const task = await store.createTask({
|
||||
description: "Research finding follow-up",
|
||||
source: {
|
||||
sourceType: "research",
|
||||
sourceMetadata: {
|
||||
runId: "RR-42",
|
||||
findingId: "finding-1",
|
||||
findingLabel: "Key risk",
|
||||
documentKey: "research-RR-42",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const fetched = await store.getTask(task.id);
|
||||
expect(fetched.sourceType).toBe("research");
|
||||
expect(fetched.sourceMetadata).toEqual({
|
||||
runId: "RR-42",
|
||||
findingId: "finding-1",
|
||||
findingLabel: "Key risk",
|
||||
documentKey: "research-RR-42",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("research document key helper", () => {
|
||||
it("builds canonical research document keys", () => {
|
||||
expect(buildResearchDocumentKey("RR-1")).toBe("research-RR-1");
|
||||
expect(buildResearchDocumentKey("RR/1")).toBe("research-RR1");
|
||||
});
|
||||
|
||||
it("rejects run IDs that sanitize to an empty string", () => {
|
||||
expect(() => buildResearchDocumentKey("!!!")).toThrow("Invalid research run id");
|
||||
});
|
||||
});
|
||||
|
||||
// ── Title Handling Tests ────────────────────────────────────────
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export { COLUMNS, COLUMN_LABELS, COLUMN_DESCRIPTIONS, VALID_TRANSITIONS, DEFAULT_SETTINGS, DEFAULT_GLOBAL_SETTINGS, DEFAULT_PROJECT_SETTINGS, GLOBAL_SETTINGS_KEYS, PROJECT_SETTINGS_KEYS, isGlobalSettingsKey, isProjectSettingsKey, THINKING_LEVELS, THEME_MODES, COLOR_THEMES, WORKFLOW_STEP_TEMPLATES, AGENT_PERMISSIONS, agentToConfigSnapshot, diffConfigSnapshots, isEphemeralAgent, hasAgentIdentity, CheckoutConflictError, DEFAULT_HEARTBEAT_PROCEDURE_PATH, getDefaultHeartbeatProcedurePath, EXECUTION_MODES, DEFAULT_EXECUTION_MODE, TASK_PRIORITIES, DEFAULT_TASK_PRIORITY, validateMessageMetadata, normalizeMergeConflictStrategy } from "./types.js";
|
||||
export { COLUMNS, COLUMN_LABELS, COLUMN_DESCRIPTIONS, VALID_TRANSITIONS, DEFAULT_SETTINGS, DEFAULT_GLOBAL_SETTINGS, DEFAULT_PROJECT_SETTINGS, GLOBAL_SETTINGS_KEYS, PROJECT_SETTINGS_KEYS, isGlobalSettingsKey, isProjectSettingsKey, THINKING_LEVELS, THEME_MODES, COLOR_THEMES, WORKFLOW_STEP_TEMPLATES, AGENT_PERMISSIONS, agentToConfigSnapshot, diffConfigSnapshots, isEphemeralAgent, hasAgentIdentity, CheckoutConflictError, DEFAULT_HEARTBEAT_PROCEDURE_PATH, getDefaultHeartbeatProcedurePath, EXECUTION_MODES, DEFAULT_EXECUTION_MODE, TASK_PRIORITIES, DEFAULT_TASK_PRIORITY, validateMessageMetadata, normalizeMergeConflictStrategy, buildResearchDocumentKey } from "./types.js";
|
||||
export type { Column, IssueInfo, IssueState, TaskSourceIssue, PrInfo, PrStatus, Task, TaskTokenUsage, TaskAttachment, TaskComment, TaskCommentInput, TaskDocument, TaskDocumentRevision, TaskDocumentCreateInput, TaskDocumentWithTask, TaskCreateInput, TaskSource, SourceType, TaskDetail, InboxTask, TodoList, TodoItem, TodoListCreateInput, TodoListUpdateInput, TodoItemCreateInput, TodoItemUpdateInput, TodoListWithItems, AgentLogEntry, AgentLogType, AgentRole, BoardConfig, MergeDetails, MergeResult, MergeConflictStrategy, CanonicalMergeConflictStrategy, Settings, GlobalSettings, ProjectSettings, WebSearchBackend, ResearchEnabledSources, ResearchGlobalDefaults, ResearchProjectLimits, ResearchProjectSettings, SettingsScope, DaemonTokenSettings, TaskStep, StepStatus, TaskLogEntry, RunMutationContext, ActivityLogEntry, ActivityEventType, ThinkingLevel, ThemeMode, ColorTheme, ExecutionMode, TaskPriority, UnavailableNodePolicy, PlanningQuestion, PlanningSummary, PlanningResponse, PlanningQuestionType, ArchivedTaskEntry, BatchStatusRequest, BatchStatusResponse, BatchStatusEntry, BatchStatusResult, ModelPreset, WorkflowStep, WorkflowStepMode, WorkflowStepPhase, WorkflowStepInput, WorkflowStepResult, WorkflowStepTemplate, Agent, OrgTreeNode, AgentState, AgentDetail, AgentCreateInput, AgentUpdateInput, AgentApiKey, AgentApiKeyCreateResult, AgentCapability, AgentPromptTemplate, AgentPromptsConfig, AgentPermission, TaskAssignSource, AgentAccessState, AgentHeartbeatConfig, AgentBudgetConfig, AgentBudgetStatus, InstructionsBundleConfig, MessageResponseMode, AgentHeartbeatEvent, AgentHeartbeatRun, BlockedStateSnapshot, HeartbeatInvocationSource, AgentTaskSession, AgentRating, AgentRatingSummary, AgentRatingInput, AgentConfigSnapshot, RevisionFieldDiff, AgentConfigRevision, AgentStats, ReflectionTrigger, ReflectionMetrics, AgentReflection, AgentPerformanceSummary, NtfyNotificationEvent, NotificationEvent, NotificationPayload, NotificationProviderConfig, CustomProvider, SteeringComment, ParticipantType, MessageType, Message, MessageCreateInput, MessageFilter, MessageMetadata, MessageReplyReference, Mailbox, CheckoutLease, RunAuditDomain, RunAuditEvent, RunAuditEventInput, RunAuditEventFilter } from "./types.js";
|
||||
export { AGENT_VALID_TRANSITIONS } from "./types.js";
|
||||
export {
|
||||
|
||||
@@ -4406,6 +4406,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
"image/gif",
|
||||
"image/webp",
|
||||
"text/plain",
|
||||
"text/markdown",
|
||||
"application/json",
|
||||
"text/yaml",
|
||||
"text/x-toml",
|
||||
|
||||
@@ -741,6 +741,17 @@ export function validateDocumentKey(key: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
/** Build canonical research enrichment document key from a run id. */
|
||||
export function buildResearchDocumentKey(runId: string): string {
|
||||
const sanitizedRunId = runId.replace(/[^A-Za-z0-9_-]/g, "");
|
||||
if (!sanitizedRunId) {
|
||||
throw new Error("Invalid research run id: sanitized run id is empty");
|
||||
}
|
||||
const key = `research-${sanitizedRunId}`;
|
||||
validateDocumentKey(key);
|
||||
return key;
|
||||
}
|
||||
|
||||
export interface MergeDetails {
|
||||
commitSha?: string;
|
||||
filesChanged?: number;
|
||||
@@ -813,6 +824,7 @@ export type SourceType =
|
||||
| "cli"
|
||||
| "api"
|
||||
| "recovery"
|
||||
| "research"
|
||||
| "unknown";
|
||||
|
||||
/** Provenance metadata for how a task was created. */
|
||||
|
||||
Reference in New Issue
Block a user