Repository navigation
Modern table views - #103
Conversation
For some reason, PBGitHistoryController’s awake from nib was called very often. The stack trace its called every time a new row inside the historyList is instantiated.
tiennou
left a comment
There was a problem hiding this comment.
Thanks for the PR, I quite like it.
I found one regression, and I'd like to investigate the awakeFromNib issue you've found.
| return; | ||
| } | ||
|
|
||
| _wokeUpFromNib = YES; |
There was a problem hiding this comment.
😭. Okay, I'll have to investigate this…
There was a problem hiding this comment.
I'll take a look at this as well. I am sure there is a better solution to this..
| NSArray *refs = self.objectValue.refs; | ||
| PBGitRef *ref = [refs objectAtIndex:index]; | ||
|
|
||
| NSMutableDictionary* attributes = [self attributesForRefLabelSelected:[self isHighlighted]]; |
There was a problem hiding this comment.
I suspect this breaks the checked-out-branch-as-orange UI label.
There was a problem hiding this comment.
Thanks for the hint! The parameter of this method was never used, so I removed it. The regression was created due to a missing outlet connection to the history controller.
|
I am glad you like it! 😊 I forgot to mention that this is not ready for merging yet. There are more table views (commit view) that can be updated. I plan to do this as well.. |
Also remove some unneeded cell classes
|
Ok, I have migrated the sidebar and commit lists.. Three small things besides the awakeFromNib thing: • Text seems to be blurry on my non-retina in the sidebar |
|
I ironed out the two bugs. |
|
Regarding |
drawLineFromColumn:toColumn:inRect:offset:color: uses NSRectFill instead of NSBezierPath when drawing a straight line. drawCircleInRect: caches the two versions of the commit circles as NSImages and redraws the cached version rather than drawing with new bezier paths each time.
| frame.origin.y = (self.bounds.size.height - frame.size.height) / 2; | ||
| frame.size.width = self.bounds.size.width - frame.origin.x; | ||
|
|
||
| self.textField.frame = frame; |
There was a problem hiding this comment.
It's a little strange to be calling setFrame: on a view inside of drawRect:. It might be better to do this in layout or setObjectValue:. You could split drawRefsInRect: into drawRefsInRect and rectForTextField: so the roles of drawing and calculating view frames are separated.
There was a problem hiding this comment.
👍edit for clarity This is about @ksuther's comment above, that re-framing while display is in progress feels strange.
Optimizations in PBGitRevisionCell drawing
- Move historyController’s awakeFromNib to loadView - Move textField layout to layout method
|
Thank you very much for the review @ksuther ! |
|
👍 Looks good! I get a little bit of choppy scrolling if I try to scroll hundreds of commits at a time, not sure if there's much that can be done about that though. I'm not seeing any obvious targets in Instruments right now (text drawing is taking the fast path and table view row background drawing is taking as much time as anything else). Maybe going 100% layer-backed instead of using drawRect: in PBGitRevisionCell would help, as that would avoid having to call drawRect on the entire table view column. That's probably outside the scope of this PR though :) |
|
Okay, done for today 😉. I've made it "clean" against master because there were nib changes, and I fixed the branch label dragging. Haven't looked at the flickering/slowness though… Note that I almost completely killed |
…eature/fluent-ui # Conflicts: # Classes/Controllers/PBGitHistoryController.m
|
I finally got around to setup an Sierra instance. The flickering seems to come from -[sourceView reloadData]. I guess there is some sort of AppKit bug, with reloading the table the second the user selected a cell, that was fixed in High Sierra. I removed these reload statements for now. I am not sure under which circumstances they would be needed. I assume that this is probably too easy to fix the problem, so I am going to do some deeper analysis on this. @tiennou could you check out if this „solution“ works for you? That way I at least know that I am heading into the right direction.. |
# Conflicts: # Classes/Controllers/PBGitHistoryController.m # Classes/Controllers/PBGitSidebarController.m # Resources/XIBs/PBGitCommitView.xib
If the webview contains a lot of content, the frame rate during resize drops dramatically This disables the webView redraw during live resizes
|
Sorry, I meant to reply yesterday after taking a look but forgot to do so. The flickering source view is gone (at least at the commit you've asked it), but it felt a little sluggish still (though it seems that master shared that behavior, so maybe arrowing through the list of refs triggers a perf breakdown; haven't investigated). One thing I noticed (because I tried to fix the merge conflict you've now fixed) is that the box view around the Amend / Commit button is gone. I'd like to keep it, because sometime™ it will need to be hot-swapped with something else (like Merge, or Abort/Skip/Continue Rebase). It's pretty minor though. Again, thanks for doing all that work, I like the performance improvement of the history view a lot ! |
|
Wow, I messed up the merge and overwrote Elia's changes (78e75b2) I am very sorry about that! |
|
Well, the Sierra fix turns out to be not a fix at all. When checking out a branch, the checkmark is not updated. I currently try to make reloadData work again with the sidebar/sourceList. |
|
I was able to fix that now. The sidebar is behaving as expected on 10.12 and 10.13 for me |
|
I can't think of any more changes that need to be done here. Feel free to review @tiennou! |
|
I just found some UI glitches. Using the table headers results in a wonky layout in the Subject column. Also, resetting the table view to the "normal" mode results in this the first time. It will fix itself on the next branch change though… I'm tempted to merge this as is though, since it's a minor issue… |
|
Also, I'm about to diff --git i/Classes/Views/PBGitRevisionCell.h w/Classes/Views/PBGitRevisionCell.h
index ab0053d3..2e4ab834 100644
--- i/Classes/Views/PBGitRevisionCell.h
+++ w/Classes/Views/PBGitRevisionCell.h
@@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
- (NSRect) rectAtIndex:(int)index;
- (void) drawLabelAtIndex:(int)index inRect:(NSRect)rect;
-@property (copy) PBGitCommit* objectValue;
+@property (strong) PBGitCommit *objectValue;
@end |
|
Ouch, I might be able to fix these in the evening. Sorry for that! |
|
Merging in ! Thank you for being patient, and thanks for the PR ! |

This PR enables layer backing, which results in 60 FPS scrolling of the historyList. This list was also converted into a view based tableView for modernization reasons.
As a side effect, changing the pane sizes using the split view divider or by resizing the window itself is also more fluent.