Miscellaneous yak-shaving regarding actions and rendering in Cocoa DetailedList#4448
Draft
johnzhou721 wants to merge 9 commits into
Draft
Miscellaneous yak-shaving regarding actions and rendering in Cocoa DetailedList#4448johnzhou721 wants to merge 9 commits into
johnzhou721 wants to merge 9 commits into
Conversation
Contributor
Author
|
Two things:
|
6274179 to
58ca3f7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
tableView_rowActionsForRow_edge_) for adding the new actions.menuproprety of the DetailedList automatically displays on any right click in any item — we can just override themenuattribute, which is technically a getter; however, overriding getter formenuis 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:
Screenshot demo (swipe to reveal actions, correct menu styling and menu on unselected, and refresh menu item):
TODO: Tests
PR Checklist:
Assisted-by: ChatGPT, GitHub Copilot