feat: 再レイアウトボタン(Dagre を手動で再実行)の追加

Open
#38 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
frontend

Research direction

Start by locating graphStore.ts and the toolbar component, then trace the existing Dagre layout trigger and SAVE_LAYOUT handling. Verify how layoutAlgorithm, focus mode, and search state affect the graph. Done means the toolbar action resets local and host-persisted positions, reruns the current layout, and passes npm run check.

Written by the indexing model from the issue text.

Description

enhancement ui

概要

ノードを手動でドラッグして配置が乱れたとき、ワンクリックで Dagre 自動レイアウトに戻せる「再レイアウト」ボタンをツールバーに追加する。

現状は一度ノードを動かすと layoutState に位置が記録され、Dagre が再実行されなくなる。リセット手段がないためパネルを閉じて開き直すしか方法がない。

タスク

  • ツールバー(右上)に「再レイアウト」ボタンを追加
  • ボタン押下で以下を実行:
    1. layoutState を全クリア(useGraphStore.getState().clearLayoutState()
    2. SAVE_LAYOUT で空の positions を送信して拡張ホスト側の永続化もリセット
    3. 現在の layoutAlgorithm(LR or TB)で Dagre を再実行
  • GraphStoreclearLayoutState() アクションを追加
// graphStore.ts に追加
clearLayoutState() {
  set({ layoutState: {} });
},

UI イメージ

[ テスト非表示 ] [ MPkg非表示 ] [ → LR | ↓ TB ] [ ⟳ 再レイアウト ]

完了条件

  • 「再レイアウト」ボタンを押すと Dagre が再実行され整列される
  • 再レイアウト後のノード位置が SAVE_LAYOUT で永続化される
  • フォーカスモード中・検索中でも動作する
  • npm run check が全てグリーン

依存

  • fix: ノードドラッグ時レイアウト崩れバグ(clearLayoutState の仕組みを共有)
Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from qnaiv/codegraph

All issues in qnaiv/codegraph

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.