Skip to content

Miscellaneous yak-shaving regarding actions and rendering in Cocoa DetailedList#4448

Draft
johnzhou721 wants to merge 9 commits into
beeware:mainfrom
johnzhou721:detailedlist-yaks
Draft

Miscellaneous yak-shaving regarding actions and rendering in Cocoa DetailedList#4448
johnzhou721 wants to merge 9 commits into
beeware:mainfrom
johnzhou721:detailedlist-yaks

Conversation

@johnzhou721
Copy link
Copy Markdown
Contributor

@johnzhou721 johnzhou721 commented Jun 4, 2026

Multiple yaks shaved in Cocoa DetailedList, since this is a case where a small number of lines that can do a lot of things.

Bugs fixed:

  • macOS DetailedList: Use swipe-to-reveal actions a la iOS #4416 is an issue where swiping left and right doesn't reveal actions. However, some digging in the header file points at a broader issue that we're using the old "cell-based" renderers, rather than the new "view-based" renders. Significant amounts of this PR is switching to the new mechanism; there's also a function (tableView_rowActionsForRow_edge_) for adding the new actions.
  • Voiceover hint for macOS DetailedList items isn't helpful #2506 gets fixed free using the above view-based rendering; worked well in my testing, as the layout auto-reads the texts in the correct order.
  • I noticed spontaneously that the popup mechanism is way too complex; we do not need to handle mouse clicks -- the menu proprety of the DetailedList automatically displays on any right click in any item — we can just override the menu attribute, which is technically a getter; however, overriding getter for menu is an established pattern (see https://stackoverflow.com/questions/72367017/implementing-context-menu-for-nstablecellview), and makes the code simpler as we don't have to rebuild the menu every time primary/secondary is enabled and disabled in the future.
    As a side effect of using the native property, we get the ability to perform actions on a nonselected item, and also get the proper border styling on context menu click on an item we do select:
  • Since I'm touching the context menu anyways, might as well fix DetailedList refresh view can't be activated on macOS 14 (Sonoma) #2412 by just adding an extra divider and menu item -- see screenshot above.

Screenshot demo (swipe to reveal actions, correct menu styling and menu on unselected, and refresh menu item):

image

TODO: Tests

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

Assisted-by: ChatGPT, GitHub Copilot

@johnzhou721
Copy link
Copy Markdown
Contributor Author

Two things:

  1. This is eseentially a done body of work, but please keep it in Draft as I already have 3 PRs that need reviews. When those get merged, I'll make this PR ready.
  2. Not sure what is going on with RtD -- it doesn't appear to be something caused in this PR, but it doesn't seem intermittent. If anyone has any idea of what is going on, let me know, but since this is still in draft there's no obligation for anyone to investigate.

@johnzhou721 johnzhou721 force-pushed the detailedlist-yaks branch 2 times, most recently from 6274179 to 58ca3f7 Compare June 5, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant