Skip to content

feat(workflowengine): add name, description and collapsible UI to flow rules#60981

Open
letmefixthiscode wants to merge 1 commit into
nextcloud:masterfrom
letmefixthiscode:feat/workflowengine-rule-name-description
Open

feat(workflowengine): add name, description and collapsible UI to flow rules#60981
letmefixthiscode wants to merge 1 commit into
nextcloud:masterfrom
letmefixthiscode:feat/workflowengine-rule-name-description

Conversation

@letmefixthiscode
Copy link
Copy Markdown

Summary

Rules were always rendered expanded, making the list unmanageable when
more than a handful of rules were configured. Users had to scroll through
all editors just to locate a specific rule.

Each rule now shows a collapsible header displaying its name, falling back
to "Unnamed flow". Saved rules collapse by default; new unsaved rules expand
automatically. A description field (up to 4000 bytes) is available inside
the expanded rule editor.

Changes:
- New `name` (max 256 bytes) and `description` (max 4000 bytes) fields on flow rules
- DB migration adding optional `description` TEXT column to `flow_operations`
- API: both fields passed through OCS controllers and validated in Manager
- UI: collapsible rule cards with name in the header
- Unit tests for name/description length validation
image image

Checklist

AI

  • [x ] The content of this PR was partly or fully generated using AI

…w rules

Rules were always rendered expanded, making the list unmanageable when
more than a handful of rules were configured. Users had to scroll
through all editors just to locate a specific rule.

Each rule now shows a collapsible header with its name, falling back to
"Unnamed flow". Saved rules collapse by default; new unsaved rules
expand automatically. A description field is available inside the
expanded rule editor.

Signed-off-by: Dominic Blaß <letmefixthis.code@gmail.com>
@letmefixthiscode letmefixthiscode requested review from ArtificialOwl, artonge, come-nc, nfebe, sorbaugh and susnux and removed request for a team June 4, 2026 11:15
Copy link
Copy Markdown
Collaborator

@artonge artonge left a comment

Choose a reason for hiding this comment

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

cc @nextcloud/designers to review whether this need changes.
and cc @salmart-dev for awareness.


$table = $schema->getTable('flow_operations');
if (!$table->hasColumn('description')) {
$table->addColumn('description', Types::TEXT, [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As the description is limited in length, shouldn't it be a Types::STRING with a 'length' => 4000 like the name column?

Copy link
Copy Markdown
Author

@letmefixthiscode letmefixthiscode Jun 5, 2026

Choose a reason for hiding this comment

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

look here:

// Adjust STRING columns with a length higher than 4000 to TEXT (clob)
>4000 is converted to text (so yeah i have 4000 not >4000 - so should i use Types::STRING or remove the 4000 limit?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe @Altahrim has an idea of what's the best solution

Comment on lines -37 to -38
:model-value="inputValue"
@update:model-value="updateOperationByEvent" />
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the change needed?

@input="updateOperation" />
</Operation>
<div class="buttons">
<NcButton v-if="rule.id < -1 || dirty" @click="cancelRule">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Was the condition wrong?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

for me its way more clear to check rule.id < 1 (because in the database we have 1..n) the code was not checking for 0 .. or -1 - also in the old code had rule.id < -1 and rule.id < 0 checks

<component :is="expanded ? 'MenuUp' : 'MenuDown'" :size="20" />
</span>
</button>
<div v-show="expanded" :id="bodyId" class="rule__body">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would the <details> HTML component reduce the custom logic and improve accessibility?

Comment on lines +154 to +155
nameMaxLength: NAME_MAX_LENGTH,
descriptionMaxLength: DESCRIPTION_MAX_LENGTH,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As it is used in only one location, we can skip creating global variables and use the value directly in the HTML template.

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.

2 participants