Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
VS Code extension: ドラッグ&ドロップでファイルを並び替える
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Taiyo Fujii
September 30, 2024
Programming
430
0
Share
VS Code extension: ドラッグ&ドロップでファイルを並び替える
VS Code機能拡張で拡張したサイドバーに、ドラッグ&ドロップでファイルの順番を並び替えるツリービューを実装し、VS Code meetupで発表しました。
Taiyo Fujii
September 30, 2024
Other Decks in Programming
See All in Programming
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
140
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.6k
AgentCore Optimizationを始めよう!
licux
3
210
Programming with a DJ Controller — not vibe coding
m_seki
3
790
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
180
GoogleCloudとterraform完全に理解した
terisuke
1
190
ハーネスエンジニアリングとは?
kinopeee
13
6.8k
Claude CodeでETLジョブ実行テストを自動化してみた
yoshikikasama
0
1.2k
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
490
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
200
10 Tips of AWS ~Gen AI on AWS~
licux
5
540
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
190
Featured
See All Featured
The Curse of the Amulet
leimatthew05
1
12k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Technical Leadership for Architectural Decision Making
baasie
3
360
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
450
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
220
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
790
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Designing for Timeless Needs
cassininazir
0
220
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
300
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Transcript
speaker: Taiyo Fujii Drag and Drop for Tree View Drag
and Drop for Tree View
小説執筆 長いファイルを分割して書きたい 長編小説は 100メートル そもそも何で? そもそも何で?
機能拡張を作りました 機能拡張を作りました
テキスト結合 青空文庫注記 原稿用紙プレビュー 品詞ハイライティング 文字数カウント etc...
原稿ファイルだけを表示 フォルダごとの字数集計 連番も拡張子も非表示 原稿ツリー 原稿ツリー
ドラッグ &ドロップで変えたい! 順番を変えたい 順番を変えたい
大変なのはわかっている 大変なのはわかっている
VS Code Treeview Provider TreeDragAndDropController
自由度が低かった …… 自由度が低かった ……
Dropノードは決められるが、挿入する場所が決められない!
GPTに聞けばなんとかなるじゃろ …… WebViewだ、 Reactだ! WebViewだ、 Reactだ!
なんとかなるか? return ( <div ref={(node: HTMLDivElement) => dragRef(dropRef(node))} className={`tree-node ${expanded
? "expanded" : ""} ${ highlightedNode === node.dir ? "highlighted" : "" }`} onClick={handleNodeClick} > <div className={`tree-label ${!node.children ? "text" : ""}`}> <span className="triangle" onClick={toggleExpand}> > </span> <span className="item-name"> {node.name.replace(/^(?:\d+[-_\s]*)*(.+?)(?:\.(txt|md))?$/, "$1")} </span> <span className="chars">{node.length.toLocaleString()}文字</span> </div> {node.children && ( <div className="tree-node-children"> {node.children.map((child) => ( <TreeView ... /> ))} </div> )} </div> );
しかし イベント駆動で挿入エレメントを挿入 キーイベントでリネーム用の inputを増やす ドラッグのイベントパブリングを絶妙に制御 ドラッグ中は hoverしたときは キーイベントがあった時は ... やばい、状態が多すぎる、ついていけない
設計は自分でやろう 設計は自分でやろう
Demo Demo
Windows対応は、 vscode.workspace.fsPathと pathに注意! VS Code API VS Code API
vscode.workspace.fs.rename("2-はじまり.txt", "1-はじまり.txt", { overwrite: true }) まずい、まずいぞ …… まずい、まずいぞ ……
Demo Demo
novel-writer 3.0.0 novel-writer 3.0.0
None