Skip to content

Fix: The prompt variable for the agent operator disappears after input. - #15218

Merged
yingfeng merged 1 commit into
infiniflow:mainfrom
cike8899:fix-search-required
May 25, 2026
Merged

yingfeng merged 1 commit into
infiniflow:mainfrom
cike8899:fix-search-required

Conversation

@cike8899

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Fix: The prompt variable for the agent operator disappears after input.

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 25, 2026
@cike8899 cike8899 added the ci Continue Integration label May 25, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 304bc716-3a49-4315-bca5-76080e379511

📥 Commits

Reviewing files that changed from the base of the PR and between af85aa9 and f988476.

📒 Files selected for processing (4)
  • web/src/global.less
  • web/src/pages/agent/form/agent-form/index.tsx
  • web/src/pages/agent/form/code-form/next-variable.tsx
  • web/src/pages/agent/hooks/use-save-on-blur.ts
💤 Files with no reviewable changes (2)
  • web/src/pages/agent/hooks/use-save-on-blur.ts
  • web/src/pages/agent/form/agent-form/index.tsx

📝 Walkthrough

Walkthrough

This PR removes the useSaveOnBlur hook entirely and updates form controls to use explicit button props. Additionally, highlight styling is modernized to use CSS variables with alpha blending instead of hardcoded colors.

Changes

Highlight Styling Modernization

Layer / File(s) Summary
CSS variable migration for highlights
web/src/global.less
.Highlight--scrolledTo .Highlight__part and .Highlight__part now use rgb(var(--accent-primary) / ...) with opacity 0.5 and 0.1 instead of hardcoded background colors.

Form Behavior and Control Cleanup

Layer / File(s) Summary
Delete useSaveOnBlur hook
web/src/pages/agent/hooks/use-save-on-blur.ts
Removed entire module containing exported useSaveOnBlur hook, its React imports, and useCallback wiring that called saveGraph() on blur.
Remove hook usage from agent form
web/src/pages/agent/form/agent-form/index.tsx
Removed useSaveOnBlur import statement, deleted local handleSaveOnBlur extraction, and removed onBlur={handleSaveOnBlur} handlers from both PromptEditor instances (system prompt and user prompts fields).
Explicit button props in dynamic variable form
web/src/pages/agent/form/code-form/next-variable.tsx
Remove button now explicitly specifies variant="ghost", type="button", and onClick={() => remove(index)}; add variable button now explicitly specifies type="button" and onClick={() => append({ name: '', type: undefined })}.

🎯 2 (Simple) | ⏱️ ~12 minutes

size:M

🐰 A hook hops away, styles find their way,
Buttons stand explicit in the light of day,
Blur-save no more, the form flows clean,
Variables dance where controls have been! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main bug being fixed - prompt variables disappearing after input in the agent operator.
Description check ✅ Passed The description follows the template with both required sections completed: problem statement and type of change (Bug Fix) are present.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cike8899
cike8899 marked this pull request as draft May 25, 2026 11:20
@cike8899
cike8899 marked this pull request as ready for review May 25, 2026 11:20
@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.12%. Comparing base (af85aa9) to head (f988476).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15218   +/-   ##
=======================================
  Coverage   93.12%   93.12%           
=======================================
  Files          10       10           
  Lines         713      713           
  Branches      116      116           
=======================================
  Hits          664      664           
  Misses         29       29           
  Partials       20       20           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yingfeng
yingfeng merged commit ed179ce into infiniflow:main May 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants