ConditionViewer

GithubStorybook

The ConditionViewer components render a read-only summary of a set of rules — one boxed sentence per rule, nested under the operator that combines them.

Anatomy

[WIP image]

Anatomy elements
#RequiredElementDescription
1GroupA set of conditions combined under one operator.
2DescriptorThe sentence saying how the group combines — the operator reads as a badge inside it.
3Collapse toggleShows and hides the conditions inside the group.
4Group actionsThe way into editing the set, at the far end of the header.
5ConditionOne rule, as a boxed sentence.
6MarkerA coin naming the kind of thing the rule is about.
7SentenceThe rule in words, with the values that carry meaning emphasized.
8Detail chipsThe sub-conditions one rule is refined by.
9Condition actionsWhat sits beside a rule rather than inside its sentence — a warning, a cost indicator.

Guidelines

ConditionViewer vs. DescriptionList and Table

  • ConditionViewer shows a set of rules and how they combine, where the shape of the logic is part of the meaning.
  • DescriptionList pairs labels with values. Reach for it when the entries are independent facts, not a rule set.
  • Table compares many rows across the same columns. Reach for it when scanning down a column matters more than reading each row as a sentence.

The distinction is the boolean structure. A rule set nests, and the nesting is what a reader needs to understand; neither of the alternatives can express it.

Reading, not editing

These components render the view state only. They have no inputs, no controls beyond collapsing, and no opinion about how a rule is changed — the way into editing belongs in the group's actions, pointing at whatever editor the application provides.

What Pluma does not know

Every word is the application's. Pluma sets no wording for operators, no icon per rule type, no counts, and does no recursion — it renders the boxes, the typography, the spacing and the semantics, and nothing else. Two applications summarizing the same rules will look identical and read differently, which is the intent.

Best practices

Emphasis

Emphasize the parts a reader scans for — field names, values, entity names — and leave the grammar plain. Emphasizing everything is the same as emphasizing nothing.

company is acme
Do: Emphasize the values that carry meaning; leave the connecting words plain.
company is acme
Don't: Don't emphasize the whole sentence — nothing stands out and the rule is harder to scan.

Markers

Keep markers consistent across a set: one color, varying only by what the rule is about. Recolor a marker only to flag a rule that needs attention, such as one referring to something that no longer exists.

company is acme
In Paying Customers segment
Do: One marker color across the set, so the icons read as a category rather than a status.
company is acme
In Paying Customers segment
Don't: Don't vary marker color per rule type — color then looks like status and the flagged rule loses its signal.

Nesting

The outermost group carries no surface or border; every group below it does. That contrast is what makes depth legible, so a nested group always needs its nested treatment — and the outermost one never does, or the whole summary sits in a box within a box.

Matches
all
of 2 conditions
company is acme
Matches
any
of 1 condition
test_event performed
Do: Nested groups take the surface and border; the outermost stays plain.
Matches
all
of 2 conditions
company is acme
Matches
any
of 1 condition
test_event performed
Don't: Don't leave a nested group plain — the depth disappears and the two levels read as one list.

Configurations

In Paying Customers segment
Condition on its own

A single rule with no group around it. Use it where a rule is one fact among others rather than part of a set.

Matches
all
of 2 conditions
company is acme
In Paying Customers segment
Group of conditions

The common case: a descriptor saying how the rules combine, then the rules.

test_event_2 performed and matches all:
foo is bar
plan is one of pro, enterprise
Condition with sub-conditions

A rule refined by others. The lead-in ends the sentence and the chips sit below it.

Appearance

Inline

A condition fills the width it is given. Inline conditions hug their content instead, for a rule shown beside other content rather than as part of a list.

In Paying Customers segment
Full width

The default. Use it for a list of rules, where the boxes should line up.

In Paying Customers segment
Inline

Hugs its content. Use it inside a card or beside other content, where a full-width box would look empty.

Markers

The marker names the kind of thing a rule is about. It is decorative — the sentence already says what the rule concerns — so it never carries meaning a reader would otherwise miss. A rule given no marker is fine; its sentence simply starts at the box's edge.

test_event performed
With a marker

The usual case. Pick an icon for the kind of thing the rule is about.

test_event performed
Without a marker

Use it where the rules are all of one kind and an icon per row would only add noise.

Trailing actions

Actions sit at the trailing edge, aligned with the marker, and stay put as the sentence wraps. Use them for what belongs beside a rule rather than inside it.

missing_event performed
Flagged condition

A rule that needs attention — one referring to something that no longer exists, for example.

Matches
all
of 1 condition
company is acme
Group actions

The way into editing the set, at the far end of the group's header.

Behaviors

Collapsing

A group can be collapsible, which puts a toggle before its descriptor. Collapsing removes the conditions rather than hiding them, so they leave the tab order with everything else — a collapsed group is genuinely absent, not invisible.

Reach for collapsing where a summary is long enough that a reader needs to skim it. A short set is easier to read whole.

Matches
all
of 1 condition
company is acme
Open

The default for a collapsible group.

Matches
all
of 1 condition
Collapsed

The descriptor stays, so the group still says what it holds.

Wrapping

Condition text is machine-generated — event names, URLs, attribute values — so it wraps rather than overflowing, breaking mid-token where a long value leaves no other choice. The marker and the trailing actions stay against the first line as the sentence grows, so a tall condition doesn't leave them floating in the middle.

Detail chips wrap as a row and each hugs its own content, so a long chip takes a line to itself rather than stretching its neighbors.

Content

The wording is entirely the application's, which makes consistency its responsibility too. Phrase the same kind of rule the same way everywhere it appears.

Descriptors

Write a group's descriptor as a sentence with the operator reading as a badge inside it — Matches all of 4 conditions. Say how many conditions the group holds; a reader deciding whether to expand a collapsed group has only the descriptor to go on.

Sentences

Write each rule as a sentence a person would say out loud, not as a field-operator-value triple. A rule does not have to start with a field.

Has viewed a screen matching /home/ at least 6 times
Do: Reads as a sentence, with the emphasis on the values.
page_views gte 6
Don't: Don't expose the raw operator — it reads as a database query rather than a rule.

Sub-condition lead-ins

End the rule's own sentence with the lead-in — and matches all: — so it reads as one phrase with the chips below it. A second, differently described set of chips takes its own label, which necessarily starts a new line.