Skip to content

Add ComfyUI Workspace sidebar with direct prompt and block reuse - #586

Merged
LuqP2 merged 11 commits into
mainfrom
feat/comfyui-context-tools
Oct 12, 2026
Merged

LuqP2 merged 11 commits into
mainfrom
feat/comfyui-context-tools

Conversation

@LuqP2

@LuqP2 LuqP2 commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

The ComfyUI Workspace exposes Image, Prompts and Models in a right-hand panel while preserving the embedded canvas session. Prompts opens saved items first, with navigation ordered Prompts, Blocks, Compose; switching tabs retains the current view and composition.

Saved prompts and blocks can be appended directly from their cards or used to replace the selected node's text through their context menu. Replace selected substitutes only the highlighted fragment and is disabled without a valid node text selection; changed ranges or destinations are rejected. Prompts containing negative text offer separate source actions. A single compatible destination is used immediately; multiple fields require an explicit choice. Writes retain stale-target validation, history notifications and clipboard fallback. Native node text selections can also be saved immediately as prompts or blocks. No queue/run command is issued.

Prompt details are compact, with previous/next navigation, a collapsible image preview that stays open across items, and inline tag editing. The full Prompt Library adds card menus for editing, deleting, duplicating and copying. Editors use one page with optional fillable-text controls: converting a selection into a field inserts its placeholder and definition together, preserving the original text as its default. The full editor reserves the result column from the start. Extracted blocks save with a brief nonmodal confirmation and an Edit block shortcut.

The optional composer preserves isolated drafts, frozen block snapshots and template values. Negative text is optional. Models exposes the existing catalog, trigger words and Inspector; hidden models are excluded from both Model Manager and the Workspace sidebar and can be restored through Hidden.

Validation:

  • 73 targeted synthetic tests passed across 10 suites covering Prompt Library, Workspace, runtime writes, storage and model visibility.
  • TypeScript passed.
  • ESLint on the changed UI/hooks and tests passed with no errors and one unused-variable warning.
  • Diff whitespace checks passed.

The maintainer confirms that the packaged-app smoke test has been completed. No images were generated. ComfyUI's own autoqueue-on-change preference may react to text edits.

Review fixes:

  • Negative-only image prompts now use the standard save workflow, preserving authoritative shadow edits, generation metadata, source date and text basis.
  • Hidden model identities and their copies are excluded from the updates scope and unread counts; unhiding restores them.

Latest validation: 90 targeted tests passed across three suites (model service, Workspace and toast feedback), TypeScript passed, and ESLint reported no errors.

Node action feedback now uses the app toast component: dark background with green success, amber warnings and red failures, clear action titles, optional node/field details and clipboard fallback. Success dismisses after 3 seconds; warnings and failures after 7 seconds. Repeated actions restart the timer. Pending destination selection remains inline.

Scheduled-monitoring review fix: hidden identities are excluded from automatic Civitai and Hugging Face checks and notification totals. Visibility is revalidated for in-flight requests; unhiding preserves monitoring preferences and resumes due checks.

LAN HTTP compatibility review fix: target tokens now use 128 random bits from crypto.getRandomValues instead of crypto.randomUUID, so target lookup and direct editing also work in non-secure ComfyUI origins. All 14 adapter tests passed, including a VM scenario without randomUUID covering target reuse, append, replace and stale-token rejection. The maintainer reports that current manual testing is on a packaged app.

Additional review fixes: Save prompt no longer rejects an image based only on its embedded text; the existing authoritative-shadow save workflow validates the effective prompt. Workspace remounts restore the saved mode and Prompts/Blocks category, including composition, block details and block editing drafts.

Validation for these fixes: 22 targeted tests passed across Workspace context, image preview and prompt composition suites. TypeScript passed; ESLint reported no errors and two existing explicit-any warnings. Regression coverage includes empty embedded text with a shadow prompt and repeated Workspace unmount/remount without saving or losing drafts.

Additional persistence review fix: Both image-save storage paths (SQLite desktop repository and browser IndexedDB) now accept negative-only prompts and reject only pairs whose two texts are blank. Regression tests cover literal text and editor metadata preservation, exact duplicate detection, empty-pair rejection, retrieval, and desktop database reopen.

