MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / OwnerPath

Function OwnerPath

packages/frontend/src/structure.tsx:829–912  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

827
828
829export const OwnerPath: s.Component = () => {
830 const {inspector, hovered} = useAppCtx()
831 const structure = useStructure()
832
833 let container!: HTMLDivElement
834 const rem = useRemSize()
835 const containerSize = createElementSize(() => container)
836 const expandable = (): boolean => (containerSize.height ?? 0) > rem() * path_height_in_rem
837
838 const path = s.createMemo(() => {
839 const node = structure.inspectedNode()
840 return node ? structure.getNodePath(node) : []
841 })
842
843 return (
844 <div class={`relative w-full shrink-0 flex ${path_height_class}`}>
845 <div
846 class={`group
847 absolute z-1 bottom-0 inset-x-0 w-full p-y-.25 p-x-2
848 overflow-hidden box-border flex items-end
849 bg-panel-bg b-t b-solid b-panel-border
850 ${path_height_class} ${path_min_height_class}
851 hover:h-auto hover:pt-.5`}
852 >
853 {expandable() && (
854 <div
855 class="absolute z-2 inset-0 p-l-3
856 flex items-center pointer-events-none
857 group-hover:opacity-0"
858 style={{
859 'background-image': `linear-gradient(to right, ${theme.vars.panel.bg} ${theme.spacing[8]}, transparent ${theme.spacing[32]})`,
860 }}
861 >
862 <ui.icon.Options class="w-3 h3 text-disabled" />
863 </div>
864 )}
865 <div class="flex flex-wrap text-sm leading-3 font-mono" ref={container}>
866 {path().map(node => {
867
868 const hoverProps = createHover(hovering => {
869 hovered.toggleHoveredNode(node.id, 'node', hovering)
870 })
871
872 return <>
873 <div class="w-3 h-4 mx-.5 center-child first:hidden">
874 <ui.icon.CarretRight class="w-2 h-2 mb-[0.15rem] text-disabled" />
875 </div>
876 <div
877 class={`${ui.highlight_container} h-3 p-y-.25 my-0.25
878 flex items-center gap-x-1 cursor-pointer`}
879 style={{
880 [ui.highlight_opacity_var]: hovered.isNodeHovered(node.id)
881 ? '0.3'
882 : '0',
883 }}
884 {...hoverProps}
885 onClick={() => inspector.setInspectedOwner(node.id)}
886 >

Callers

nothing calls this directly

Calls 4

useAppCtxFunction · 0.90
createHoverFunction · 0.90
useStructureFunction · 0.85
expandableFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…