Skip to content

Commit 06f3130

Browse files
committed
Comments/stylistic tweaks
1 parent bb54fea commit 06f3130

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

src/components/BookmarkBar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ export function BookmarkBar(): BookmarkBarComponent {
1515
// Add BookmarkNodes one at a time until they can't fit in the bookmark
1616
// bar and then create a folder with the overflowing items
1717
const resize = () => {
18-
// remove all child nodes
18+
// Remove all child nodes
1919
root.textContent = '';
2020

2121
let otherBookmarksFolder;
22-
// XXX: None of the elements we're measuring have a border or margin so
22+
// NOTE: None of the elements we're measuring have a border or margin so
2323
// we can use clientWidth instead of offsetWidth for better performance
2424
let currentWidth = 0;
2525

src/components/BookmarkNode.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ function FolderPopup(
2525
let left: number;
2626

2727
if (topLevel) {
28-
// show top level folder popup bellow its parent
28+
// Show top level folder popup bellow its parent
2929
top = parentRect.bottom;
3030
left = parentRect.left;
3131
} else {
32-
// show nested folder popup beside its parent
32+
// Show nested folder popup beside its parent
3333
top = parentRect.top;
3434
left = parentRect.right;
3535
}
@@ -49,14 +49,15 @@ function FolderPopup(
4949
// TODO: Although popup position somewhat works it's still buggy in many
5050
// scenarios especially in folders with scrollbars
5151

52-
// should be called directly after mounting component to the DOM
52+
// Only after the component is mounted in the DOM do we have element size
53+
// information so final position adjustment is split into a separate step
5354
root.adjustPosition = () => {
5455
const viewportWidth = document.documentElement.clientWidth;
5556
const width = root.offsetWidth;
5657

5758
if (left + width > viewportWidth) {
58-
// show top level aligned to the right edge of the viewport
59-
// show nested show to the left of its parent
59+
// Show top level aligned to the right edge of the viewport
60+
// Show nested show to the left of its parent
6061
root.style.left = topLevel
6162
? viewportWidth - width + 'px'
6263
: parentRect.left - width + 'px';
@@ -106,7 +107,7 @@ export function Folder(item: FolderProps): FolderComponent {
106107
if (!popup) {
107108
const parent = root.parentNode as Element;
108109

109-
// immediately close any folder popups on the parent level
110+
// Immediately close any folder popups on the parent level
110111
parent
111112
.querySelectorAll<FolderComponent>('.f')
112113
.forEach((folder) => folder.closePopup());

src/components/SearchResult.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function SearchResult<T extends LinkProps>(
4747
append((isOpenTabs ? TabLink : Link)(item), frag);
4848
});
4949

50-
// remove all child nodes
50+
// Remove all child nodes
5151
l.textContent = '';
5252

5353
append(frag, l);

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// when updating also update references that get an item by index
1+
// NOTE: When updating also update references that get an item by index
22
export const SECTION_DEFAULT_ORDER = [
33
'Open Tabs',
44
'Bookmarks',

0 commit comments

Comments
 (0)