Skip to content

refactor: consolidate navigation features into a single module#3316

Merged
tbouffard merged 4 commits into
masterfrom
refactor/navigation_move_code_from_BpmnGraph
Apr 14, 2025
Merged

refactor: consolidate navigation features into a single module#3316
tbouffard merged 4 commits into
masterfrom
refactor/navigation_move_code_from_BpmnGraph

Conversation

@tbouffard

@tbouffard tbouffard commented Apr 8, 2025

Copy link
Copy Markdown
Member

Previously, navigation functionality was spread across multiple classes:

  • GraphConfigurator for panning
  • BpmnGraph for mxGraph overrides (zoom and fit methods) and mouse event handling
  • Navigation for zoom and fit API

This refactoring:

  • Centralizes all navigation-related code in one module
  • Establishes clearer responsibilities using composition over inheritance
  • Improves code organization and readability
  • Paves the way for future extensibility (e.g., plugin system or extension points)

BpmnVisualization only exposed the Navigation type for its navigation property.
Navigation is now an interface instead of a class, with no impact on usage. Users were not supposed to rely on the
previous class implementation.

Notes

This should help to implement #848
As a reminder, #2671 moved all the code to BpmnGraph which increased a lot the responsibility of this class.

Previously, navigation functionality was spread across multiple classes:
- `GraphConfigurator` for panning
- `BpmnGraph` for mxGraph overrides (zoom and fit methods) and mouse event handling
- `Navigation` for zoom and fit API

This refactoring:
- Centralizes all navigation-related code in one module
- Establishes clearer responsibilities using composition over inheritance
- Improves code organization and readability
- Paves the way for future extensibility (e.g., plugin system or extension points)

`BpmnVisualization` only exposed the `Navigation` type for its navigation property.
`Navigation` is now an interface instead of a class, with no impact on usage. Users were not supposed to rely on the
previous class implementation.
@tbouffard tbouffard added the refactoring Code refactoring label Apr 8, 2025
@github-actions

github-actions Bot commented Apr 8, 2025

Copy link
Copy Markdown

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

🤖 By surge-preview

@github-actions

github-actions Bot commented Apr 8, 2025

Copy link
Copy Markdown

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

🤖 By surge-preview

Comment thread src/component/navigation.ts Outdated
Comment thread src/component/navigation.ts Outdated
@sonarqubecloud

Copy link
Copy Markdown

@tbouffard tbouffard marked this pull request as ready for review April 14, 2025 09:02
@tbouffard tbouffard merged commit 6b3b4b2 into master Apr 14, 2025
@tbouffard tbouffard deleted the refactor/navigation_move_code_from_BpmnGraph branch April 14, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant