Skip to content

Conversation

@Steve-Mcl
Copy link
Contributor

Description

Add missing class field to audio node like all other nodes in the package - to permit user styling

NOTE: the audio node class is only relevant when mode is src (i.e. a player is rendered)

Tests

Adds 100% unit test coverage

image
▼ ui-audio node
  ▼ audio player mode
    ✔ audio player should be loaded
    ✔ should default to mode 'src'
    ✔ should call RED.nodes.createNode with node and ui-group config
    ✔ should be registered with the ui-base
    ✔ should be registered with the ui-base with the correct values
    ✔ should call node.error when group is not configured
    ✔ should fail to register if group is not found
    ▼ onInput hook
      ✔ should store message when source is supplied in payload
      ✔ should not store message when source is not supplied in payload
      ✔ should passthru message when passthru is enabled
      ✔ should not passthru message when passthru is disabled
    ▼ beforeSend hook
      ✔ should return the msg
      ✔ should warn if playback==play and src is not a string and no previous message
      ✔ should not do dynamic updates if no dynamic updates are present in the msg
      ✔ should do dynamic updates if dynamic updates are present in the msg
      ✔ should call node.error when  dynamic updates value is bad
  ▼ tts player mode
    ✔ tts player should be loaded
    ✔ should be registered with the ui-base
    ✔ should be registered with the ui-base with the correct values
    ✔ should fail to register if base is not found
    ✔ should call RED.nodes.createNode with node and ui-base config
    ✔ should call node.error when ui is not configured
    ▼ onInput hook
      ✔ Calls send when passthru is enabled
      ✔ Does not call send when passthru is disabled
    ▼ beforeSend hook
      ✔ should clean up the datastore

Related Issue(s)

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds a missing className field to the ui-audio node to enable user styling, bringing it in line with other widgets in the package. The change only applies when the audio node is in "src" mode (audio player mode), not in "tts" (text-to-speech) mode.

Changes:

  • Added className configuration field to ui-audio node with localization support
  • Implemented comprehensive unit test coverage (100%) for both audio player and TTS modes
  • Fixed datastore cleanup in TTS mode (changed from non-existent remove method to clear and added statestore.reset)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
nodes/widgets/ui_audio.html Added className field to node configuration UI with i18n support
nodes/widgets/ui_audio.js Fixed TTS mode cleanup to use correct datastore.clear and statestore.reset methods
nodes/widgets/locales/en-US/ui_audio.json Added English translations for className field
nodes/widgets/locales/de/ui_audio.json Added German translations for className field
test/nodes/widgets/ui_audio.spec.js Added comprehensive test suite with 100% coverage for audio node
test/nodes/utils.js Added utility functions for testing widget registration
package.json Added test coverage scripts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Steve-Mcl Steve-Mcl mentioned this pull request Jan 18, 2026
11 tasks
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Steve-Mcl Steve-Mcl requested a review from cstns January 18, 2026 15:01
@Steve-Mcl
Copy link
Contributor Author

@colinl I added class field to the audio widget (was missing)

If you have a moment to review and test, it would be appreciated.

@cstns added as review for flowfuse sign off.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@colinl
Copy link
Collaborator

colinl commented Jan 18, 2026

Sorry @Steve-Mcl I am out of action for a couple of weeks.

@Steve-Mcl
Copy link
Contributor Author

@cstns any chance of a review here please?

@cstns
Copy link
Contributor

cstns commented Jan 19, 2026

I had it on my radar this morning and it managed to slip through the cracks.. I'll do it first thing tomorrow

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.

4 participants