MCPcopy Create free account
hub / github.com/dailydotdev/apps / reveal

Function reveal

packages/shared/src/components/shell/ShellRow.tsx:81–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79 };
80
81 const reveal = () => {
82 placeBar();
83 const lit = row.querySelector(litSelector);
84
85 if (!row.clientWidth || !lit) {
86 return;
87 }
88
89 // Not scrollIntoView: it would also scroll the page to a row below the fold.
90 const rowBox = row.getBoundingClientRect();
91 const litBox = lit.getBoundingClientRect();
92
93 if (litBox.right > rowBox.right - rowInset) {
94 row.scrollLeft += litBox.right - rowBox.right + rowInset;
95 } else if (litBox.left < rowBox.left + rowInset) {
96 row.scrollLeft -= rowBox.left + rowInset - litBox.left;
97 }
98 };
99
100 reveal();
101 const mutations = new MutationObserver(reveal);

Callers 1

ShellRowFunction · 0.70

Calls 1

placeBarFunction · 0.85

Tested by

no test coverage detected