Skip to content

fix(automation-button): forward alert frame slots through abstract button - #995

Draft
tibnor wants to merge 4 commits into
developfrom
claude/funny-mayer-55myeg
Draft

fix(automation-button): forward alert frame slots through abstract button#995
tibnor wants to merge 4 commits into
developfrom
claude/funny-mayer-55myeg

Conversation

@tibnor

@tibnor tibnor commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

The abstract automation button rendered the underlying obc-automation-button
but only forwarded the badge slots. Slotted alert-frame content (icon, label,
timer) placed on a device such as obc-analog-valve never reached the alert
frame, so it could not be shown.

Forward the slots all the way down, remapping the public alert-frame-icon /
alert-frame-label / alert-frame-timer slots onto the automation button's
alert-icon / alert-label / alert-timer slots (which in turn feed the alert
frame's icon / label / timer slots). Document these slots on
ObcAbstractAutomationButton rather than on each device component.

Add an analog valve story that shows a bottom-flip alert frame with a custom
icon, an alert label and a clock, and add its visual baseline.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01XWMYJ6JF3jpspmmoQMNt6m

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced alert-frame support by forwarding alert icon, label, and timer slot content for automation buttons, enabling fully customizable alert visuals.
  • Documentation

    • Added new Storybook examples demonstrating alert-frame behavior with custom icons and bottom/side flip alert frame types.

…tton

The abstract automation button rendered the underlying obc-automation-button
but only forwarded the badge slots. Slotted alert-frame content (icon, label,
timer) placed on a device such as obc-analog-valve never reached the alert
frame, so it could not be shown.

Forward the slots all the way down, remapping the public alert-frame-icon /
alert-frame-label / alert-frame-timer slots onto the automation button's
alert-icon / alert-label / alert-timer slots (which in turn feed the alert
frame's icon / label / timer slots). Document these slots on
ObcAbstractAutomationButton rather than on each device component.

Add an analog valve story that shows a bottom-flip alert frame with a custom
icon, an alert label and a clock, and add its visual baseline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWMYJ6JF3jpspmmoQMNt6m
@tibnor
tibnor requested review from jon-daeh and ulrik-jo as code owners June 21, 2026 18:44
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a54e27c4-fb13-46b8-94fc-5f0468dd73ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

ObcAbstractAutomationButton gains three forwarded named slots—alert-frame-icon, alert-frame-label, and alert-frame-timer—mapped to alert-icon, alert-label, and alert-timer on the inner <obc-automation-button>. A JSDoc block documents the slot contract. Storybook stories on analog-valve and automation-tank demonstrate the feature with different alert frame types and icon configurations.

Changes

Alert-frame slot forwarding

Layer / File(s) Summary
Slot forwarding implementation and JSDoc
packages/openbridge-webcomponents/src/automation/automation-button/abstract-automation-button.ts
Adds a class-level JSDoc block documenting alert-frame-icon, alert-frame-label, and alert-frame-timer slot behavior. Updates render() to forward those three slots onto alert-icon, alert-label, and alert-timer of the inner <obc-automation-button>.
Storybook stories demonstrating alert-frame slots
packages/openbridge-webcomponents/src/automation/analog-valve/analog-valve.stories.ts, packages/openbridge-webcomponents/src/automation/automation-tank/automation-tank.stories.ts
Adds AlertFrameWithIcon story to analog-valve with a pressure icon in the alert-frame-icon slot and LargeSideFlip frame type. Adds WithAlertBottomFlip story to automation-tank with custom alert-icon, alert-label, and alert-timer slot content and BottomFlip frame type. Both stories import supporting icon and timer components.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • jon-daeh
  • ulrik-jo
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(automation-button): forward alert frame slots through abstract button' accurately summarizes the main change—forwarding alert-frame slots through the abstract automation button component to fix slot content visibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/funny-mayer-55myeg

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/openbridge-webcomponents/src/automation/analog-valve/analog-valve.stories.ts`:
- Around line 68-73: Remove the story-level JSDoc block comment from the
analog-valve.stories.ts file that starts with "The analog valve forwards..." and
explains the alert frame slots and bottom-flip frame type. This multi-line
comment block (beginning with /** and ending with */) should be completely
deleted as it is self-explanatory and conflicts with the repository's coding
guidelines that restrict comments to only necessary cases for unusual or complex
code.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 45fe93bf-ab32-4c60-8c67-cbfc93ecce2c

📥 Commits

Reviewing files that changed from the base of the PR and between 6142e02 and fc87d93.

⛔ Files ignored due to path filters (1)
  • packages/openbridge-webcomponents/__vis__/linux/__baselines__/automation/analog-valve/analog-valve.stories.ts/alert-frame-with-icon-label-and-clock-auto.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • packages/openbridge-webcomponents/src/automation/analog-valve/analog-valve.stories.ts
  • packages/openbridge-webcomponents/src/automation/automation-button/abstract-automation-button.ts

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

…ories

Switch the analog valve alert story to a large-side-flip frame with a
pressure icon, which suits a valve alarm and fits the valve's small symbol
(the side flap has room for an icon but not a label/clock).

Add an equivalent tank story using a bottom-flip frame, which the larger tank
has room for: it shows a tank icon, a label and a clock via the tank's
alert-icon / alert-label / alert-timer slots.

Update the visual baselines accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWMYJ6JF3jpspmmoQMNt6m
@tibnor
tibnor marked this pull request as draft June 21, 2026 19:12

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/openbridge-webcomponents/src/automation/automation-tank/automation-tank.stories.ts`:
- Around line 489-495: Remove the JSDoc comment block that explains the alarm
alert frame story functionality. This multi-line comment block documenting the
story's behavior violates the repository's coding guideline that prohibits
comments in TypeScript/JavaScript files unless the code is extremely unusual and
impossible to understand without explanation. Delete the entire comment block
starting with the opening /** and ending with the closing */ that precedes the
story implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 51113edf-793b-4f08-af33-8228dda5be61

📥 Commits

Reviewing files that changed from the base of the PR and between fc87d93 and 91628dd.

⛔ Files ignored due to path filters (2)
  • packages/openbridge-webcomponents/__vis__/linux/__baselines__/automation/analog-valve/analog-valve.stories.ts/alert-frame-with-icon-auto.png is excluded by !**/*.png
  • packages/openbridge-webcomponents/__vis__/linux/__baselines__/automation/automation-tank/automation-tank.stories.ts/with-alert-bottom-flip-auto.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • packages/openbridge-webcomponents/src/automation/analog-valve/analog-valve.stories.ts
  • packages/openbridge-webcomponents/src/automation/automation-tank/automation-tank.stories.ts

claude added 2 commits June 22, 2026 04:31
Remove the description comments above the new analog valve and tank alert
stories to follow the repository's no-comments rule for TS files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWMYJ6JF3jpspmmoQMNt6m
…ning types

Rename the device-level alert-frame slots to alert-icon / alert-label /
alert-timer so they match the slot names already used by obc-automation-button
(and obc-automation-tank).

Previously the alert-icon / alert-label / alert-timer slots were only exposed
for `point` positioning; the `symbol` and `button` paths wrapped the content
with wrapWithAlertFrame, which did not forward the slots. Render the alert
frame through a shared renderAlertFrame() helper in both paths so slotted icon,
label and timer content reaches the frame for every positioning value.

Update the analog valve story and add an automation-button story that exercises
the slots with `button` positioning, plus its visual baseline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWMYJ6JF3jpspmmoQMNt6m
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