Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
825df92
add PointerView component skeleton
kha1dx Nov 5, 2025
29f1d62
install shadcn and define props
kha1dx Nov 6, 2025
72d56a5
add PointerView component skeleton
kha1dx Nov 5, 2025
5162106
search field
kha1dx Nov 6, 2025
973cd53
search field using shadcn
kha1dx Nov 6, 2025
48a22f4
tree node and expandability
kha1dx Nov 6, 2025
86870a0
dummy data and scrollable area
kha1dx Nov 6, 2025
1600b88
shadcn scroll area
kha1dx Nov 6, 2025
a48aa87
search logic implemented
kha1dx Nov 6, 2025
8870246
remove resizability and make it full screen
kha1dx Nov 6, 2025
29fab41
fixing data types
kha1dx Nov 6, 2025
12e795d
adding endpoint data type
kha1dx Nov 6, 2025
6f98d77
expandable children
kha1dx Nov 7, 2025
fdecac2
remove extra data types
kha1dx Nov 7, 2025
273c5c7
handle 0c0000 to map
kha1dx Nov 7, 2025
c474062
fix expanding {} []
kha1dx Nov 7, 2025
ea9bca0
toggle showing pointerID
kha1dx Nov 7, 2025
1f609f1
toggle data type, full pointerID, indices
kha1dx Nov 7, 2025
a518029
Display options
kha1dx Nov 9, 2025
2bf3d88
update when pointers are removed
kha1dx Nov 9, 2025
a677fb6
Detection of circular structures
kha1dx Nov 9, 2025
d137f0b
rebased and minor fixes
jonasstrehle Nov 9, 2025
ab4acf9
fixes
benStre Nov 10, 2025
1377ff8
added margin
kha1dx Nov 11, 2025
3808f10
Allow click on the whole pointer id to expand
kha1dx Nov 11, 2025
b9d4922
Show type hints without quotes
kha1dx Nov 11, 2025
c0ea204
Show map keys always
kha1dx Nov 11, 2025
2105e44
update package-lock.json
kha1dx Nov 12, 2025
363e90d
fix type errors
kha1dx Nov 12, 2025
e05a377
removed unused var
kha1dx Nov 12, 2025
cf799db
usepointerpreferences to composable directory
kha1dx Nov 12, 2025
faff1aa
fix imports
kha1dx Nov 12, 2025
4084eb1
map keys type hint
kha1dx Nov 13, 2025
c6d2221
Add tooltip for key and value types
kha1dx Nov 13, 2025
5d46eca
decrease padding
kha1dx Nov 17, 2025
77d3331
expanding values on click
kha1dx Nov 17, 2025
e369f4a
pointer id tooltip
kha1dx Nov 17, 2025
5c3562c
Pointer go to defintion feature but can be modified later
kha1dx Nov 20, 2025
ea745f9
double click on the value to edit
kha1dx Nov 20, 2025
f4c88bd
filter by data types
kha1dx Nov 20, 2025
5c0316e
fix type errors
kha1dx Nov 20, 2025
bd75363
refactor: update pointer type definitions to use DIFValueContainer
jonasstrehle Mar 13, 2026
d579a23
fix package json
jonasstrehle Mar 13, 2026
2e800fd
fix types
jonasstrehle Mar 13, 2026
89af459
fix: correct function name for converting JS value to DIFValueContainer
jonasstrehle Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,474 changes: 4,154 additions & 1,320 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"lucide-vue-next": "^0.548.0",
"markdown-it": "^14.1.1",
"reka-ui": "^2.6.0",
"shadcn": "^3.5.0",
"shadcn-ui": "^0.9.5",
"tailwind-merge": "^3.3.1",
Comment thread
jonasstrehle marked this conversation as resolved.
"tailwindcss": "^4.1.16",
"tw-animate-css": "^1.4.0",
Expand Down
117 changes: 117 additions & 0 deletions src/components/PointerPreferences.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<script setup lang="ts">
import { usePointerPreferences } from '@/composable/usePointerPreferences'
import { Switch } from '@/components/ui/switch'
import { Button } from '@/components/ui/button'
import {
PopoverContent,
} from '@/components/ui/popover'

const { preferences, resetPreferences } = usePointerPreferences()
</script>

<template>
<PopoverContent class="w-80" align="start">
<div class="space-y-4">
<!-- Header -->
<div class="flex items-center justify-between">
<div class="space-y-1">
<h4 class="font-medium leading-none">Display Preferences</h4>
<p class="text-sm text-muted-foreground">
Customize how pointers are displayed
</p>
</div>
<Button
variant="ghost"
size="sm"
@click="resetPreferences"
class="h-8 px-2 text-xs"
>
Reset
</Button>
</div>

