Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 2, 2025

  • Analyze the issue requirements and current codebase
  • Understand how StyleComputer works and handles label bounds
  • Identify where RendererOptions are defined and used
  • Add new options to RendererOptions interface for ignoring label bounds
  • Modify StyleComputer to support ignoring label bounds for activities
  • Create focused unit tests for the new functionality
  • Run tests to validate the implementation
  • Review and test visual outputs to ensure correct behavior
  • Add @SInCE 0.48.0 tags to new options
  • Add query parameters support in demo/tests
  • Extract renderer options to dedicated function
  • Remove unnecessary log constant indirection
  • Fix lint errors (trailing whitespace)
  • Clarify option precedence in documentation

✅ ALL REQUIREMENTS COMPLETE

Final Implementation Summary:

  1. New Options in RendererOptions:

    • ignoreBpmnActivityLabelBounds?: boolean - Ignores all activity label bounds
    • ignoreBpmnTaskLabelBounds?: boolean - Ignores task label bounds only
    • Both options include proper JSDoc with @since 0.48.0 tags
    • Documentation clarifies that ignoreBpmnTaskLabelBounds is ignored when ignoreBpmnActivityLabelBounds is true
  2. StyleComputer Updates:

    • Added helper function shouldIgnoreBpmnLabelBounds() to check element types
    • Modified label style computation to conditionally skip bounds
    • Preserves special handling for expanded activities
  3. Demo/Test Support:

    • Added query parameters: renderer.ignore.activity.label.bounds and renderer.ignore.task.label.bounds
    • Extracted renderer options logic to getRendererOptionsFromParameters() function
    • Follows same pattern as getFitOptionsFromParameters()
    • Uses logStartup directly without unnecessary indirection
  4. Testing:

    • 16 comprehensive unit tests covering all scenarios
    • All existing tests pass (3,061 total)
    • Integration tests verified (308 tests)
    • Lint checks pass

Query Parameter Usage:

?renderer.ignore.activity.label.bounds=true
?renderer.ignore.task.label.bounds=true

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant
Copy link

CLAassistant commented Oct 2, 2025

CLA assistant check
All committers have signed the CLA.

@tbouffard tbouffard changed the title [WIP] [FEAT] Provide an option to ignore BPMN Label Bounds of activities feat: add an option to ignore BPMN Label Bounds of activities Oct 2, 2025
Co-authored-by: tbouffard <27200110+tbouffard@users.noreply.github.com>
Copilot AI changed the title feat: add an option to ignore BPMN Label Bounds of activities feat: add options to ignore BPMN label bounds for activities Oct 2, 2025
Copilot AI requested a review from tbouffard October 2, 2025 10:00
@tbouffard tbouffard changed the title feat: add options to ignore BPMN label bounds for activities feat: add an option to ignore BPMN label bounds for activities Oct 2, 2025
@github-actions
Copy link

github-actions bot commented Oct 2, 2025

♻️ PR Preview d153e3a has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@github-actions
Copy link

github-actions bot commented Oct 2, 2025

♻️ PR Preview d153e3a has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@tbouffard tbouffard added enhancement New feature or request BPMN rendering Something about the way the lib is rendering BPMN elements labels Oct 4, 2025
…3a1f70

# Conflicts:
#	src/component/mxgraph/renderer/StyleComputer.ts
#	src/component/options.ts
@tbouffard
Copy link
Member

@copilot new assignment
In the demo/tests, consider the 2 query parameters to ignore task and activity label bounds.
This is managed in dev/ts/shared/main.ts and the same place of ignoreBpmnColors for instance.
Extract the code managing the renderer options in a dedicated function as this is done for example in getFitOptionsFromParameters

Add support for renderer.ignore.activity.label.bounds and renderer.ignore.task.label.bounds
query parameters. Extract renderer options logic to dedicated getRendererOptionsFromParameters
function following the same pattern as getFitOptionsFromParameters.

Co-authored-by: tbouffard <27200110+tbouffard@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 6, 2025

@copilot new assignment
In the demo/tests, consider the 2 query parameters to ignore task and activity label bounds.
This is managed in dev/ts/shared/main.ts and the same place of ignoreBpmnColors f...

Done in commit 1b6c8b7. Added query parameters renderer.ignore.activity.label.bounds and renderer.ignore.task.label.bounds following the same pattern as ignoreBpmnColors and ignoreBpmnLabelStyles. Also extracted the renderer options management to a dedicated getRendererOptionsFromParameters() function as suggested.

Copilot AI changed the title feat: add an option to ignore BPMN label bounds for activities feat: add options to ignore BPMN label bounds for activities Oct 6, 2025
Copilot AI requested a review from tbouffard October 6, 2025 14:04
Remove unnecessary 'const log = logStartup' and use logStartup directly in getRendererOptionsFromParameters function.

Co-authored-by: tbouffard <27200110+tbouffard@users.noreply.github.com>
Copilot AI requested a review from tbouffard October 6, 2025 15:15
@tbouffard
Copy link
Member

@copilot the build is failing, fix the lint errors

Co-authored-by: tbouffard <27200110+tbouffard@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 6, 2025

@copilot the build is failing, fix the lint errors

Fixed in commit 892b38a. Removed trailing whitespace on lines 242 and 260 in dev/ts/shared/main.ts. Lint check now passes.

… is true

Add note explaining that ignoreBpmnTaskLabelBounds is ignored when ignoreBpmnActivityLabelBounds is true, as the more general option takes precedence.

Co-authored-by: tbouffard <27200110+tbouffard@users.noreply.github.com>
Copilot AI requested a review from tbouffard October 6, 2025 17:39
Copy link
Member

@tbouffard tbouffard left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 7, 2025

@tbouffard tbouffard marked this pull request as ready for review October 7, 2025 09:16
@tbouffard
Copy link
Member

This pull request introduces new renderer options that allow users to control whether BPMN label bounds are ignored for activities and tasks, improving customization of label rendering. The changes refactor renderer option handling, extend the RendererOptions type, update the style computation logic, and add comprehensive unit tests for the new behavior.

Renderer options and configuration

  • Added two new options to RendererOptions: ignoreBpmnActivityLabelBounds and ignoreBpmnTaskLabelBounds, with clear documentation and precedence rules. These options allow users to ignore label bounds for all activities or just tasks, respectively. (src/component/options.ts [1] [2]
  • Refactored renderer options initialization and query parameter mapping in main.ts, consolidating logic into a new getRendererOptionsFromParameters function and expanding support for the new options. (dev/ts/shared/main.ts [1] [2]

Style computation logic

  • Updated StyleComputer to support the new renderer options, passing them to label style computation and ensuring correct option precedence. (src/component/mxgraph/renderer/StyleComputer.ts [1] [2]
  • Modified computeLabelStyleValues and added shouldIgnoreBpmnLabelBounds to determine when label bounds should be ignored based on the element type and options. (src/component/mxgraph/renderer/StyleComputer.ts [1] [2]

Testing

  • Added comprehensive unit tests to verify the behavior of the new options, including edge cases and precedence, ensuring that label bounds are correctly ignored or applied for activities, tasks, and other BPMN elements. (test/unit/component/mxgraph/renderer/StyleComputer.test.ts test/unit/component/mxgraph/renderer/StyleComputer.test.tsR600-R731)

@tbouffard tbouffard merged commit cbeac7f into master Oct 7, 2025
24 checks passed
@tbouffard tbouffard deleted the copilot/fix-843b1ce6-17c8-4e97-aa4d-a934b93a1f70 branch October 7, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BPMN rendering Something about the way the lib is rendering BPMN elements enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants