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

Function select

packages/shared/src/components/BookmarkFeedLayout.tsx:529–546  ·  view source on GitHub ↗
(post?: Post, { focus = true } = {})

Source from the content-addressed store, hash-verified

527 ?.focus({ preventScroll: true });
528
529 const select = (post?: Post, { focus = true } = {}) => {
530 if (!post) {
531 return;
532 }
533
534 if (post.id !== currentId && window.scrollY > 0) {
535 // A new post starts at the top, as a new page does.
536 window.scrollTo(0, 0);
537 }
538 setSelectedId(post.id);
539 setSelectedPost(post);
540 if (post.id !== queryPostId) {
541 replaceQuery({ post: post.id });
542 }
543 if (focus) {
544 focusRow(post.id);
545 }
546 };
547
548 // Taking the selected post out of the list moves the pane to its neighbor
549 const moveSelectionFrom = (post: Post) => {

Callers 3

moveSelectionFromFunction · 0.70
onKeyDownFunction · 0.70
BookmarkFeedLayoutFunction · 0.70

Calls 2

replaceQueryFunction · 0.85
focusRowFunction · 0.70

Tested by

no test coverage detected