feat(FN-3950): reorder task form sections and document github tracking plac

Reorganized the TaskForm to move the GitHub tracking section and locked the create-form section order, with tests verifying the new layout and documentation added for the tracking placement in the dashboard guide.

Fusion-Task-Id: FN-3950
This commit is contained in:
Fusion
2026-05-10 16:07:52 -07:00
committed by gsxdsm
parent 8b56dff8b0
commit 60d16aa267
5 changed files with 60 additions and 38 deletions

View File

@@ -999,43 +999,6 @@ export function TaskForm({
</div>
)}
{(onGithubTrackingEnabledChange || onGithubRepoOverrideChange) && (
<div className="form-group" data-testid="task-form-github-tracking">
<label>GitHub Tracking</label>
{onGithubTrackingEnabledChange && (
<label className="checkbox-label" htmlFor="task-github-tracking-enabled">
<input
id="task-github-tracking-enabled"
type="checkbox"
checked={githubTrackingEnabled === true}
onChange={(event) => {
githubTrackingDefaultAppliedRef.current = true;
onGithubTrackingEnabledChange(event.target.checked);
}}
disabled={disabled}
/>
Enable GitHub issue tracking for this task
</label>
)}
{onGithubRepoOverrideChange && (
<>
<label htmlFor="task-github-repo-override" className="model-select-label">Repository (owner/repo)</label>
<input
id="task-github-repo-override"
className="input"
value={githubRepoOverride || ""}
onChange={(event) => onGithubRepoOverrideChange(event.target.value)}
placeholder={effectiveGithubRepoDefault || "owner/repo"}
disabled={disabled}
/>
{githubRepoOverrideInvalid ? (
<div className="form-error">Repository must be in owner/repo format.</div>
) : null}
</>
)}
</div>
)}
{/* Model Selection */}
<div className="form-group">
<label>Model Configuration</label>
@@ -1315,6 +1278,43 @@ export function TaskForm({
</div>
)}
</div>
{(onGithubTrackingEnabledChange || onGithubRepoOverrideChange) && (
<div className="form-group" data-testid="task-form-github-tracking">
<label>GitHub Tracking</label>
{onGithubTrackingEnabledChange && (
<label className="checkbox-label" htmlFor="task-github-tracking-enabled">
<input
id="task-github-tracking-enabled"
type="checkbox"
checked={githubTrackingEnabled === true}
onChange={(event) => {
githubTrackingDefaultAppliedRef.current = true;
onGithubTrackingEnabledChange(event.target.checked);
}}
disabled={disabled}
/>
Enable GitHub issue tracking for this task
</label>
)}
{onGithubRepoOverrideChange && (
<>
<label htmlFor="task-github-repo-override" className="model-select-label">Repository (owner/repo)</label>
<input
id="task-github-repo-override"
className="input"
value={githubRepoOverride || ""}
onChange={(event) => onGithubRepoOverrideChange(event.target.value)}
placeholder={effectiveGithubRepoDefault || "owner/repo"}
disabled={disabled}
/>
{githubRepoOverrideInvalid ? (
<div className="form-error">Repository must be in owner/repo format.</div>
) : null}
</>
)}
</div>
)}
</div>
</div>
);

View File

@@ -1071,6 +1071,19 @@ describe("NewTaskModal", () => {
});
describe("GitHub tracking", () => {
it("renders GitHub tracking after Workflow Steps in more options", async () => {
renderNewTaskModal();
fireEvent.click(screen.getByTestId("task-form-more-options-toggle"));
const workflowLabel = await screen.findByText("Workflow Steps");
const githubTrackingSection = screen.getByTestId("task-form-github-tracking");
expect(
workflowLabel.compareDocumentPosition(githubTrackingSection) & Node.DOCUMENT_POSITION_FOLLOWING,
).toBe(Node.DOCUMENT_POSITION_FOLLOWING);
});
it("seeds tracking toggle from project settings and submits githubTracking payload", async () => {
const { fetchSettings } = await import("../../api");
vi.mocked(fetchSettings).mockResolvedValueOnce({

View File

@@ -1439,6 +1439,10 @@ describe("TaskForm focus behavior (FN-1459)", () => {
it("renders renderBelowModelConfiguration content below model section in More options", async () => {
renderTaskForm({
renderBelowModelConfiguration: <div data-testid="injected-below-model">Bottom slot content</div>,
githubTrackingEnabled: false,
onGithubTrackingEnabledChange: vi.fn(),
githubRepoOverride: "",
onGithubRepoOverrideChange: vi.fn(),
});
const toggle = screen.getByTestId("task-form-more-options-toggle");
@@ -1451,6 +1455,7 @@ describe("TaskForm focus behavior (FN-1459)", () => {
const modelLabel = screen.getByText("Model Configuration");
const workflowLabel = screen.getByText("Workflow Steps");
const injectedBottom = screen.getByTestId("injected-below-model");
const githubTrackingSection = screen.getByTestId("task-form-github-tracking");
expect(
modelLabel.compareDocumentPosition(injectedBottom) & Node.DOCUMENT_POSITION_FOLLOWING,
@@ -1458,6 +1463,9 @@ describe("TaskForm focus behavior (FN-1459)", () => {
expect(
injectedBottom.compareDocumentPosition(workflowLabel) & Node.DOCUMENT_POSITION_FOLLOWING,
).toBe(Node.DOCUMENT_POSITION_FOLLOWING);
expect(
workflowLabel.compareDocumentPosition(githubTrackingSection) & Node.DOCUMENT_POSITION_FOLLOWING,
).toBe(Node.DOCUMENT_POSITION_FOLLOWING);
});
it("hides dependencies section when hideDependencies is true", async () => {