MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / TaskSidebarRow

Function TaskSidebarRow

packages/app-core/src/components/Sidebar.tsx:5142–5195  ·  view source on GitHub ↗
({
  active,
  onClick,
  label,
  sidebarIdx,
  vimHighlight,
  sidebarFocused = false,
}: {
  active: boolean;
  onClick: () => void;
  label: string;
  sidebarIdx?: number;
  vimHighlight?: boolean;
  sidebarFocused?: boolean;
})

Source from the content-addressed store, hash-verified

5140// Top-level utility row. These align their icon center to the folder chevron
5141// rail, but do not reserve a full fake chevron slot.
5142function TaskSidebarRow({
5143 active,
5144 onClick,
5145 label,
5146 sidebarIdx,
5147 vimHighlight,
5148 sidebarFocused = false,
5149}: {
5150 active: boolean;
5151 onClick: () => void;
5152 label: string;
5153 sidebarIdx?: number;
5154 vimHighlight?: boolean;
5155 sidebarFocused?: boolean;
5156}): JSX.Element {
5157 const strongActive = active && (!sidebarFocused || !!vimHighlight);
5158 return (
5159 <div
5160 role="button"
5161 tabIndex={0}
5162 onClick={onClick}
5163 onKeyDown={(e) => {
5164 if (e.key === "Enter" || e.key === " ") {
5165 e.preventDefault();
5166 onClick();
5167 }
5168 }}
5169 className={[
5170 "group flex h-[var(--z-sidebar-row-h)] items-center gap-1.5 rounded-lg px-1 text-left text-sm outline-none transition-colors focus:outline-none",
5171 active
5172 ? vimHighlight
5173 ? "vim-cursor-on-active bg-paper-300/70 text-ink-900 font-medium"
5174 : sidebarFocused
5175 ? "text-accent"
5176 : "bg-paper-300/70 text-ink-900 font-medium"
5177 : vimHighlight
5178 ? "vim-cursor"
5179 : "text-ink-800 hover:bg-paper-200/70",
5180 ].join(" ")}
5181 style={{ paddingLeft: 4 }}
5182 {...(sidebarIdx != null
5183 ? {
5184 "data-sidebar-idx": sidebarIdx,
5185 "data-sidebar-type": "tasks",
5186 }
5187 : {})}
5188 >
5189 <SidebarGlyph active={strongActive} rowActive={active}>
5190 <CheckSquareIcon width={12} height={12} strokeWidth={2.15} />
5191 </SidebarGlyph>
5192 <span className="flex-1 truncate">{label}</span>
5193 </div>
5194 );
5195}
5196
5197// A single favorited note/folder row. Sets the same data-sidebar-* attributes
5198// as a regular note/folder row so the shared Vim activation (Enter) and the

Callers

nothing calls this directly

Calls 1

onClickFunction · 0.70

Tested by

no test coverage detected