Skip to content

feat(joint-core): allow mvc.View to override the joint- class-name prefix#3310

Merged
Geliogabalus merged 1 commit into
clientIO:masterfrom
kumilingus:feat/view-classname-prefix
May 13, 2026
Merged

feat(joint-core): allow mvc.View to override the joint- class-name prefix#3310
Geliogabalus merged 1 commit into
clientIO:masterfrom
kumilingus:feat/view-classname-prefix

Conversation

@kumilingus
Copy link
Copy Markdown
Contributor

Summary

  • New classNamePrefix property on mvc.View (defaults to config.classNamePrefix); set to '' to opt out of prefixing or to a custom string to replace it.
  • util.addClassNamePrefix / util.removeClassNamePrefix accept an optional prefix argument; falsey prefix is a no-op.
  • Theme class still uses the global joint- prefix, independent of the view's classNamePrefix.

Test plan

  • QUnit tests added for util.addClassNamePrefix (custom prefix, multi-name, empty/null no-op, idempotency)
  • QUnit tests added for util.removeClassNamePrefix (custom prefix, multi-name, empty/null no-op, cross-prefix isolation)
  • QUnit tests added for mvc.View classNamePrefix override (default, custom, empty opt-out, multi-name, idempotency, SVG element, theme independence)
  • yarn grunt karma:joint — 1969/1969 pass

🤖 Generated with Claude Code

…efix

Adds an opt-in `classNamePrefix` property on `mvc.View` (defaults to
`config.classNamePrefix`) and threads it through `util.addClassNamePrefix`
and `util.removeClassNamePrefix` via an optional second argument. Setting
`classNamePrefix: ''` lets a subclass opt out of prefixing entirely; the
theme class still uses the global `joint-` prefix.

Includes QUnit coverage for the new util argument and for the View
override behavior (default, custom, empty, multi-name, idempotency, SVG,
theme independence).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Geliogabalus Geliogabalus merged commit 0a39977 into clientIO:master May 13, 2026
3 checks passed
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