Skip to content

refactor: normalize ShowAddButton to IsAddButtonVisible - #296

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

Chris Anderson (codemonkeychris) merged 2 commits into
mainfrom
fix/268-boolean-modifier-naming

Conversation

@sundaramramaswamy

@sundaramramaswamy Sundaram Ramaswamy (sundaramramaswamy) commented May 14, 2026 •

Copy link
Copy Markdown
Collaborator

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)
  • ShowAddButton → IsAddButtonVisible (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

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 Sundaram Ramaswamy (sundaramramaswamy) changed the title refactor: normalize boolean modifier naming to bare adjectives refactor: normalize ShowAddButton to IsAddButtonVisible May 15, 2026
@sundaramramaswamy

Sundaram Ramaswamy (sundaramramaswamy) commented May 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

  • IsTabStop stays as-is (already matches Control.IsTabStop)
  • ShowAddButton → IsAddButtonVisible (matches TabView.IsAddTabButtonVisible pattern)

Force-pushed with the narrower scope.

@sundaramramaswamy

Sundaram Ramaswamy (sundaramramaswamy) commented May 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

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 (Editable → IsEditable, Closable → IsClosable, Active → IsActive, Selectable → IsTextSelectionEnabled) 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

Chris Anderson (@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.

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>
@codemonkeychris
Chris Anderson (codemonkeychris) merged commit f89e031 into main May 19, 2026
9 checks passed
@codemonkeychris
Chris Anderson (codemonkeychris) deleted the fix/268-boolean-modifier-naming branch May 19, 2026 16:26
Chris Anderson (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