Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
be02e80
[feat] Implement shortcuts management panel with categorized commands
Myestery Aug 1, 2025
dda25af
feat: Add shortcuts tab and categorize commands in command store
Myestery Aug 1, 2025
1968333
feat: Add category to sidebar tab and extend bottom panel interface
Myestery Aug 1, 2025
10300f8
feat: Add shortcuts toggle button to sidebar and re order mindmap
Myestery Aug 1, 2025
b37d8d4
feat: Enhance bottom panel store with multi-panel support and shortcu…
Myestery Aug 1, 2025
e2efdd0
npm run locale
Myestery Aug 1, 2025
96ecb88
Merge branch 'main' into bottom-keybindings
Myestery Aug 1, 2025
06a7e66
cleanup commands and style
Myestery Aug 1, 2025
0f6b4ca
Merge branch 'main' into bottom-keybindings
Myestery Aug 1, 2025
d737a84
Reset src/locales to main branch state
Myestery Aug 2, 2025
197c8dd
[bugfix] Fix pre-commit hook cross-platform compatibility (#4643)
huchenlei Aug 1, 2025
912c64f
Ignore Claude local config (#4649)
benceruleanlu Aug 1, 2025
6cf4d69
[fix] Add type guard for SubgraphDefinition to improve TypeScript inf…
christian-byrne Aug 2, 2025
9c85776
[fix] Fix viewport sync in minimap and subgraphs navigation (#4644)
christian-byrne Aug 2, 2025
84123c5
[feat] Add keyboard shortcuts localization to main.json
Myestery Aug 2, 2025
f26d967
Merge branch 'main' into bottom-keybindings
Myestery Aug 2, 2025
d73d627
unit and browser tests
Myestery Aug 2, 2025
dce73e5
use correct type in EssentialsPanel
Myestery Aug 4, 2025
471ddf4
[refactor] Simplify command subcategory grouping in EssentialsPanel a…
Myestery Aug 4, 2025
34351f5
fix unused css
Myestery Aug 4, 2025
7c5ab4e
feat: add aria-label for keybinding display accessibility
Myestery Aug 4, 2025
732bcc4
fix: use filtered subcategories for rendering shortcuts
Myestery Aug 4, 2025
af90f5d
adjust keyboard shortcuts margins and responsiveness
Myestery Aug 7, 2025
256997e
fix playwright tests
Myestery Aug 7, 2025
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
Prev Previous commit
Next Next commit
[fix] Fix viewport sync in minimap and subgraphs navigation (#4644)
  • Loading branch information
christian-byrne authored and Myestery committed Aug 2, 2025
commit 9c857761e8de63e2f8d6f9e36bd0e02b8e95adad
36 changes: 10 additions & 26 deletions src/composables/useMinimap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { api } from '@/scripts/api'
import { app } from '@/scripts/app'
import { useCanvasStore } from '@/stores/graphStore'
import { useSettingStore } from '@/stores/settingStore'
import { useWorkflowStore } from '@/stores/workflowStore'
import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore'

interface GraphCallbacks {
Expand All @@ -21,7 +20,6 @@ export function useMinimap() {
const settingStore = useSettingStore()
const canvasStore = useCanvasStore()
const colorPaletteStore = useColorPaletteStore()
const workflowStore = useWorkflowStore()

const containerRef = ref<HTMLDivElement>()
const canvasRef = ref<HTMLCanvasElement>()
Expand Down Expand Up @@ -110,29 +108,6 @@ export function useMinimap() {
const canvas = computed(() => canvasStore.canvas)
const graph = ref(app.canvas?.graph)

// Update graph ref when subgraph context changes
watch(
() => workflowStore.activeSubgraph,
() => {
graph.value = app.canvas?.graph
// Force viewport update when switching subgraphs
if (initialized.value && visible.value) {
updateViewport()
}
}
)

// Update viewport when switching workflows
watch(
() => workflowStore.activeWorkflow,
() => {
// Force viewport update when switching workflows
if (initialized.value && visible.value) {
updateViewport()
}
}
)

const containerStyles = computed(() => ({
width: `${width}px`,
height: `${height}px`,
Expand Down Expand Up @@ -377,6 +352,8 @@ export function useMinimap() {
needsBoundsUpdate.value = false
updateFlags.value.bounds = false
needsFullRedraw.value = true
// When bounds change, we need to update the viewport position
updateFlags.value.viewport = true
}

if (
Expand All @@ -386,6 +363,11 @@ export function useMinimap() {
) {
renderMinimap()
}

// Update viewport if needed (e.g., after bounds change)
if (updateFlags.value.viewport) {
updateViewport()
}
}

const checkForChanges = useThrottleFn(() => {
Expand Down Expand Up @@ -660,7 +642,7 @@ export function useMinimap() {
await init()
}
},
{ immediate: true }
{ immediate: true, flush: 'post' }
)

watch(visible, async (isVisible) => {
Expand All @@ -678,6 +660,8 @@ export function useMinimap() {

await nextTick()

await nextTick()

updateMinimap()
updateViewport()
resumeChangeDetection()
Expand Down
15 changes: 13 additions & 2 deletions src/stores/subgraphNavigationStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ export const useSubgraphNavigationStore = defineStore(
maxSize: 32
})

/**
* Get the ID of the root graph for the currently active workflow.
* @returns The ID of the root graph for the currently active workflow.
*/
const getCurrentRootGraphId = () => {
const canvas = canvasStore.getCanvas()
if (!canvas) return 'root'

return canvas.graph?.rootGraph?.id ?? 'root'
}

/**
* A stack representing subgraph navigation history from the root graph to
* the current opened subgraph.
Expand Down Expand Up @@ -117,13 +128,13 @@ export const useSubgraphNavigationStore = defineStore(
saveViewport(prevSubgraph.id)
} else if (!prevSubgraph && subgraph) {
// Leaving root graph to enter a subgraph
saveViewport('root')
saveViewport(getCurrentRootGraphId())
}

const isInRootGraph = !subgraph
if (isInRootGraph) {
idStack.value.length = 0
restoreViewport('root')
restoreViewport(getCurrentRootGraphId())
return
}

Expand Down