<!-- Preferences List -->
<div class="space-y-4">
<!-- Show Full Pointer IDs -->
<div class="flex items-center justify-between space-x-2">
<div class="flex flex-col space-y-1 flex-1">
<label class="font-medium text-sm cursor-pointer">
Full Pointer IDs
</label>
<span class="text-xs text-muted-foreground">
Show complete pointer identifiers instead of shortened versions
</span>
</div>
<Switch
v-model="preferences.show_full_pointer_ids"
id="show-full-ids"
/>
Comment thread
jonasstrehle marked this conversation as resolved.
</div>

<!-- Show Type Hints -->
<div class="flex items-center justify-between space-x-2">
<div class="flex flex-col space-y-1 flex-1">
<label class="font-medium text-sm cursor-pointer">
Type Hints
</label>
<span class="text-xs text-muted-foreground">
Display type annotations for values
</span>
</div>
<Switch
v-model="preferences.show_type_hints"
id="show-type-hints"
/>
</div>

<!-- Show Array Indices -->
<div class="flex items-center justify-between space-x-2">
<div class="flex flex-col space-y-1 flex-1">
<label class="font-medium text-sm cursor-pointer">
Array Indices & Keys
</label>
<span class="text-xs text-muted-foreground">
Show array indices and object keys
</span>
</div>
<Switch
v-model="preferences.show_array_indicies"
id="show-array-indices"
/>
</div>

<!-- Hide Type Hints for Primitives -->
<div class="flex items-center justify-between space-x-2">
<div class="flex flex-col space-y-1 flex-1">
<label class="font-medium text-sm cursor-pointer">
Hide Primitive Type Hints
</label>
<span class="text-xs text-muted-foreground">
Hide type hints for integers, booleans, and text (show for maps/arrays)
</span>
</div>
<Switch
v-model="preferences.hide_type_hints_for_primitives"
id="hide-primitive-hints"
/>
</div>

<!-- Hide Map Key Type Hints for Primitives -->
<div class="flex items-center justify-between space-x-2">
<div class="flex flex-col space-y-1 flex-1">
<label class="font-medium text-sm cursor-pointer">
Hide Map Key Primitive Type Hints
</label>
<span class="text-xs text-muted-foreground">
Hide type hints for primitive map keys (text, integer, boolean)
</span>
</div>
<Switch
v-model="preferences.hide_map_key_type_hints_for_primitives"
id="hide-map-key-primitive-hints"
/>
</div>
</div>
</div>
</PopoverContent>
</template>
91 changes: 91 additions & 0 deletions src/components/PointerRefInline.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<script setup lang="ts">
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
import { usePointerPreferences } from '@/composable/usePointerPreferences'
import { getTypeName } from '@/lib/pointer-types'
import type { DIF } from '@unyt/datex'
import { computed, inject } from 'vue'

// Props
interface PointerRefInlineProps {
pointerId: string
}

const props = defineProps<PointerRefInlineProps>()

// Emits
const emit = defineEmits<{
click: [pointerId: string]
}>()

// Inject the pointers map
const pointers = inject<Map<string, DIF.Definitions.DIFValueContainer>>('pointers')

// Use preferences composable
const { preferences } = usePointerPreferences()

// Compute display ID based on preferences
const displayId = computed(() => {
if (preferences.value.show_full_pointer_ids) {
return props.pointerId
}

// Show abbreviated ID (last 4 chars)
const numericPart = props.pointerId.slice(1) // Remove $
if (numericPart.length > 4) {
return `$${numericPart.slice(-4)}`
}

return props.pointerId
})

// Get the value preview for the pointer
const valuePreview = computed(() => {
if (!pointers) return ''

const difValueContainer = pointers.get(props.pointerId)
if (!difValueContainer) return ''

// Extract value from DIF container
const value = typeof difValueContainer === 'object' && difValueContainer !== null && 'value' in difValueContainer
? (difValueContainer as Record<string, unknown>).value
: difValueContainer

const typeName = getTypeName(difValueContainer)

// Format preview based on type
if (typeName === 'text') return `"${value}"`
if (typeName === 'boolean') return value ? 'true' : 'false'
if (typeName === 'integer' || typeName === 'decimal') return String(value)
if (typeName === 'null') return 'null'
if (typeName === 'list') return '[...]'
if (typeName === 'map' || typeName === 'object') return '{...}'

return String(value)
})

// Handle click
function handleClick() {
emit('click', props.pointerId)
}
</script>

<template>
<TooltipProvider :delay-duration="300">
<Tooltip>
<TooltipTrigger as-child>
<button
@click.stop="handleClick"
class="inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-xs font-medium bg-primary/10 text-primary hover:bg-primary/20 transition-colors cursor-pointer border border-primary/20"
>
<span class="font-mono">{{ displayId }}</span>
<span v-if="valuePreview" class="text-foreground/60 font-normal">→ {{ valuePreview }}</span>
</button>
</TooltipTrigger>
<TooltipContent>
<p class="text-xs font-mono">{{ pointerId }}</p>
<p v-if="valuePreview" class="text-xs text-muted-foreground">Value: {{ valuePreview }}</p>
<p class="text-xs text-muted-foreground mt-1">Click to jump to definition</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</template>
Loading
Loading