Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

feat: レイアウト方向切り替えボタン(LR / TB)の追加

Open
#37 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 with the ViewState definition in src/shared/types.ts, the existing applyDagreLayout(nodes, edges, direction) entry point, and the setLayoutState action mentioned in the dependency. Trace how the toolbar updates view state and how layoutState triggers Dagre, then run npm run check. Done means the LR/TB buttons switch direction, manual mode relayouts without confirmation, and the result persists through SAVE_LAYOUT.

Written by the indexing model from the issue text.

Description

enhancement ui

概要

layoutAlgorithm: 'dagre-lr' | 'dagre-tb' は ViewState の型に定義済みだが、切り替えるUIが存在しない。ツールバーにトグルボタンを追加し、グラフの向きをワンクリックで切り替えられるようにする。

  • LR(左→右): 継承ヒエラルキー・クラス依存グラフに適する(デフォルト)
  • TB(上→下): SOQL/DML データフロー、SObject 間リレーションシップの確認に適する

現状

// src/shared/types.ts(実装済み)
export interface ViewState {
  layoutAlgorithm: 'dagre-lr' | 'dagre-tb' | 'manual'; // ← UI なし
  // ...
}

applyDagreLayout(nodes, edges, direction: 'LR' | 'TB') も実装済み。

タスク

  • ツールバー(右上)に方向切り替えボタンを追加
    • [→ LR] / [↓ TB] のセグメントボタン形式
  • ボタン押下で viewState.layoutAlgorithm を更新
  • layoutAlgorithm が変わったとき layoutState をクリアして Dagre を再実行
    • layoutState をリセットすることで needsLayout = true が再発火する
    • 再レイアウト後の位置を SAVE_LAYOUT で永続化
  • 'manual' 状態(ユーザーが手動でノードを動かした後)では方向ボタンを押すとリセット確認なしで再レイアウト

UI イメージ

[ テスト非表示 ] [ MPkg非表示 ] [ → LR | ↓ TB ]

完了条件

  • LR/TB ボタンでグラフの向きが切り替わる
  • 切り替え後のレイアウトが SAVE_LAYOUT で保持される
  • npm run check が全てグリーン

依存

  • fix: ノードドラッグ時レイアウト崩れバグ(setLayoutState アクションを利用)
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.