diff --git a/.changeset/fn-7181-pr-generation-prompt-and-loading.md b/.changeset/fn-7181-pr-generation-prompt-and-loading.md new file mode 100644 index 0000000000..2756660e73 --- /dev/null +++ b/.changeset/fn-7181-pr-generation-prompt-and-loading.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": minor +--- + +summary: Improve AI-generated PR titles and descriptions, and show a clear loading state while the description generates. +category: feature +dev: Rewrote the pr-metadata-generator system/context prompt (exported as a named default constant) for grounded, conventional-commit-style output while preserving the strict {title,summary,changes,testing,linkedTask} JSON schema; PrCreateModal now renders a skeleton + aria-busy loading affordance with disabled inputs during generation that clears into content or the existing error/manual-fallback path. diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md index ac1e5b3117..11fa16dde0 100644 --- a/docs/dashboard-guide.md +++ b/docs/dashboard-guide.md @@ -1004,7 +1004,7 @@ Inspect task definition, logs, review feedback, comments, artifacts, workflow ou - The **Create Pull Request** modal is a floating pop-out like Plan Mission, New Task, and Automations: drag its header or resize from desktop edges/corners, while mobile keeps the full-screen dialog layout. Close it with **X**, **Cancel**, or **Escape**; stray clicks inside or outside the floating shell do not dismiss it. - The modal shell renders immediately: preflight checks and PR options load independently of AI-generated title/body metadata, so slow AI suggestions no longer block base-branch selection, diagnostics, or manual PR authoring. The **Diff & commit preview** section starts collapsed and can be expanded on demand. - The **Body** section includes a **Preview/Edit** toggle so authors can review the rendered markdown description before creating the PR without changing the submitted raw body text. -- AI title/body generation in the dialog is bounded to 15 seconds and is canceled if the request disconnects; on timeout/cancel, Fusion falls back to deterministic task-based PR title/body content instead of leaving the spinner stuck forever. +- AI title/body generation is bounded to 60 seconds on the server and 15 seconds in the dialog, and is canceled if the request disconnects; while it runs, the title and body fields show a skeleton loading state and are temporarily disabled, then resolve into generated content or deterministic task-based fallback content on timeout/cancel. - Project Settings → Project Models includes optional **PR title prompt guidance** and **PR description prompt guidance** fields. Blank fields preserve the default Create PR metadata prompt; populated fields append guidance for the generated title or body sections. - The **Artifacts** tab combines task documents written by agents or users with task-scoped registered media artifacts. The gallery uses thumbnail-first image/video cards, image and video previews can expand into a dismissible full-size lightbox, video and audio use native controls, document artifacts show text previews, and generic artifacts open through their media URL. - The **Review** tab is separate from **Comments**: Review shows actionable PR/reviewer feedback and same-task revision controls, while Comments remains the general collaboration thread. diff --git a/packages/dashboard/app/components/PrCreateModal.css b/packages/dashboard/app/components/PrCreateModal.css index 4531afbd41..9de1571af1 100644 --- a/packages/dashboard/app/components/PrCreateModal.css +++ b/packages/dashboard/app/components/PrCreateModal.css @@ -179,6 +179,68 @@ FN-7170 hosts Create PR in FloatingWindow: desktop geometry belongs to the share margin-bottom: 0; } +.pr-create-modal__field-shell { + position: relative; +} + +.pr-create-modal__field-shell > .input:disabled { + cursor: wait; +} + +.pr-create-modal__metadata-skeleton { + position: absolute; + inset: var(--btn-border-width); + pointer-events: none; + border-radius: var(--radius-md); + background: color-mix(in srgb, var(--border) 70%, var(--surface)); + animation: pr-create-modal-skeleton-pulse 1.4s ease-in-out infinite; +} + +.pr-create-modal__metadata-skeleton--title { + inline-size: min(100%, calc(var(--space-2xl) * 7)); +} + +.pr-create-modal__metadata-skeleton--body { + display: flex; + flex-direction: column; + gap: var(--space-sm); + padding: var(--space-md); + background: color-mix(in srgb, var(--surface) 82%, var(--border)); +} + +.pr-create-modal__metadata-skeleton--body span { + display: block; + block-size: var(--space-md); + border-radius: var(--radius-sm); + background: color-mix(in srgb, var(--border) 72%, var(--surface)); +} + +.pr-create-modal__metadata-skeleton--body span:nth-child(1) { + inline-size: 92%; +} + +.pr-create-modal__metadata-skeleton--body span:nth-child(2) { + inline-size: 78%; +} + +.pr-create-modal__metadata-skeleton--body span:nth-child(3) { + inline-size: 88%; +} + +.pr-create-modal__metadata-skeleton--body span:nth-child(4) { + inline-size: 64%; +} + +@keyframes pr-create-modal-skeleton-pulse { + 0%, 100% { + opacity: 0.58; + } + + 50% { + opacity: 1; + } +} + .pr-create-template-hint { margin: 0; color: var(--text-muted); diff --git a/packages/dashboard/app/components/PrCreateModal.tsx b/packages/dashboard/app/components/PrCreateModal.tsx index 57642ebfb8..8102557fc4 100644 --- a/packages/dashboard/app/components/PrCreateModal.tsx +++ b/packages/dashboard/app/components/PrCreateModal.tsx @@ -640,7 +640,11 @@ export function PrCreateModal({ ) : null} -
+ {/** + * FNXC:PrCreateModal 2026-06-28-00:09: + * PR title/body generation must read as active description work, not as empty editable fields. Keep both fields disabled with aria-busy plus a skeleton while metadataLoading is true, then clear the affordance into AI content or the existing metadataError/manual-fallback state. + */} +
@@ -650,10 +654,20 @@ export function PrCreateModal({
{metadataLoading ?
: null} {metadataError ?

{metadataError}

: null} - { setTitle(event.target.value); setUserEditedTitle(true); }} /> +
+ { setTitle(event.target.value); setUserEditedTitle(true); }} + disabled={metadataLoading} + aria-busy={metadataLoading ? "true" : undefined} + /> + {metadataLoading ?
-
+
@@ -675,13 +689,34 @@ export function PrCreateModal({ {/** * FNXC:PrCreateModal 2026-06-28-00:00: * PR authors need to preview description markdown before creating the PR. The preview is render-only, uses the shared sanitized markdown pipeline, and submission/regeneration/revert always read and write the raw `body` state. + * + * FNXC:PrCreateModal 2026-06-28-00:16: + * While AI metadata is generating, disable raw editing and show skeleton affordances even when Preview is selected so users see that the submitted body is still pending generation. */} - {showBodyPreview ? ( + {showBodyPreview && !metadataLoading ? (
{body}
) : ( -