Skip to content

feat: support editable class labels in question classifier#35430

Merged
Blackoutta merged 5 commits into
langgenius:mainfrom
Blackoutta:blackoutta/question-classifier-labels-dify
May 10, 2026
Merged

feat: support editable class labels in question classifier#35430
Blackoutta merged 5 commits into
langgenius:mainfrom
Blackoutta:blackoutta/question-classifier-labels-dify

Conversation

@Blackoutta
Copy link
Copy Markdown
Contributor

@Blackoutta Blackoutta commented Apr 20, 2026

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

Fixes #35429

Refs #33806
Supersedes #34075
Companion Graphon branch: langgenius/graphon:blackoutta/question-classifier-labels-graphon
Companion Graphon PR URL: https://github.com/langgenius/graphon/pull/new/blackoutta/question-classifier-labels-graphon

This recreates the Dify-side portion of editable Question Classifier labels after the workflow runtime moved into graphon.

The UI now treats Question Classifier branch data as three separate concepts:

  • id: stable branch identifier for routing/handles
  • name: classifier-facing category description used for prompt logic and preserved as class_name
  • label: user-facing branch title shown in the editor, canvas, and preview

Included changes:

  • adds inline editing for Question Classifier branch labels
  • preserves existing class_name semantics for downstream descriptive output
  • exposes class_label in Question Classifier output configuration
  • updates node and preview rendering to display label with sensible CLASS N fallbacks
  • adds frontend tests covering editing, rendering, and output behavior
  • includes panel-specific regression fixes required by the Question Classifier editing flow

This branch was validated locally against an editable Graphon checkout wired through uv.

From Codex

Screenshots

Before After
Branch titles were fixed to CLASS N in the UI. Branch titles can be edited independently from the classifier description text.
568930390-9e754181-e731-4700-aca8-c5399a02b7e7

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and cd web && pnpm exec vp staged (frontend) to appease the lint gods

@github-actions github-actions Bot added the web This relates to changes on the web. label Apr 20, 2026
@autofix-ci
Copy link
Copy Markdown
Contributor

autofix-ci Bot commented Apr 20, 2026

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

@Blackoutta Blackoutta force-pushed the blackoutta/question-classifier-labels-dify branch from 63f111f to b1a6d66 Compare April 20, 2026 09:41
Copy link
Copy Markdown
Contributor Author

Heads-up on merge order for this feature: this PR depends on the runtime/schema changes landing in Graphon first.

Even though the Dify-side UI is ready, we should wait until the companion Graphon PR is merged and a new Graphon version is released before merging this PR. After that, this PR should be updated to bump graphon in api/pyproject.toml to the released version and rerun CI against that published package.

Without that release order, users can see/edit the new classifier labels in the UI, but workflow execution may still run against an older Graphon runtime that does not fully support the new label / class_label behavior.

So the intended sequence is:

  1. Merge the Graphon PR
  2. Cut a new Graphon release
  3. Update this Dify PR to the released Graphon version
  4. Merge this PR

Companion Graphon PR: https://github.com/langgenius/graphon/pull/new/blackoutta/question-classifier-labels-graphon

@Blackoutta Blackoutta marked this pull request as ready for review April 20, 2026 11:49
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. 🌊 feat:workflow Workflow related stuff. 💪 enhancement New feature or request labels Apr 20, 2026
crazywoola
crazywoola previously approved these changes Apr 21, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 21, 2026
@Blackoutta Blackoutta self-assigned this Apr 21, 2026
@crazywoola crazywoola added this pull request to the merge queue Apr 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 27, 2026
@Blackoutta Blackoutta force-pushed the blackoutta/question-classifier-labels-dify branch from 7614bd5 to 92a2858 Compare May 10, 2026 10:44
@Blackoutta Blackoutta added this pull request to the merge queue May 10, 2026
Merged via the queue into langgenius:main with commit b95e6f6 May 10, 2026
52 of 53 checks passed
@Blackoutta Blackoutta deleted the blackoutta/question-classifier-labels-dify branch May 10, 2026 12:17
@RiskeyL
Copy link
Copy Markdown
Contributor

RiskeyL commented May 11, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 enhancement New feature or request 🌊 feat:workflow Workflow related stuff. lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support editable question classifier labels after the Graphon runtime split

3 participants