Validation for this fix: 21 targeted tests passed across savedPromptRepository, savedPromptStorage, and useSavePrompt. Targeted ESLint reported zero errors and one existing unused-variable warning in savedPromptStorage. git diff --check passed.

Latest review fix: Use in composer now reads authoritative persisted shadow metadata and validates the effective positive/negative pair through the shared prompt workflow. Shadow-only text and negative-only text are supported; literal whitespace is retained, and a pending read cannot open the previous image after navigation.

Validation: 10 focused synthetic tests passed across WorkspaceImageInspector composer and ComfyUIWorkspace preview suites. Targeted ESLint reported zero errors and one pre-existing explicit-any warning. Diff whitespace checks passed.

Workspace remount follow-up: Clean block editors are now retained in the Workspace session, including an existing block opened for editing and a new block with no field changes. Cancel clears the retained editor. Two regression cases fail with the former initializer and pass with the fix; all 12 Workspace context tests pass. Targeted ESLint and diff whitespace checks pass.

@LuqP2
LuqP2 marked this pull request as ready for review October 12, 2026 04:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T21:10:59.674460Z ba5564c New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1c73dafa7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/comfyui/WorkspaceImageInspector.tsx Outdated
Comment thread components/ModelsWorkspace.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d3a2bb8712

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread services/modelLibrary/manager.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ac7cc462a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread electron.mjs
Comment thread services/comfyTextRuntime.mjs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b1f019f21

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/comfyui/WorkspaceImageInspector.tsx Outdated
Comment thread components/comfyui/WorkspacePrompts.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94e09cdb95

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread hooks/useSavePrompt.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02328686d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/comfyui/WorkspaceImageInspector.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c41d69dad8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/comfyui/WorkspacePrompts.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba5564ce31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

else sendPrompt(target, channel, action);
}} onUse={(target, channel) => 'text' in target ? sendBlock(target) : sendPrompt(target, channel)} scrollOffset={session.offset} onScrollOffset={offset => { if (active && mode === 'browse') session.offset = offset; }} />}
</div>
{item && <div hidden={mode !== 'details'} className={`min-h-0 flex-1 ${mode === 'details' ? '' : 'hidden'}`}><PromptDetails workspace onSendSelection={text => { setActionError(''); void direct.send(text); }} key={item.id} item={item} onClose={() => setMode('browse')} onEdit={() => replaceEditor(item, kind)} onFavorite={() => favorite(item)} onDuplicate={() => duplicateItem(item)} onRemove={() => removeItem(item)} onPrevious={currentIndex > 0 ? () => navigate(-1) : undefined} onNext={currentIndex >= 0 && currentIndex < visible.length - 1 ? () => navigate(1) : undefined} position={currentIndex >= 0 ? `${currentIndex + 1}/${visible.length}` : undefined} onDuplicates={onOpenLibrary} onViewSource={onViewSource} renderActions={result => <NodeItemActions key={item.id} result={result} busy={direct.busy} onSend={(text, mode) => { setActionError(''); void direct.send(text, mode); }} />} renderSecondaryActions={() => <button className="text-xs text-gray-400 hover:text-accent" onClick={() => 'text' in item ? addBlock(item, 'positive') : useBase(item)}>Use in Compose</button>} /></div>}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Open the selected item before checking duplicates

Choosing “Check duplicates” from a Workspace item's action menu only invokes onOpenLibrary, which switches to the full Prompt Library without updating selectedPromptId, selecting the relevant prompt/block kind, or enabling showDuplicates. The user therefore lands on whichever item and view were previously active, and no duplicate check is shown for the item they invoked the action on; pass the item identity through and initialize the full library's duplicate view, or remove this misleading action.

Useful? React with 👍 / 👎.

@LuqP2
LuqP2 merged commit 8f70fd7 into main Oct 12, 2026
1 check passed
@LuqP2
LuqP2 deleted the feat/comfyui-context-tools branch October 13, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant