Skip to content

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

Open
letmefixthiscode wants to merge 2 commits 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 2 commits 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

@letmefixthiscode letmefixthiscode requested review from ArtificialOwl, artonge, come-nc, nfebe, sorbaugh and susnux and removed request for a team June 4, 2026 11:15

@artonge artonge left a comment

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.

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?

@letmefixthiscode letmefixthiscode Jun 5, 2026

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.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A long description sounds okay and I don't see why we would have to strictly limit it?

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.

@susnux susnux added the community pull requests from community label Jun 9, 2026
@susnux susnux added this to the Nextcloud 35 milestone Jun 9, 2026
DB auto-increment starts at 1; new rules get a negative timestamp as
temporary id (-(new Date().getTime())), so id < 0 was close but
semantically wrong, and id < -1 in the Cancel button never matched
a brand-new rule at all.

Aligning all three guards (dirty init, Cancel visibility, cancelRule
branch) plus the store's POST-vs-PUT decision to id < 1 makes the
contract explicit: anything below 1 is a client-side draft.

Signed-off-by: Dominic Blaß <letmefixthis.code@gmail.com>
…w rules

- Add optional name (max 256 chars) and description (no limit) fields to flow rules
- Collapse saved rules; auto-expand new unsaved rules using native HTML5 <details>/<summary>
- Remove custom toggle logic and aria-expanded in favour of native details semantics
- Drop MAX_DESCRIPTION_BYTES backend validation (description is now unbounded)
- Add DB migration adding nullable TEXT description column to flow_operations

Signed-off-by: Dominic Blaß <letmefixthis.code@gmail.com>
@letmefixthiscode letmefixthiscode force-pushed the feat/workflowengine-rule-name-description branch from d8e01f8 to 1c4d728 Compare June 11, 2026 15:21

@nickvergessen nickvergessen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Backend change is fine

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

Labels

community pull requests from community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants