The purpose was to render text with a shadow and fade the text when the window is inactive, but the former has not been used since 10.10 and the latter doesn’t actually seem to work.
Ideally I would like to have the FileItem class be the public API, as that will then take care of updating the icon’s SCM status etc., current commit is just a temporary fix for missing document icons on 10.14.
When we observe a change on disk we will fetch status after 0.5 seconds if we are active, otherwise 3 seconds.
If we become active and have a pending update, we update immediately.
The reason for the delay is that the change on disk could be the version control system working, for example performing a rebase, and not all systems can gracefully handle requesting status when in the midst of such operation.
Currently SCMManager is not as conservative about refreshing SCM status, specifically SCM status was previously not updated when the application was inactive, the latency for updating was pretty high (3 seconds).
We do however need to check if there are actual changes, as at least in the past, calling `hg` even when there are no changes, may cause file system to be updated, which will trigger a new status refresh.
Originally we had FSEventsManager handle directory loading because it worked as a cache, but it’s better to move this to the client, as not all clients need the directory content, additionally it simplifies the cache invalidation (reload) and also moves the hardcoded list of URL keys to preload into the client, which should know which keys are desired.
Also, switch to use the new divider styles in most places. The remaining usage of the old "OakCreateLine" functions are in the OakChooser windows. These will be refactor for better dark mode support next.
Insert and remove could still be done, but the re-ordering does not scale as we currently use an LCS algorithm that require N*M storage.
Long-term my thinking is that we can limit animated re-ordering to only include the visible rows, but my initial attempt at this showed some issues with the NSOutlineView, as re-ordering non-visible items still require a reload, which had visible side-effects.
File packages are still sorted together with regular files rather than moved to the top.
To enable, run: defaults write com.macromates.TextMate allowExpandingPackages -bool YES
This is largely copy/paste from OFBOutlineView.mm.
This adds keyboard support, delegate methods that include whether or not expand/collapse includes children, and a delegate method for when items are dragged to the trash.
FileItem objects will automatically update their SCMStatus and icon based on the properties of the object, but the item’s children (and arranged children) needs to be set externally.
The reason is that to properly sync insert/remove animations with changes to a item’s children, updating the children should be done by the same controller that updates the outline view.
This is based on the somewhat new block-based NSImage rendering API which simplifies things tremendously compared to our existing OakFileIconImage.
Like with the SCMManager class, this new API is limited to a future file browser, as for example images need to update themselves when SCM status or document’s modified state changes, but the NSImage class itself has no way to indicate that it needs to be redrawn, therefore the places we show images should bind to a file item which will then be responsible for updating its image property when the document state changes.