Skip to content

refactor: normalize ShowAddButton to IsAddButtonVisible#296

Merged
codemonkeychris merged 2 commits into
mainfrom
fix/268-boolean-modifier-naming
May 19, 2026
Merged

refactor: normalize ShowAddButton to IsAddButtonVisible#296
codemonkeychris merged 2 commits into
mainfrom
fix/268-boolean-modifier-naming

Conversation

@sundaramramaswamy
Copy link
Copy Markdown
Collaborator

@sundaramramaswamy sundaramramaswamy commented May 14, 2026

Rename ShowAddButton()IsAddButtonVisible() to align with WinUI's Is* naming convention for boolean properties (Control.IsTabStop, TabView.IsAddTabButtonVisible, etc.).

  • IsTabStop — kept as-is (already matches WinUI naming per review feedback)
  • ShowAddButtonIsAddButtonVisible (imperative verb → Is* boolean)
  • Old ShowAddButton kept as [Obsolete] shim for backward compatibility
  • reactor.api.txt updated in both locations

Fixes #268

Copy link
Copy Markdown
Collaborator

@codemonkeychris codemonkeychris left a comment

Choose a reason for hiding this comment

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

I think we should align with the WinUI names, IsXXX

@sundaramramaswamy sundaramramaswamy force-pushed the fix/268-boolean-modifier-naming branch from 241c120 to b9b7452 Compare May 15, 2026 06:52
@sundaramramaswamy sundaramramaswamy changed the title refactor: normalize boolean modifier naming to bare adjectives refactor: normalize ShowAddButton to IsAddButtonVisible May 15, 2026
@sundaramramaswamy
Copy link
Copy Markdown
Collaborator Author

sundaramramaswamy commented May 15, 2026

@codemonkeychris Addressed — updated to align with WinUI's Is* naming convention:

  • IsTabStop stays as-is (already matches Control.IsTabStop)
  • ShowAddButtonIsAddButtonVisible (matches TabView.IsAddTabButtonVisible pattern)

Force-pushed with the narrower scope.

@sundaramramaswamy
Copy link
Copy Markdown
Collaborator Author

sundaramramaswamy commented May 15, 2026

Thanks for the direction, Chris. Agreed on ShowAddButton — that's clearly an imperative outlier and is now IsAddButtonVisible.

For the remaining adjective modifiers (Disabled, Editable, Selectable, Closable, Active), wanted to surface a trade-off before expanding scope:

The adjective forms are sugar over the Is* record properties — e.g. Closable(false) sets IsClosable = false, Editable() sets IsEditable = true. Renaming these to IsClosable(), IsEditable(), IsActive() is straightforward.

The one case that doesn't map cleanly is Disabled(). The WinUI property is IsEnabled — opposite polarity. Today you write Button("Save").Disabled(), which reads naturally. The Is* equivalent would be IsEnabled(false), which loses the ergonomic default.

Should we do (1) or (2)?

  1. rename all five to Is* (with IsEnabled(false) replacing Disabled())
  2. rename the four that map directly (EditableIsEditable, ClosableIsClosable, ActiveIsActive, SelectableIsTextSelectionEnabled) and keep Disabled as-is since it inverts IsEnabled?

@codemonkeychris
Copy link
Copy Markdown
Collaborator

The one case that doesn't map cleanly is Disabled(). The WinUI property is IsEnabled — opposite polarity. Today you write Button("Save").Disabled(), which reads naturally. The Is* equivalent would be IsEnabled(false), which loses the ergonomic default.

Please look at the equivalent in WinUI and follow the pattern to align.

@sundaramramaswamy
Copy link
Copy Markdown
Collaborator Author

@codemonkeychris Addressed your feedback — all boolean modifiers now use exact WinUI property names (IsEnabled, IsReadOnly, IsEditable, IsClosable, IsActive, IsVisible, IsTextSelectionEnabled, IsDisabledFocusable, IsLightDismissEnabled, IsAddTabButtonVisible). Old names kept as [Obsolete] shims. Ready for re-review when you get a chance.

sundaramramaswamy and others added 2 commits May 19, 2026 20:25
Rename ShowAddButton() -> IsAddButtonVisible() to align with WinUI's
Is* naming convention for boolean properties.

Keep IsTabStop() as-is (already matches WinUI naming).
Old ShowAddButton kept as [Obsolete] shim for backward compat.

Fixes #268

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename all boolean-style fluent modifiers to align with
WinUI property names per reviewer feedback:

- Visible -> IsVisible
- Disabled -> IsEnabled (inverted)
- Selectable -> IsTextSelectionEnabled
- ReadOnly -> IsReadOnly (TextField, RatingControl)
- Editable -> IsEditable
- Closable -> IsClosable
- Active -> IsActive
- DisabledFocusable -> IsDisabledFocusable
- LightDismiss -> IsLightDismissEnabled
- IsAddButtonVisible/ShowAddButton -> IsAddTabButtonVisible

Old names kept as [Obsolete] shims. All first-party code
migrated. API surface files updated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sundaramramaswamy sundaramramaswamy force-pushed the fix/268-boolean-modifier-naming branch from f0c4558 to a54e2ef Compare May 19, 2026 15:01
@codemonkeychris codemonkeychris merged commit f89e031 into main May 19, 2026
9 checks passed
@codemonkeychris codemonkeychris deleted the fix/268-boolean-modifier-naming branch May 19, 2026 16:26
codemonkeychris added a commit that referenced this pull request May 19, 2026
#342)

Migrates the remaining doc-pipeline templates, doc apps, and compiled
guide pages to the WinUI-aligned boolean modifier names introduced in
#296 / #268:

  .Visible            -> .IsVisible
  .Disabled(x)        -> .IsEnabled(!x)         (inverted)
  .Selectable         -> .IsTextSelectionEnabled
  .ReadOnly           -> .IsReadOnly
  .Editable           -> .IsEditable
  .Closable           -> .IsClosable
  .Active             -> .IsActive
  .DisabledFocusable  -> .IsDisabledFocusable
  .LightDismiss       -> .IsLightDismissEnabled

The original PR migrated first-party code, samples, and a handful of
doc apps. This sweep covers the rest: 8 remaining doc apps, 8
templates, and the 10 compiled guide pages that reference them.
Compiled output regenerated with `mur docs compile` (recipes pages
patched in place to preserve their inlined snippets).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

API consistency: boolean-style modifiers mix adjective, Is*, and imperative naming

2 participants