diffity 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1081 -0
- package/dist/ui/assets/abap-BdImnpbu.js +1 -0
- package/dist/ui/assets/actionscript-3-CoDkCxhg.js +1 -0
- package/dist/ui/assets/ada-bCR0ucgS.js +1 -0
- package/dist/ui/assets/andromeeda-C4gqWexZ.js +1 -0
- package/dist/ui/assets/angular-html-DA-rfuFy.js +1 -0
- package/dist/ui/assets/angular-ts-BrjP3tb8.js +1 -0
- package/dist/ui/assets/apache-Pmp26Uib.js +1 -0
- package/dist/ui/assets/apex-D8_7TLub.js +1 -0
- package/dist/ui/assets/apl-CORt7UWP.js +1 -0
- package/dist/ui/assets/applescript-Co6uUVPk.js +1 -0
- package/dist/ui/assets/ara-BRHolxvo.js +1 -0
- package/dist/ui/assets/asciidoc-Ve4PFQV2.js +1 -0
- package/dist/ui/assets/asm-D_Q5rh1f.js +1 -0
- package/dist/ui/assets/astro-HNnZUWAn.js +1 -0
- package/dist/ui/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/dist/ui/assets/awk-DMzUqQB5.js +1 -0
- package/dist/ui/assets/ayu-dark-DYE7WIF3.js +1 -0
- package/dist/ui/assets/ayu-light-BA47KaF1.js +1 -0
- package/dist/ui/assets/ayu-mirage-32ctXXKs.js +1 -0
- package/dist/ui/assets/ballerina-BFfxhgS-.js +1 -0
- package/dist/ui/assets/bat-BkioyH1T.js +1 -0
- package/dist/ui/assets/beancount-k_qm7-4y.js +1 -0
- package/dist/ui/assets/berry-uYugtg8r.js +1 -0
- package/dist/ui/assets/bibtex-CHM0blh-.js +1 -0
- package/dist/ui/assets/bicep-Bmn6On1c.js +1 -0
- package/dist/ui/assets/bird2-BIv1doCn.js +1 -0
- package/dist/ui/assets/blade-BjGOyj-B.js +1 -0
- package/dist/ui/assets/bsl-BO_Y6i37.js +1 -0
- package/dist/ui/assets/c-BIGW1oBm.js +1 -0
- package/dist/ui/assets/c3-eo99z4R2.js +1 -0
- package/dist/ui/assets/cadence-Bv_4Rxtq.js +1 -0
- package/dist/ui/assets/cairo-KRGpt6FW.js +1 -0
- package/dist/ui/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/dist/ui/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/dist/ui/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/dist/ui/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/dist/ui/assets/clarity-D53aC0YG.js +1 -0
- package/dist/ui/assets/clojure-P80f7IUj.js +1 -0
- package/dist/ui/assets/cmake-D1j8_8rp.js +1 -0
- package/dist/ui/assets/cobol-nBiQ_Alo.js +1 -0
- package/dist/ui/assets/codeowners-Bp6g37R7.js +1 -0
- package/dist/ui/assets/codeql-DsOJ9woJ.js +1 -0
- package/dist/ui/assets/coffee-Ch7k5sss.js +1 -0
- package/dist/ui/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/dist/ui/assets/coq-DkFqJrB1.js +1 -0
- package/dist/ui/assets/cpp-CofmeUqb.js +1 -0
- package/dist/ui/assets/crystal-DNxU26gB.js +1 -0
- package/dist/ui/assets/csharp-COcwbKMJ.js +1 -0
- package/dist/ui/assets/css-CLj8gQPS.js +1 -0
- package/dist/ui/assets/csv-fuZLfV_i.js +1 -0
- package/dist/ui/assets/cue-D82EKSYY.js +1 -0
- package/dist/ui/assets/cypher-COkxafJQ.js +1 -0
- package/dist/ui/assets/d-85-TOEBH.js +1 -0
- package/dist/ui/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/ui/assets/dart-bE4Kk8sk.js +1 -0
- package/dist/ui/assets/dax-CEL-wOlO.js +1 -0
- package/dist/ui/assets/desktop-BmXAJ9_W.js +1 -0
- package/dist/ui/assets/diff-D97Zzqfu.js +1 -0
- package/dist/ui/assets/docker-BcOcwvcX.js +1 -0
- package/dist/ui/assets/dotenv-Da5cRb03.js +1 -0
- package/dist/ui/assets/dracula-BzJJZx-M.js +1 -0
- package/dist/ui/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/dist/ui/assets/dream-maker-BtqSS_iP.js +1 -0
- package/dist/ui/assets/edge-FbVlp4U3.js +1 -0
- package/dist/ui/assets/elixir-CkH2-t6x.js +1 -0
- package/dist/ui/assets/elm-DbKCFpqz.js +1 -0
- package/dist/ui/assets/emacs-lisp-CXvaQtF9.js +1 -0
- package/dist/ui/assets/erb-BYCe7drp.js +1 -0
- package/dist/ui/assets/erlang-DsQrWhSR.js +1 -0
- package/dist/ui/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/dist/ui/assets/everforest-light-C8M2exoo.js +1 -0
- package/dist/ui/assets/fennel-BYunw83y.js +1 -0
- package/dist/ui/assets/fish-BvzEVeQv.js +1 -0
- package/dist/ui/assets/fluent-C4IJs8-o.js +1 -0
- package/dist/ui/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
- package/dist/ui/assets/fortran-free-form-BxgE0vQu.js +1 -0
- package/dist/ui/assets/fsharp-CXgrBDvD.js +1 -0
- package/dist/ui/assets/gdresource-BOOCDP_w.js +1 -0
- package/dist/ui/assets/gdscript-C5YyOfLZ.js +1 -0
- package/dist/ui/assets/gdshader-DkwncUOv.js +1 -0
- package/dist/ui/assets/genie-D0YGMca9.js +1 -0
- package/dist/ui/assets/gherkin-DyxjwDmM.js +1 -0
- package/dist/ui/assets/git-commit-F4YmCXRG.js +1 -0
- package/dist/ui/assets/git-rebase-r7XF79zn.js +1 -0
- package/dist/ui/assets/github-dark-DHJKELXO.js +1 -0
- package/dist/ui/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/dist/ui/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/dist/ui/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/dist/ui/assets/github-light-DAi9KRSo.js +1 -0
- package/dist/ui/assets/github-light-default-D7oLnXFd.js +1 -0
- package/dist/ui/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/dist/ui/assets/gleam-BspZqrRM.js +1 -0
- package/dist/ui/assets/glimmer-js-ByusRIyA.js +1 -0
- package/dist/ui/assets/glimmer-ts-BfAWNZQY.js +1 -0
- package/dist/ui/assets/glsl-DplSGwfg.js +1 -0
- package/dist/ui/assets/gn-n2N0HUVH.js +1 -0
- package/dist/ui/assets/gnuplot-DdkO51Og.js +1 -0
- package/dist/ui/assets/go-C27-OAKa.js +1 -0
- package/dist/ui/assets/graphql-ChdNCCLP.js +1 -0
- package/dist/ui/assets/groovy-gcz8RCvz.js +1 -0
- package/dist/ui/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/dist/ui/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/dist/ui/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/dist/ui/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/dist/ui/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/dist/ui/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/dist/ui/assets/hack-i7_Ulhet.js +1 -0
- package/dist/ui/assets/haml-D5jkg6IW.js +1 -0
- package/dist/ui/assets/handlebars-BpdQsYii.js +1 -0
- package/dist/ui/assets/haskell-Df6bDoY_.js +1 -0
- package/dist/ui/assets/haxe-CzTSHFRz.js +1 -0
- package/dist/ui/assets/hcl-BWvSN4gD.js +1 -0
- package/dist/ui/assets/hjson-D5-asLiD.js +1 -0
- package/dist/ui/assets/hlsl-D3lLCCz7.js +1 -0
- package/dist/ui/assets/horizon-BUw7H-hv.js +1 -0
- package/dist/ui/assets/horizon-bright-CUuTKBJd.js +1 -0
- package/dist/ui/assets/houston-DnULxvSX.js +1 -0
- package/dist/ui/assets/html-derivative-DlHx6ybY.js +1 -0
- package/dist/ui/assets/html-pp8916En.js +1 -0
- package/dist/ui/assets/http-jrhK8wxY.js +1 -0
- package/dist/ui/assets/hurl-irOxFIW8.js +1 -0
- package/dist/ui/assets/hxml-Bvhsp5Yf.js +1 -0
- package/dist/ui/assets/hy-DFXneXwc.js +1 -0
- package/dist/ui/assets/imba-DGztddWO.js +1 -0
- package/dist/ui/assets/index-B2RHRT_g.css +1 -0
- package/dist/ui/assets/index-BUq0B-nJ.js +198 -0
- package/dist/ui/assets/ini-BEwlwnbL.js +1 -0
- package/dist/ui/assets/java-CylS5w8V.js +1 -0
- package/dist/ui/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/ui/assets/jinja-f2NsQr07.js +1 -0
- package/dist/ui/assets/jison-wvAkD_A8.js +1 -0
- package/dist/ui/assets/json-Cp-IABpG.js +1 -0
- package/dist/ui/assets/json5-C9tS-k6U.js +1 -0
- package/dist/ui/assets/jsonc-Des-eS-w.js +1 -0
- package/dist/ui/assets/jsonl-DcaNXYhu.js +1 -0
- package/dist/ui/assets/jsonnet-DFQXde-d.js +1 -0
- package/dist/ui/assets/jssm-C2t-YnRu.js +1 -0
- package/dist/ui/assets/jsx-g9-lgVsj.js +1 -0
- package/dist/ui/assets/julia-CxzCAyBv.js +1 -0
- package/dist/ui/assets/just-VxiPbLrw.js +1 -0
- package/dist/ui/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/dist/ui/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/dist/ui/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/dist/ui/assets/kdl-DV7GczEv.js +1 -0
- package/dist/ui/assets/kotlin-BdnUsdx6.js +1 -0
- package/dist/ui/assets/kusto-wEQ09or8.js +1 -0
- package/dist/ui/assets/laserwave-DUszq2jm.js +1 -0
- package/dist/ui/assets/latex-CWtU0Tv5.js +1 -0
- package/dist/ui/assets/lean-BZvkOJ9d.js +1 -0
- package/dist/ui/assets/less-B1dDrJ26.js +1 -0
- package/dist/ui/assets/light-plus-B7mTdjB0.js +1 -0
- package/dist/ui/assets/liquid-C0sCDyMI.js +1 -0
- package/dist/ui/assets/llvm-DjAJT7YJ.js +1 -0
- package/dist/ui/assets/log-2UxHyX5q.js +1 -0
- package/dist/ui/assets/logo-BtOb2qkB.js +1 -0
- package/dist/ui/assets/lua-BaeVxFsk.js +1 -0
- package/dist/ui/assets/luau-C-HG3fhB.js +1 -0
- package/dist/ui/assets/make-CHLpvVh8.js +1 -0
- package/dist/ui/assets/markdown-Cvjx9yec.js +1 -0
- package/dist/ui/assets/marko-DjSrsDqO.js +1 -0
- package/dist/ui/assets/material-theme-D5KoaKCx.js +1 -0
- package/dist/ui/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/dist/ui/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/dist/ui/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/dist/ui/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/dist/ui/assets/matlab-D7o27uSR.js +1 -0
- package/dist/ui/assets/mdc-DTYItulj.js +1 -0
- package/dist/ui/assets/mdx-Cmh6b_Ma.js +1 -0
- package/dist/ui/assets/mermaid-mWjccvbQ.js +1 -0
- package/dist/ui/assets/min-dark-CafNBF8u.js +1 -0
- package/dist/ui/assets/min-light-CTRr51gU.js +1 -0
- package/dist/ui/assets/mipsasm-CKIfxQSi.js +1 -0
- package/dist/ui/assets/mojo-rZm6bMo-.js +1 -0
- package/dist/ui/assets/monokai-D4h5O-jR.js +1 -0
- package/dist/ui/assets/moonbit-_H4v1dQx.js +1 -0
- package/dist/ui/assets/move-IF9eRakj.js +1 -0
- package/dist/ui/assets/narrat-DRg8JJMk.js +1 -0
- package/dist/ui/assets/nextflow-C-mBbutL.js +1 -0
- package/dist/ui/assets/nextflow-groovy-vE_lwT2v.js +1 -0
- package/dist/ui/assets/nginx-BpAMiNFr.js +1 -0
- package/dist/ui/assets/night-owl-C39BiMTA.js +1 -0
- package/dist/ui/assets/night-owl-light-CMTm3GFP.js +1 -0
- package/dist/ui/assets/nim-BIad80T-.js +1 -0
- package/dist/ui/assets/nix-CwoSXNpI.js +1 -0
- package/dist/ui/assets/nord-Ddv68eIx.js +1 -0
- package/dist/ui/assets/nushell-Cz2AlsmD.js +1 -0
- package/dist/ui/assets/objective-c-DXmwc3jG.js +1 -0
- package/dist/ui/assets/objective-cpp-CLxacb5B.js +1 -0
- package/dist/ui/assets/ocaml-C0hk2d4L.js +1 -0
- package/dist/ui/assets/odin-BBf5iR-q.js +1 -0
- package/dist/ui/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/dist/ui/assets/one-light-C3Wv6jpd.js +1 -0
- package/dist/ui/assets/openscad-C4EeE6gA.js +1 -0
- package/dist/ui/assets/pascal-D93ZcfNL.js +1 -0
- package/dist/ui/assets/perl-NvoQZIq0.js +1 -0
- package/dist/ui/assets/php-R6g_5hLQ.js +1 -0
- package/dist/ui/assets/pkl-u5AG7uiY.js +1 -0
- package/dist/ui/assets/plastic-3e1v2bzS.js +1 -0
- package/dist/ui/assets/plsql-ChMvpjG-.js +1 -0
- package/dist/ui/assets/po-BTJTHyun.js +1 -0
- package/dist/ui/assets/poimandres-CS3Unz2-.js +1 -0
- package/dist/ui/assets/polar-C0HS_06l.js +1 -0
- package/dist/ui/assets/postcss-CXtECtnM.js +1 -0
- package/dist/ui/assets/powerquery-CEu0bR-o.js +1 -0
- package/dist/ui/assets/powershell-Dpen1YoG.js +1 -0
- package/dist/ui/assets/prisma-Dd19v3D-.js +1 -0
- package/dist/ui/assets/prolog-CbFg5uaA.js +1 -0
- package/dist/ui/assets/proto-C7zT0LnQ.js +1 -0
- package/dist/ui/assets/pug-DKIMFp6K.js +1 -0
- package/dist/ui/assets/puppet-BMWR74SV.js +1 -0
- package/dist/ui/assets/purescript-CklMAg4u.js +1 -0
- package/dist/ui/assets/python-B6aJPvgy.js +1 -0
- package/dist/ui/assets/qml-3beO22l8.js +1 -0
- package/dist/ui/assets/qmldir-C8lEn-DE.js +1 -0
- package/dist/ui/assets/qss-IeuSbFQv.js +1 -0
- package/dist/ui/assets/r-Dspwwk_N.js +1 -0
- package/dist/ui/assets/racket-BqYA7rlc.js +1 -0
- package/dist/ui/assets/raku-DXvB9xmW.js +1 -0
- package/dist/ui/assets/razor-BDqjjVU7.js +1 -0
- package/dist/ui/assets/red-bN70gL4F.js +1 -0
- package/dist/ui/assets/reg-C-SQnVFl.js +1 -0
- package/dist/ui/assets/regexp-CDVJQ6XC.js +1 -0
- package/dist/ui/assets/rel-C3B-1QV4.js +1 -0
- package/dist/ui/assets/riscv-BM1_JUlF.js +1 -0
- package/dist/ui/assets/ron-D8l8udqQ.js +1 -0
- package/dist/ui/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/dist/ui/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/dist/ui/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/dist/ui/assets/rosmsg-BJDFO7_C.js +1 -0
- package/dist/ui/assets/rst-CRjBmOyv.js +1 -0
- package/dist/ui/assets/ruby-Wjq7vjNf.js +1 -0
- package/dist/ui/assets/rust-B1yitclQ.js +1 -0
- package/dist/ui/assets/sas-cz2c8ADy.js +1 -0
- package/dist/ui/assets/sass-Cj5Yp3dK.js +1 -0
- package/dist/ui/assets/scala-C151Ov-r.js +1 -0
- package/dist/ui/assets/scheme-C98Dy4si.js +1 -0
- package/dist/ui/assets/scss-D5BDwBP9.js +1 -0
- package/dist/ui/assets/sdbl-DVxCFoDh.js +1 -0
- package/dist/ui/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/dist/ui/assets/shellscript-Yzrsuije.js +1 -0
- package/dist/ui/assets/shellsession-BADoaaVG.js +1 -0
- package/dist/ui/assets/slack-dark-BthQWCQV.js +1 -0
- package/dist/ui/assets/slack-ochin-DqwNpetd.js +1 -0
- package/dist/ui/assets/smalltalk-BERRCDM3.js +1 -0
- package/dist/ui/assets/snazzy-light-Bw305WKR.js +1 -0
- package/dist/ui/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/dist/ui/assets/solarized-light-L9t79GZl.js +1 -0
- package/dist/ui/assets/solidity-rGO070M0.js +1 -0
- package/dist/ui/assets/soy-8wufbnw4.js +1 -0
- package/dist/ui/assets/sparql-rVzFXLq3.js +1 -0
- package/dist/ui/assets/splunk-BtCnVYZw.js +1 -0
- package/dist/ui/assets/sql-BLtJtn59.js +1 -0
- package/dist/ui/assets/ssh-config-_ykCGR6B.js +1 -0
- package/dist/ui/assets/stata-BH5u7GGu.js +1 -0
- package/dist/ui/assets/stylus-BEDo0Tqx.js +1 -0
- package/dist/ui/assets/surrealql-Bq5Q-fJD.js +1 -0
- package/dist/ui/assets/svelte-Cy7k_4gC.js +1 -0
- package/dist/ui/assets/swift-D82vCrfD.js +1 -0
- package/dist/ui/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/dist/ui/assets/system-verilog-CnnmHF94.js +1 -0
- package/dist/ui/assets/systemd-4A_iFExJ.js +1 -0
- package/dist/ui/assets/talonscript-CkByrt1z.js +1 -0
- package/dist/ui/assets/tasl-QIJgUcNo.js +1 -0
- package/dist/ui/assets/tcl-dwOrl1Do.js +1 -0
- package/dist/ui/assets/templ-DhtptRzy.js +1 -0
- package/dist/ui/assets/terraform-BETggiCN.js +1 -0
- package/dist/ui/assets/tex-idrVyKtj.js +1 -0
- package/dist/ui/assets/tokyo-night-hegEt444.js +1 -0
- package/dist/ui/assets/toml-vGWfd6FD.js +1 -0
- package/dist/ui/assets/ts-tags-DQrlYJgV.js +1 -0
- package/dist/ui/assets/tsv-B_m7g4N7.js +1 -0
- package/dist/ui/assets/tsx-COt5Ahok.js +1 -0
- package/dist/ui/assets/turtle-BsS91CYL.js +1 -0
- package/dist/ui/assets/twig-xg9kU7Mw.js +1 -0
- package/dist/ui/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/ui/assets/typespec-CAFt9gP4.js +1 -0
- package/dist/ui/assets/typst-DHCkPAjA.js +1 -0
- package/dist/ui/assets/v-BcVCzyr7.js +1 -0
- package/dist/ui/assets/vala-CsfeWuGM.js +1 -0
- package/dist/ui/assets/vb-D17OF-Vu.js +1 -0
- package/dist/ui/assets/verilog-BQ8w6xss.js +1 -0
- package/dist/ui/assets/vesper-DU1UobuO.js +1 -0
- package/dist/ui/assets/vhdl-CeAyd5Ju.js +1 -0
- package/dist/ui/assets/viml-CJc9bBzg.js +1 -0
- package/dist/ui/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/dist/ui/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/dist/ui/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/dist/ui/assets/vue-D2xRrEX4.js +1 -0
- package/dist/ui/assets/vue-html-AaS7Mt5G.js +1 -0
- package/dist/ui/assets/vue-vine-BoDAl6tE.js +1 -0
- package/dist/ui/assets/vyper-CDx5xZoG.js +1 -0
- package/dist/ui/assets/wasm-CG6Dc4jp.js +1 -0
- package/dist/ui/assets/wasm-MzD3tlZU.js +1 -0
- package/dist/ui/assets/wenyan-BV7otONQ.js +1 -0
- package/dist/ui/assets/wgsl-Dx-B1_4e.js +1 -0
- package/dist/ui/assets/wikitext-BhOHFoWU.js +1 -0
- package/dist/ui/assets/wit-5i3qLPDT.js +1 -0
- package/dist/ui/assets/wolfram-lXgVvXCa.js +1 -0
- package/dist/ui/assets/xml-sdJ4AIDG.js +1 -0
- package/dist/ui/assets/xsl-CtQFsRM5.js +1 -0
- package/dist/ui/assets/yaml-Buea-lGh.js +1 -0
- package/dist/ui/assets/zenscript-DVFEvuxE.js +1 -0
- package/dist/ui/assets/zig-VOosw3JB.js +1 -0
- package/{packages → dist}/ui/index.html +2 -1
- package/package.json +39 -20
- package/.claude/settings.local.json +0 -11
- package/LICENSE +0 -21
- package/README.md +0 -71
- package/development.md +0 -156
- package/packages/cli/build.js +0 -38
- package/packages/cli/package.json +0 -51
- package/packages/cli/src/agent.ts +0 -187
- package/packages/cli/src/db.ts +0 -58
- package/packages/cli/src/index.ts +0 -196
- package/packages/cli/src/review-routes.ts +0 -150
- package/packages/cli/src/server.ts +0 -370
- package/packages/cli/src/session.ts +0 -48
- package/packages/cli/src/threads.ts +0 -238
- package/packages/cli/tsconfig.json +0 -13
- package/packages/git/package.json +0 -24
- package/packages/git/src/commits.ts +0 -28
- package/packages/git/src/diff.ts +0 -97
- package/packages/git/src/exec.ts +0 -35
- package/packages/git/src/index.ts +0 -5
- package/packages/git/src/repo.ts +0 -63
- package/packages/git/src/status.ts +0 -9
- package/packages/git/src/types.ts +0 -12
- package/packages/git/tsconfig.json +0 -9
- package/packages/parser/package.json +0 -26
- package/packages/parser/src/index.ts +0 -12
- package/packages/parser/src/parse.ts +0 -299
- package/packages/parser/src/types.ts +0 -52
- package/packages/parser/src/word-diff.ts +0 -155
- package/packages/parser/tests/fixtures/binary-deleted.diff +0 -4
- package/packages/parser/tests/fixtures/binary-file.diff +0 -4
- package/packages/parser/tests/fixtures/binary-modified.diff +0 -3
- package/packages/parser/tests/fixtures/copied-file.diff +0 -12
- package/packages/parser/tests/fixtures/deleted-file.diff +0 -9
- package/packages/parser/tests/fixtures/empty.diff +0 -0
- package/packages/parser/tests/fixtures/hunk-with-context.diff +0 -12
- package/packages/parser/tests/fixtures/mode-change-with-content.diff +0 -10
- package/packages/parser/tests/fixtures/mode-change.diff +0 -3
- package/packages/parser/tests/fixtures/multi-file.diff +0 -22
- package/packages/parser/tests/fixtures/new-file.diff +0 -9
- package/packages/parser/tests/fixtures/no-newline.diff +0 -10
- package/packages/parser/tests/fixtures/renamed-file.diff +0 -12
- package/packages/parser/tests/fixtures/single-file-additions.diff +0 -11
- package/packages/parser/tests/fixtures/single-file-deletions.diff +0 -11
- package/packages/parser/tests/fixtures/single-file-mixed.diff +0 -15
- package/packages/parser/tests/fixtures/single-file-multi-hunk.diff +0 -22
- package/packages/parser/tests/fixtures/spaces-in-path.diff +0 -9
- package/packages/parser/tests/fixtures/submodule.diff +0 -7
- package/packages/parser/tests/fixtures/unicode-content.diff +0 -11
- package/packages/parser/tests/parse.test.ts +0 -312
- package/packages/parser/tests/word-diff-integration.test.ts +0 -52
- package/packages/parser/tests/word-diff.test.ts +0 -121
- package/packages/parser/tsconfig.json +0 -10
- package/packages/skills/diffity-resolve/SKILL.md +0 -55
- package/packages/skills/diffity-review/SKILL.md +0 -74
- package/packages/skills/diffity-start/SKILL.md +0 -25
- package/packages/ui/package.json +0 -35
- package/packages/ui/src/app.tsx +0 -14
- package/packages/ui/src/components/comment-bubble.tsx +0 -78
- package/packages/ui/src/components/comment-form-row.tsx +0 -58
- package/packages/ui/src/components/comment-form.tsx +0 -78
- package/packages/ui/src/components/comment-line-number.tsx +0 -60
- package/packages/ui/src/components/comment-thread.tsx +0 -209
- package/packages/ui/src/components/commit-list.tsx +0 -100
- package/packages/ui/src/components/dashboard.tsx +0 -84
- package/packages/ui/src/components/diff-line.tsx +0 -90
- package/packages/ui/src/components/diff-page.tsx +0 -332
- package/packages/ui/src/components/diff-stats.tsx +0 -20
- package/packages/ui/src/components/diff-view.tsx +0 -278
- package/packages/ui/src/components/expand-row.tsx +0 -45
- package/packages/ui/src/components/file-block.tsx +0 -536
- package/packages/ui/src/components/file-tree-item.tsx +0 -84
- package/packages/ui/src/components/file-tree.tsx +0 -72
- package/packages/ui/src/components/general-comments.tsx +0 -174
- package/packages/ui/src/components/hunk-block-split.tsx +0 -357
- package/packages/ui/src/components/hunk-block.tsx +0 -161
- package/packages/ui/src/components/hunk-header.tsx +0 -144
- package/packages/ui/src/components/hunk-with-gap.tsx +0 -113
- package/packages/ui/src/components/icons/arrow-down-icon.tsx +0 -7
- package/packages/ui/src/components/icons/arrow-up-icon.tsx +0 -7
- package/packages/ui/src/components/icons/check-circle-icon.tsx +0 -8
- package/packages/ui/src/components/icons/check-icon.tsx +0 -9
- package/packages/ui/src/components/icons/chevron-down-icon.tsx +0 -11
- package/packages/ui/src/components/icons/chevron-icon.tsx +0 -20
- package/packages/ui/src/components/icons/chevron-up-down-icon.tsx +0 -7
- package/packages/ui/src/components/icons/chevron-up-icon.tsx +0 -11
- package/packages/ui/src/components/icons/comment-icon.tsx +0 -9
- package/packages/ui/src/components/icons/copy-icon.tsx +0 -10
- package/packages/ui/src/components/icons/eye-icon.tsx +0 -10
- package/packages/ui/src/components/icons/eye-off-icon.tsx +0 -12
- package/packages/ui/src/components/icons/file-icon.tsx +0 -7
- package/packages/ui/src/components/icons/folder-icon.tsx +0 -19
- package/packages/ui/src/components/icons/git-branch-icon.tsx +0 -13
- package/packages/ui/src/components/icons/keyboard-icon.tsx +0 -13
- package/packages/ui/src/components/icons/moon-icon.tsx +0 -9
- package/packages/ui/src/components/icons/plus-icon.tsx +0 -9
- package/packages/ui/src/components/icons/search-icon.tsx +0 -10
- package/packages/ui/src/components/icons/sidebar-icon.tsx +0 -10
- package/packages/ui/src/components/icons/spinner.tsx +0 -7
- package/packages/ui/src/components/icons/split-view-icon.tsx +0 -10
- package/packages/ui/src/components/icons/sun-icon.tsx +0 -17
- package/packages/ui/src/components/icons/trash-icon.tsx +0 -11
- package/packages/ui/src/components/icons/undo-icon.tsx +0 -9
- package/packages/ui/src/components/icons/unified-view-icon.tsx +0 -12
- package/packages/ui/src/components/icons/x-icon.tsx +0 -10
- package/packages/ui/src/components/line-number-cell.tsx +0 -18
- package/packages/ui/src/components/markdown-content.tsx +0 -139
- package/packages/ui/src/components/orphaned-threads.tsx +0 -80
- package/packages/ui/src/components/overview-file-list.tsx +0 -57
- package/packages/ui/src/components/render-expansion-rows.tsx +0 -47
- package/packages/ui/src/components/shortcut-modal.tsx +0 -93
- package/packages/ui/src/components/sidebar.tsx +0 -80
- package/packages/ui/src/components/skeleton.tsx +0 -9
- package/packages/ui/src/components/stale-diff-banner.tsx +0 -21
- package/packages/ui/src/components/summary-bar.tsx +0 -39
- package/packages/ui/src/components/toolbar.tsx +0 -246
- package/packages/ui/src/components/ui/badge.tsx +0 -17
- package/packages/ui/src/components/ui/confirm-dialog.tsx +0 -52
- package/packages/ui/src/components/ui/icon-button.tsx +0 -23
- package/packages/ui/src/components/ui/status-badge.tsx +0 -57
- package/packages/ui/src/components/ui/thread-badge.tsx +0 -35
- package/packages/ui/src/components/word-diff.tsx +0 -126
- package/packages/ui/src/hooks/use-comment-actions.ts +0 -97
- package/packages/ui/src/hooks/use-commits.ts +0 -12
- package/packages/ui/src/hooks/use-copy.ts +0 -18
- package/packages/ui/src/hooks/use-diff-staleness.ts +0 -58
- package/packages/ui/src/hooks/use-diff.ts +0 -12
- package/packages/ui/src/hooks/use-highlighter.ts +0 -190
- package/packages/ui/src/hooks/use-info.ts +0 -12
- package/packages/ui/src/hooks/use-keyboard.ts +0 -55
- package/packages/ui/src/hooks/use-line-selection.ts +0 -157
- package/packages/ui/src/hooks/use-overview.ts +0 -12
- package/packages/ui/src/hooks/use-review-threads.ts +0 -12
- package/packages/ui/src/hooks/use-search-params.ts +0 -26
- package/packages/ui/src/hooks/use-theme.ts +0 -34
- package/packages/ui/src/hooks/use-thread-navigation.ts +0 -43
- package/packages/ui/src/lib/api.ts +0 -232
- package/packages/ui/src/lib/cn.ts +0 -6
- package/packages/ui/src/lib/context-expansion.ts +0 -122
- package/packages/ui/src/lib/diff-utils.ts +0 -268
- package/packages/ui/src/lib/dom-utils.ts +0 -13
- package/packages/ui/src/lib/file-tree.ts +0 -122
- package/packages/ui/src/lib/query-client.ts +0 -10
- package/packages/ui/src/lib/render-content.tsx +0 -23
- package/packages/ui/src/lib/syntax-token.ts +0 -4
- package/packages/ui/src/main.tsx +0 -14
- package/packages/ui/src/queries/commits.ts +0 -9
- package/packages/ui/src/queries/diff.ts +0 -9
- package/packages/ui/src/queries/file.ts +0 -10
- package/packages/ui/src/queries/info.ts +0 -9
- package/packages/ui/src/queries/overview.ts +0 -9
- package/packages/ui/src/styles/app.css +0 -178
- package/packages/ui/src/types/comment.ts +0 -61
- package/packages/ui/src/vite-env.d.ts +0 -1
- package/packages/ui/tests/context-expansion.test.ts +0 -279
- package/packages/ui/tests/diff-utils.test.ts +0 -409
- package/packages/ui/tsconfig.json +0 -14
- package/packages/ui/vite.config.ts +0 -23
- package/scripts/build-skills.ts +0 -26
- package/scripts/build.ts +0 -15
- package/scripts/dev.ts +0 -32
- package/scripts/lib/transformers/claude-code.ts +0 -11
- package/scripts/lib/transformers/codex.ts +0 -17
- package/scripts/lib/transformers/cursor.ts +0 -17
- package/scripts/lib/transformers/index.ts +0 -3
- package/scripts/lib/utils.ts +0 -70
- package/scripts/link-dev.ts +0 -54
- package/skills/diffity-resolve/SKILL.md +0 -55
- package/skills/diffity-review/SKILL.md +0 -74
- package/skills/diffity-start/SKILL.md +0 -27
- package/tsconfig.json +0 -22
- /package/{packages/ui/public → dist/ui}/brand.svg +0 -0
- /package/{packages/ui/public → dist/ui}/favicon.svg +0 -0
|
@@ -1,536 +0,0 @@
|
|
|
1
|
-
import { useState, useMemo, useCallback } from 'react';
|
|
2
|
-
import { useQueryClient } from '@tanstack/react-query';
|
|
3
|
-
import type { DiffHunk } from '@diffity/parser';
|
|
4
|
-
import type { DiffFile, DiffLine as DiffLineType } from '@diffity/parser';
|
|
5
|
-
import type { SyntaxToken } from '../lib/syntax-token';
|
|
6
|
-
import type { HighlightedTokens } from '../hooks/use-highlighter';
|
|
7
|
-
import type { CommentSide, LineSelection } from '../types/comment';
|
|
8
|
-
import { type ViewMode, getFilePath, buildChangeGroupPatch, extractLinesFromDiff } from '../lib/diff-utils';
|
|
9
|
-
import { revertHunk as apiRevertHunk } from '../lib/api';
|
|
10
|
-
import { ConfirmDialog } from './ui/confirm-dialog';
|
|
11
|
-
import { computeGaps, createContextLines, getExpandRange, type ExpandableGap } from '../lib/context-expansion';
|
|
12
|
-
import { fileContentOptions } from '../queries/file';
|
|
13
|
-
import type { CommentActions } from '../hooks/use-comment-actions';
|
|
14
|
-
import type { CommentThread } from '../types/comment';
|
|
15
|
-
import { GENERAL_THREAD_FILE_PATH } from '../types/comment';
|
|
16
|
-
import { useLineSelection } from '../hooks/use-line-selection';
|
|
17
|
-
import { useCopy } from '../hooks/use-copy';
|
|
18
|
-
import { CopyIcon } from './icons/copy-icon';
|
|
19
|
-
import { CheckIcon } from './icons/check-icon';
|
|
20
|
-
import { CommentIcon } from './icons/comment-icon';
|
|
21
|
-
import { DiffStats } from './diff-stats';
|
|
22
|
-
import { Badge } from './ui/badge';
|
|
23
|
-
import { IconButton } from './ui/icon-button';
|
|
24
|
-
import { StatusBadge } from './ui/status-badge';
|
|
25
|
-
import { HunkWithGap } from './hunk-with-gap';
|
|
26
|
-
import { OrphanedThreads } from './orphaned-threads';
|
|
27
|
-
import { ThreadBadge } from './ui/thread-badge';
|
|
28
|
-
import { buildExpansionSyntaxMap, renderExpansionRows } from './render-expansion-rows';
|
|
29
|
-
import { ExpandRow } from './expand-row';
|
|
30
|
-
|
|
31
|
-
export const LARGE_DIFF_LINE_THRESHOLD = 200;
|
|
32
|
-
|
|
33
|
-
const DEFAULT_AUTHOR = { name: 'You', type: 'user' as const };
|
|
34
|
-
|
|
35
|
-
function getTotalLineCount(file: DiffFile): number {
|
|
36
|
-
let count = 0;
|
|
37
|
-
for (const hunk of file.hunks) {
|
|
38
|
-
count += hunk.lines.length;
|
|
39
|
-
}
|
|
40
|
-
return count;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface FileBlockProps {
|
|
44
|
-
file: DiffFile;
|
|
45
|
-
viewMode: ViewMode;
|
|
46
|
-
collapsed: boolean;
|
|
47
|
-
onToggleCollapse: (path: string) => void;
|
|
48
|
-
reviewed: boolean;
|
|
49
|
-
onReviewedChange: (path: string, reviewed: boolean) => void;
|
|
50
|
-
highlightLine?: (code: string) => HighlightedTokens[] | null;
|
|
51
|
-
baseRef?: string;
|
|
52
|
-
canRevert?: boolean;
|
|
53
|
-
onRevert?: () => void;
|
|
54
|
-
threads: CommentThread[];
|
|
55
|
-
commentsEnabled: boolean;
|
|
56
|
-
commentActions: CommentActions;
|
|
57
|
-
onAddThread: CommentActions['addThread'];
|
|
58
|
-
pendingSelection: LineSelection | null;
|
|
59
|
-
onPendingSelectionChange: (selection: LineSelection | null) => void;
|
|
60
|
-
highlighted?: boolean;
|
|
61
|
-
onHighlightEnd?: () => void;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
interface GapExpansion {
|
|
65
|
-
fromTop: number;
|
|
66
|
-
fromBottom: number;
|
|
67
|
-
linesFromTop: DiffLineType[];
|
|
68
|
-
linesFromBottom: DiffLineType[];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function FileBlock(props: FileBlockProps) {
|
|
72
|
-
const {
|
|
73
|
-
file, viewMode, collapsed, onToggleCollapse, reviewed, onReviewedChange, highlightLine, baseRef, canRevert, onRevert,
|
|
74
|
-
threads: allThreads, commentsEnabled, commentActions, onAddThread: rawAddThread, pendingSelection, onPendingSelectionChange,
|
|
75
|
-
highlighted, onHighlightEnd,
|
|
76
|
-
} = props;
|
|
77
|
-
|
|
78
|
-
const totalLines = getTotalLineCount(file);
|
|
79
|
-
const isLargeDiff = totalLines >= LARGE_DIFF_LINE_THRESHOLD;
|
|
80
|
-
|
|
81
|
-
const [largeDiffExpanded, setLargeDiffExpanded] = useState(false);
|
|
82
|
-
const [expansions, setExpansions] = useState<Map<string, GapExpansion>>(new Map());
|
|
83
|
-
const [loadingGap, setLoadingGap] = useState<string | null>(null);
|
|
84
|
-
|
|
85
|
-
const filePath = getFilePath(file);
|
|
86
|
-
const showRename = file.status === 'renamed' && file.oldPath !== file.newPath;
|
|
87
|
-
const isNewFile = file.status === 'added';
|
|
88
|
-
|
|
89
|
-
const queryClient = useQueryClient();
|
|
90
|
-
const fileContentPath = file.oldPath || filePath;
|
|
91
|
-
const fileLineCount = file.oldFileLineCount ?? null;
|
|
92
|
-
|
|
93
|
-
const { copied: pathCopied, copy: copyPath } = useCopy();
|
|
94
|
-
|
|
95
|
-
const [confirmRevertChange, setConfirmRevertChange] = useState<{ hunk: DiffHunk; startIndex: number; endIndex: number } | null>(null);
|
|
96
|
-
|
|
97
|
-
const handleRevertChange = useCallback(async (info: { hunk: DiffHunk; startIndex: number; endIndex: number }) => {
|
|
98
|
-
setConfirmRevertChange(null);
|
|
99
|
-
const patch = buildChangeGroupPatch(file, info.hunk, info.startIndex, info.endIndex);
|
|
100
|
-
await apiRevertHunk(patch);
|
|
101
|
-
onRevert?.();
|
|
102
|
-
}, [file, onRevert]);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const { addReply, resolveThread, unresolveThread, dismissThread, deleteComment, deleteThread } = commentActions;
|
|
106
|
-
|
|
107
|
-
const getOriginalCode = useCallback((side: CommentSide, startLine: number, endLine: number) => {
|
|
108
|
-
return extractLinesFromDiff(file.hunks, side, startLine, endLine);
|
|
109
|
-
}, [file.hunks]);
|
|
110
|
-
|
|
111
|
-
const addThread = useCallback((fp: string, side: CommentSide, startLine: number, endLine: number, body: string, author: import('../types/comment').CommentAuthor) => {
|
|
112
|
-
const anchorContent = extractLinesFromDiff(file.hunks, side, startLine, endLine);
|
|
113
|
-
rawAddThread(fp, side, startLine, endLine, body, author, anchorContent || undefined);
|
|
114
|
-
}, [rawAddThread, file.hunks]);
|
|
115
|
-
|
|
116
|
-
const allFileThreads = useMemo(() => {
|
|
117
|
-
return allThreads.filter(t => t.filePath === filePath && t.filePath !== GENERAL_THREAD_FILE_PATH);
|
|
118
|
-
}, [allThreads, filePath]);
|
|
119
|
-
|
|
120
|
-
const { anchoredThreads: fileThreads, orphanedThreads } = useMemo(() => {
|
|
121
|
-
const diffLineNumbers = new Set<string>();
|
|
122
|
-
for (const hunk of file.hunks) {
|
|
123
|
-
for (const line of hunk.lines) {
|
|
124
|
-
if (line.oldLineNumber !== null) {
|
|
125
|
-
diffLineNumbers.add(`old:${line.oldLineNumber}`);
|
|
126
|
-
}
|
|
127
|
-
if (line.newLineNumber !== null) {
|
|
128
|
-
diffLineNumbers.add(`new:${line.newLineNumber}`);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const anchored: typeof allFileThreads = [];
|
|
134
|
-
const orphaned: typeof allFileThreads = [];
|
|
135
|
-
for (const thread of allFileThreads) {
|
|
136
|
-
let isInDiff = false;
|
|
137
|
-
for (let line = thread.startLine; line <= thread.endLine; line++) {
|
|
138
|
-
if (diffLineNumbers.has(`${thread.side}:${line}`)) {
|
|
139
|
-
isInDiff = true;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (isInDiff) {
|
|
145
|
-
anchored.push(thread);
|
|
146
|
-
} else {
|
|
147
|
-
orphaned.push(thread);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return { anchoredThreads: anchored, orphanedThreads: orphaned };
|
|
152
|
-
}, [allFileThreads, file.hunks]);
|
|
153
|
-
|
|
154
|
-
const handleSelectionComplete = useCallback((selection: LineSelection) => {
|
|
155
|
-
if (!commentsEnabled) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
onPendingSelectionChange(selection);
|
|
159
|
-
}, [onPendingSelectionChange, commentsEnabled]);
|
|
160
|
-
|
|
161
|
-
const { isLineInSelection, handleLineMouseDown, handleLineMouseEnter } = useLineSelection({
|
|
162
|
-
filePath,
|
|
163
|
-
onSelectionComplete: handleSelectionComplete,
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
const handleCommentClickFn = useCallback((line: number, side: CommentSide) => {
|
|
167
|
-
onPendingSelectionChange({
|
|
168
|
-
filePath,
|
|
169
|
-
side,
|
|
170
|
-
startLine: line,
|
|
171
|
-
endLine: line,
|
|
172
|
-
});
|
|
173
|
-
}, [filePath, onPendingSelectionChange]);
|
|
174
|
-
|
|
175
|
-
const handleCommentClick = commentsEnabled ? handleCommentClickFn : undefined;
|
|
176
|
-
|
|
177
|
-
const handleCancelPending = useCallback(() => {
|
|
178
|
-
onPendingSelectionChange(null);
|
|
179
|
-
}, [onPendingSelectionChange]);
|
|
180
|
-
|
|
181
|
-
const isLineSelected = useCallback((line: number, side: CommentSide) => {
|
|
182
|
-
if (isLineInSelection(line, side)) {
|
|
183
|
-
return true;
|
|
184
|
-
}
|
|
185
|
-
if (pendingSelection && pendingSelection.filePath === filePath && pendingSelection.side === side) {
|
|
186
|
-
return line >= pendingSelection.startLine && line <= pendingSelection.endLine;
|
|
187
|
-
}
|
|
188
|
-
for (const thread of fileThreads) {
|
|
189
|
-
if (thread.side === side && line >= thread.startLine && line <= thread.endLine && thread.status === 'open') {
|
|
190
|
-
return true;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
return false;
|
|
194
|
-
}, [isLineInSelection, pendingSelection, filePath, fileThreads]);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
const syntaxMap = useMemo(() => {
|
|
198
|
-
if (!highlightLine) {
|
|
199
|
-
return undefined;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
const map = new Map<string, SyntaxToken[]>();
|
|
203
|
-
|
|
204
|
-
for (const hunk of file.hunks) {
|
|
205
|
-
for (const line of hunk.lines) {
|
|
206
|
-
const highlighted = highlightLine(line.content);
|
|
207
|
-
if (highlighted && highlighted.length > 0) {
|
|
208
|
-
const num = line.type === 'delete' ? line.oldLineNumber : line.newLineNumber;
|
|
209
|
-
const key = `${line.type}-${num}`;
|
|
210
|
-
map.set(key, highlighted[0].tokens);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return map;
|
|
216
|
-
}, [file, highlightLine]);
|
|
217
|
-
|
|
218
|
-
const gaps = useMemo(() => {
|
|
219
|
-
if (isNewFile) {
|
|
220
|
-
return [];
|
|
221
|
-
}
|
|
222
|
-
return computeGaps(file.hunks, fileLineCount);
|
|
223
|
-
}, [file.hunks, fileLineCount, isNewFile]);
|
|
224
|
-
|
|
225
|
-
const gapMap = useMemo(() => {
|
|
226
|
-
const map = new Map<string, ExpandableGap>();
|
|
227
|
-
for (const gap of gaps) {
|
|
228
|
-
map.set(gap.id, gap);
|
|
229
|
-
}
|
|
230
|
-
return map;
|
|
231
|
-
}, [gaps]);
|
|
232
|
-
|
|
233
|
-
const handleExpand = useCallback(async (gap: ExpandableGap, direction: 'up' | 'down' | 'all') => {
|
|
234
|
-
setLoadingGap(gap.id);
|
|
235
|
-
|
|
236
|
-
const lines = await queryClient.ensureQueryData(
|
|
237
|
-
fileContentOptions(fileContentPath, true, baseRef)
|
|
238
|
-
);
|
|
239
|
-
|
|
240
|
-
setExpansions(prev => {
|
|
241
|
-
const next = new Map(prev);
|
|
242
|
-
const existing = next.get(gap.id) || { fromTop: 0, fromBottom: 0, linesFromTop: [], linesFromBottom: [] };
|
|
243
|
-
const newOffset = gap.newStart - gap.oldStart;
|
|
244
|
-
const range = getExpandRange(gap, direction, existing);
|
|
245
|
-
|
|
246
|
-
if (!range) {
|
|
247
|
-
return prev;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const contextLines = createContextLines(lines, range.oldStart, range.oldEnd, newOffset);
|
|
251
|
-
|
|
252
|
-
if (direction === 'all') {
|
|
253
|
-
next.set(gap.id, {
|
|
254
|
-
fromTop: gap.oldEnd - gap.oldStart + 1,
|
|
255
|
-
fromBottom: 0,
|
|
256
|
-
linesFromTop: contextLines,
|
|
257
|
-
linesFromBottom: [],
|
|
258
|
-
});
|
|
259
|
-
} else if (direction === 'down') {
|
|
260
|
-
const newExpansion = {
|
|
261
|
-
...existing,
|
|
262
|
-
fromTop: existing.fromTop + (range.oldEnd - range.oldStart + 1),
|
|
263
|
-
linesFromTop: [...existing.linesFromTop, ...contextLines],
|
|
264
|
-
};
|
|
265
|
-
next.set(gap.id, newExpansion);
|
|
266
|
-
} else {
|
|
267
|
-
const newExpansion = {
|
|
268
|
-
...existing,
|
|
269
|
-
fromBottom: existing.fromBottom + (range.oldEnd - range.oldStart + 1),
|
|
270
|
-
linesFromBottom: [...contextLines, ...existing.linesFromBottom],
|
|
271
|
-
};
|
|
272
|
-
next.set(gap.id, newExpansion);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
return next;
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
setLoadingGap(null);
|
|
279
|
-
}, [fileContentPath, queryClient, baseRef]);
|
|
280
|
-
|
|
281
|
-
const getGapRemaining = useCallback((gap: ExpandableGap): { total: number; up: number; down: number } => {
|
|
282
|
-
const expansion = expansions.get(gap.id);
|
|
283
|
-
if (!expansion) {
|
|
284
|
-
return { total: gap.totalLines, up: gap.totalLines, down: gap.totalLines };
|
|
285
|
-
}
|
|
286
|
-
const total = Math.max(0, gap.totalLines - expansion.fromTop - expansion.fromBottom);
|
|
287
|
-
const up = Math.max(0, gap.totalLines - expansion.fromTop);
|
|
288
|
-
const down = Math.max(0, gap.totalLines - expansion.fromBottom);
|
|
289
|
-
return { total, up, down };
|
|
290
|
-
}, [expansions]);
|
|
291
|
-
|
|
292
|
-
const getExpandControlsForHunk = useCallback((hunkIndex: number) => {
|
|
293
|
-
let gap: ExpandableGap | undefined;
|
|
294
|
-
let position: 'top' | 'between' = 'between';
|
|
295
|
-
|
|
296
|
-
if (hunkIndex === 0) {
|
|
297
|
-
gap = gapMap.get('top');
|
|
298
|
-
position = 'top';
|
|
299
|
-
} else {
|
|
300
|
-
gap = gapMap.get(`between-${hunkIndex - 1}`);
|
|
301
|
-
position = 'between';
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
if (!gap) {
|
|
305
|
-
return undefined;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
const remaining = getGapRemaining(gap);
|
|
309
|
-
const wasExpanded = expansions.has(gap.id);
|
|
310
|
-
|
|
311
|
-
return {
|
|
312
|
-
position,
|
|
313
|
-
remainingLines: remaining.total,
|
|
314
|
-
remainingUp: remaining.up,
|
|
315
|
-
remainingDown: remaining.down,
|
|
316
|
-
loading: loadingGap === gap.id,
|
|
317
|
-
wasExpanded,
|
|
318
|
-
onExpand: (dir: 'up' | 'down' | 'all') => handleExpand(gap, dir),
|
|
319
|
-
};
|
|
320
|
-
}, [gapMap, getGapRemaining, loadingGap, handleExpand, expansions]);
|
|
321
|
-
|
|
322
|
-
const total = file.additions + file.deletions;
|
|
323
|
-
const addBlocks = total > 0 ? Math.round((file.additions / total) * Math.min(5, total)) : 0;
|
|
324
|
-
const delBlocks = total > 0 ? Math.min(5, total) - addBlocks : 0;
|
|
325
|
-
const neutralBlocks = 5 - addBlocks - delBlocks;
|
|
326
|
-
|
|
327
|
-
const bottomGap = gapMap.get('bottom');
|
|
328
|
-
const bottomRemaining = bottomGap ? getGapRemaining(bottomGap).total : 0;
|
|
329
|
-
|
|
330
|
-
const filePendingSelection = pendingSelection && pendingSelection.filePath === filePath ? pendingSelection : null;
|
|
331
|
-
|
|
332
|
-
return (
|
|
333
|
-
<div
|
|
334
|
-
className={`border rounded-lg mx-4 my-3 overflow-hidden ${highlighted ? 'animate-flash-highlight-border' : 'border-border'}`}
|
|
335
|
-
id={`file-${encodeURIComponent(filePath)}`}
|
|
336
|
-
onAnimationEnd={onHighlightEnd}
|
|
337
|
-
>
|
|
338
|
-
<div
|
|
339
|
-
className={`group flex items-center gap-2 px-3 py-1.5 border-border text-xs sticky top-0 z-10 shadow-sticky ${highlighted ? 'animate-flash-highlight' : 'bg-bg-secondary'}`}
|
|
340
|
-
>
|
|
341
|
-
<IconButton
|
|
342
|
-
className="text-[10px] w-4 h-4 shrink-0"
|
|
343
|
-
onClick={() => onToggleCollapse(filePath)}
|
|
344
|
-
title={collapsed ? 'Expand' : 'Collapse'}
|
|
345
|
-
>
|
|
346
|
-
{collapsed ? '\u25b6' : '\u25bc'}
|
|
347
|
-
</IconButton>
|
|
348
|
-
<button
|
|
349
|
-
className="font-mono text-xs truncate text-left cursor-pointer hover:text-accent transition-colors"
|
|
350
|
-
onClick={() => onToggleCollapse(filePath)}
|
|
351
|
-
>
|
|
352
|
-
{showRename ? (
|
|
353
|
-
<>
|
|
354
|
-
<span className="line-through text-text-muted">{file.oldPath}</span>
|
|
355
|
-
<span className="text-text-muted"> → </span>
|
|
356
|
-
<span>{file.newPath}</span>
|
|
357
|
-
</>
|
|
358
|
-
) : (
|
|
359
|
-
filePath
|
|
360
|
-
)}
|
|
361
|
-
</button>
|
|
362
|
-
<button
|
|
363
|
-
onClick={() => copyPath(filePath)}
|
|
364
|
-
className="shrink-0 text-text-muted hover:text-text transition-colors cursor-pointer"
|
|
365
|
-
title="Copy file path"
|
|
366
|
-
>
|
|
367
|
-
{pathCopied ? (
|
|
368
|
-
<CheckIcon className="w-3 h-3 text-added" />
|
|
369
|
-
) : (
|
|
370
|
-
<CopyIcon className="w-3 h-3" />
|
|
371
|
-
)}
|
|
372
|
-
</button>
|
|
373
|
-
{file.status !== 'modified' && <StatusBadge status={file.status} />}
|
|
374
|
-
{file.isBinary && <Badge className="bg-bg-tertiary text-text-muted">Binary</Badge>}
|
|
375
|
-
<div className="ml-auto flex items-center gap-2.5 shrink-0">
|
|
376
|
-
{(fileThreads.length + orphanedThreads.length) > 0 && (
|
|
377
|
-
<span className="text-[11px] text-text-muted flex items-center gap-1">
|
|
378
|
-
<CommentIcon className="w-3 h-3" />
|
|
379
|
-
{fileThreads.length + orphanedThreads.length}
|
|
380
|
-
{orphanedThreads.length > 0 && (
|
|
381
|
-
<ThreadBadge variant="outdated" size="sm">
|
|
382
|
-
{orphanedThreads.length} outdated
|
|
383
|
-
</ThreadBadge>
|
|
384
|
-
)}
|
|
385
|
-
</span>
|
|
386
|
-
)}
|
|
387
|
-
<div className="flex items-center gap-1.5">
|
|
388
|
-
<DiffStats additions={file.additions} deletions={file.deletions} />
|
|
389
|
-
<div className="flex gap-px">
|
|
390
|
-
{Array.from({ length: addBlocks }).map((_, i) => (
|
|
391
|
-
<span key={`a${i}`} className="w-1.5 h-1.5 rounded-sm bg-added" />
|
|
392
|
-
))}
|
|
393
|
-
{Array.from({ length: delBlocks }).map((_, i) => (
|
|
394
|
-
<span key={`d${i}`} className="w-1.5 h-1.5 rounded-sm bg-deleted" />
|
|
395
|
-
))}
|
|
396
|
-
{Array.from({ length: neutralBlocks }).map((_, i) => (
|
|
397
|
-
<span key={`n${i}`} className="w-1.5 h-1.5 rounded-sm bg-border" />
|
|
398
|
-
))}
|
|
399
|
-
</div>
|
|
400
|
-
</div>
|
|
401
|
-
<label className="flex items-center gap-1.5 text-[11px] text-text-muted cursor-pointer select-none hover:text-text transition-colors">
|
|
402
|
-
<input
|
|
403
|
-
type="checkbox"
|
|
404
|
-
checked={reviewed}
|
|
405
|
-
onChange={() => onReviewedChange(filePath, !reviewed)}
|
|
406
|
-
className="accent-added cursor-pointer w-3 h-3"
|
|
407
|
-
/>
|
|
408
|
-
Viewed
|
|
409
|
-
</label>
|
|
410
|
-
</div>
|
|
411
|
-
</div>
|
|
412
|
-
{!collapsed && (
|
|
413
|
-
<div>
|
|
414
|
-
{file.isBinary ? (
|
|
415
|
-
<div className="p-4 text-center text-text-muted italic">Binary file not shown</div>
|
|
416
|
-
) : file.hunks.length === 0 ? (
|
|
417
|
-
<div className="p-4 text-center text-text-muted italic">
|
|
418
|
-
{file.oldMode && file.newMode
|
|
419
|
-
? `File mode changed from ${file.oldMode} to ${file.newMode}`
|
|
420
|
-
: 'No content changes'}
|
|
421
|
-
</div>
|
|
422
|
-
) : isLargeDiff && !largeDiffExpanded ? (
|
|
423
|
-
<div className="flex items-center justify-center gap-3 py-6 px-4 text-sm text-text-muted">
|
|
424
|
-
<span>Large diff not rendered — {totalLines} lines</span>
|
|
425
|
-
<button
|
|
426
|
-
className="text-accent hover:underline cursor-pointer font-medium"
|
|
427
|
-
onClick={() => setLargeDiffExpanded(true)}
|
|
428
|
-
>
|
|
429
|
-
Load diff
|
|
430
|
-
</button>
|
|
431
|
-
</div>
|
|
432
|
-
) : (
|
|
433
|
-
<>
|
|
434
|
-
<OrphanedThreads
|
|
435
|
-
threads={orphanedThreads}
|
|
436
|
-
onDeleteComment={deleteComment}
|
|
437
|
-
onDeleteThread={deleteThread}
|
|
438
|
-
/>
|
|
439
|
-
<table className="w-full border-collapse table-fixed">
|
|
440
|
-
{viewMode === 'split' ? (
|
|
441
|
-
<colgroup>
|
|
442
|
-
<col className="w-12.5" />
|
|
443
|
-
<col className="w-[calc(50%-50px)]" />
|
|
444
|
-
<col className="w-12.5" />
|
|
445
|
-
<col />
|
|
446
|
-
</colgroup>
|
|
447
|
-
) : (
|
|
448
|
-
<colgroup>
|
|
449
|
-
<col className="w-12.5" />
|
|
450
|
-
<col className="w-12.5" />
|
|
451
|
-
<col className="w-5" />
|
|
452
|
-
<col />
|
|
453
|
-
</colgroup>
|
|
454
|
-
)}
|
|
455
|
-
{file.hunks.map((hunk, i) => {
|
|
456
|
-
const betweenGap = i > 0 ? gapMap.get(`between-${i - 1}`) : undefined;
|
|
457
|
-
const betweenExpansion = betweenGap ? expansions.get(betweenGap.id) : undefined;
|
|
458
|
-
const topExpansion = i === 0 ? expansions.get('top') : undefined;
|
|
459
|
-
|
|
460
|
-
return (
|
|
461
|
-
<HunkWithGap
|
|
462
|
-
key={i}
|
|
463
|
-
hunk={hunk}
|
|
464
|
-
viewMode={viewMode}
|
|
465
|
-
syntaxMap={syntaxMap}
|
|
466
|
-
expandControls={getExpandControlsForHunk(i)}
|
|
467
|
-
topExpansionLines={i === 0 ? [...(topExpansion?.linesFromTop ?? []), ...(topExpansion?.linesFromBottom ?? [])] : undefined}
|
|
468
|
-
gapExpansion={betweenExpansion}
|
|
469
|
-
gapId={betweenGap?.id}
|
|
470
|
-
highlightLine={highlightLine}
|
|
471
|
-
threads={fileThreads}
|
|
472
|
-
pendingSelection={filePendingSelection}
|
|
473
|
-
currentAuthor={DEFAULT_AUTHOR}
|
|
474
|
-
isLineSelected={isLineSelected}
|
|
475
|
-
onLineMouseDown={handleLineMouseDown}
|
|
476
|
-
onLineMouseEnter={handleLineMouseEnter}
|
|
477
|
-
onCommentClick={handleCommentClick}
|
|
478
|
-
onAddThread={addThread}
|
|
479
|
-
onReply={addReply}
|
|
480
|
-
onResolve={resolveThread}
|
|
481
|
-
onUnresolve={unresolveThread}
|
|
482
|
-
onDeleteComment={deleteComment}
|
|
483
|
-
onDeleteThread={deleteThread}
|
|
484
|
-
onCancelPending={handleCancelPending}
|
|
485
|
-
filePath={filePath}
|
|
486
|
-
onRevertChange={canRevert ? (h: DiffHunk, startIndex: number, endIndex: number) => setConfirmRevertChange({ hunk: h, startIndex, endIndex }) : undefined}
|
|
487
|
-
getOriginalCode={getOriginalCode}
|
|
488
|
-
/>
|
|
489
|
-
);
|
|
490
|
-
})}
|
|
491
|
-
{bottomGap && (() => {
|
|
492
|
-
const bottomExpansion = expansions.get('bottom');
|
|
493
|
-
const bottomLines = [
|
|
494
|
-
...(bottomExpansion?.linesFromTop ?? []),
|
|
495
|
-
...(bottomExpansion?.linesFromBottom ?? []),
|
|
496
|
-
];
|
|
497
|
-
const bottomSyntaxMap = buildExpansionSyntaxMap(bottomLines, highlightLine);
|
|
498
|
-
const bottomCommentProps = {
|
|
499
|
-
isLineSelected, onLineMouseDown: handleLineMouseDown, onLineMouseEnter: handleLineMouseEnter,
|
|
500
|
-
onCommentClick: handleCommentClick, threads: fileThreads, pendingSelection: filePendingSelection,
|
|
501
|
-
currentAuthor: DEFAULT_AUTHOR, onAddThread: addThread, onReply: addReply,
|
|
502
|
-
onResolve: resolveThread, onUnresolve: unresolveThread, onDeleteComment: deleteComment,
|
|
503
|
-
onDeleteThread: deleteThread, onCancelPending: handleCancelPending, filePath,
|
|
504
|
-
getOriginalCode,
|
|
505
|
-
};
|
|
506
|
-
return (
|
|
507
|
-
<tbody>
|
|
508
|
-
{bottomExpansion?.linesFromTop && bottomExpansion.linesFromTop.length > 0 &&
|
|
509
|
-
renderExpansionRows(bottomExpansion.linesFromTop, viewMode, 'bottom-top', bottomSyntaxMap, bottomCommentProps)}
|
|
510
|
-
<ExpandRow
|
|
511
|
-
position="bottom"
|
|
512
|
-
remainingLines={bottomRemaining}
|
|
513
|
-
loading={loadingGap === 'bottom'}
|
|
514
|
-
onExpand={(dir) => handleExpand(bottomGap, dir)}
|
|
515
|
-
/>
|
|
516
|
-
{bottomExpansion?.linesFromBottom && bottomExpansion.linesFromBottom.length > 0 &&
|
|
517
|
-
renderExpansionRows(bottomExpansion.linesFromBottom, viewMode, 'bottom-bot', bottomSyntaxMap, bottomCommentProps)}
|
|
518
|
-
</tbody>
|
|
519
|
-
);
|
|
520
|
-
})()}
|
|
521
|
-
</table>
|
|
522
|
-
</>
|
|
523
|
-
)}
|
|
524
|
-
</div>
|
|
525
|
-
)}
|
|
526
|
-
{confirmRevertChange && (
|
|
527
|
-
<ConfirmDialog
|
|
528
|
-
title="Undo change"
|
|
529
|
-
message="This will undo the selected change. This cannot be undone."
|
|
530
|
-
onConfirm={() => handleRevertChange(confirmRevertChange)}
|
|
531
|
-
onCancel={() => setConfirmRevertChange(null)}
|
|
532
|
-
/>
|
|
533
|
-
)}
|
|
534
|
-
</div>
|
|
535
|
-
);
|
|
536
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { TreeNode } from '../lib/file-tree';
|
|
2
|
-
import { cn } from '../lib/cn';
|
|
3
|
-
import { DiffStats } from './diff-stats';
|
|
4
|
-
import { StatusBadge } from './ui/status-badge';
|
|
5
|
-
import { ChevronIcon } from './icons/chevron-icon';
|
|
6
|
-
import { FolderIcon } from './icons/folder-icon';
|
|
7
|
-
import { CommentIcon } from './icons/comment-icon';
|
|
8
|
-
|
|
9
|
-
interface FileTreeItemProps {
|
|
10
|
-
node: TreeNode;
|
|
11
|
-
depth: number;
|
|
12
|
-
activeFile: string | null;
|
|
13
|
-
reviewedFiles: Set<string>;
|
|
14
|
-
filesWithComments: Set<string>;
|
|
15
|
-
expandedDirs: Set<string>;
|
|
16
|
-
onToggleDir: (path: string) => void;
|
|
17
|
-
onFileClick: (path: string) => void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function FileTreeItem(props: FileTreeItemProps) {
|
|
21
|
-
const { node, depth, activeFile, reviewedFiles, filesWithComments, expandedDirs, onToggleDir, onFileClick } = props;
|
|
22
|
-
const paddingLeft = depth * 12 + 8;
|
|
23
|
-
|
|
24
|
-
if (node.type === 'dir') {
|
|
25
|
-
const isExpanded = expandedDirs.has(node.path);
|
|
26
|
-
return (
|
|
27
|
-
<>
|
|
28
|
-
<button
|
|
29
|
-
className="flex items-center gap-1.5 w-full py-1 pr-2 text-left text-[13px] hover:bg-hover cursor-pointer"
|
|
30
|
-
style={{ paddingLeft: `${paddingLeft}px` }}
|
|
31
|
-
onClick={() => onToggleDir(node.path)}
|
|
32
|
-
>
|
|
33
|
-
<ChevronIcon expanded={isExpanded} />
|
|
34
|
-
<FolderIcon open={isExpanded} />
|
|
35
|
-
<span className="truncate font-medium text-text-secondary">{node.name}</span>
|
|
36
|
-
</button>
|
|
37
|
-
{isExpanded && node.children.map(child => (
|
|
38
|
-
<FileTreeItem
|
|
39
|
-
key={child.path}
|
|
40
|
-
node={child}
|
|
41
|
-
depth={depth + 1}
|
|
42
|
-
activeFile={activeFile}
|
|
43
|
-
reviewedFiles={reviewedFiles}
|
|
44
|
-
filesWithComments={filesWithComments}
|
|
45
|
-
expandedDirs={expandedDirs}
|
|
46
|
-
onToggleDir={onToggleDir}
|
|
47
|
-
onFileClick={onFileClick}
|
|
48
|
-
/>
|
|
49
|
-
))}
|
|
50
|
-
</>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const isActive = activeFile === node.path;
|
|
55
|
-
const isReviewed = reviewedFiles.has(node.path);
|
|
56
|
-
const hasComments = filesWithComments.has(node.path);
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<button
|
|
60
|
-
className={cn(
|
|
61
|
-
'flex items-center gap-1.5 w-full py-1 pr-2 text-left text-[13px] cursor-pointer border-l-2',
|
|
62
|
-
isActive
|
|
63
|
-
? 'bg-active border-l-accent'
|
|
64
|
-
: 'border-l-transparent hover:bg-hover',
|
|
65
|
-
isReviewed && 'opacity-50'
|
|
66
|
-
)}
|
|
67
|
-
style={{ paddingLeft: `${paddingLeft + 15}px` }}
|
|
68
|
-
onClick={() => onFileClick(node.path)}
|
|
69
|
-
>
|
|
70
|
-
<StatusBadge status={node.file.status} compact />
|
|
71
|
-
<span className={cn('flex-1 min-w-0 truncate', isReviewed && 'line-through')}>
|
|
72
|
-
{node.name}
|
|
73
|
-
</span>
|
|
74
|
-
{hasComments && (
|
|
75
|
-
<CommentIcon className="w-3 h-3 text-accent shrink-0" />
|
|
76
|
-
)}
|
|
77
|
-
{isReviewed ? (
|
|
78
|
-
<span className="text-added text-[10px] shrink-0" title="Viewed">✓</span>
|
|
79
|
-
) : (
|
|
80
|
-
<DiffStats additions={node.file.additions} deletions={node.file.deletions} />
|
|
81
|
-
)}
|
|
82
|
-
</button>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { useMemo, useState, useCallback, useRef } from 'react';
|
|
2
|
-
import type { DiffFile } from '@diffity/parser';
|
|
3
|
-
import {
|
|
4
|
-
buildFileTree,
|
|
5
|
-
collapseSingleChildDirs,
|
|
6
|
-
sortTree,
|
|
7
|
-
filterTree,
|
|
8
|
-
collectAllDirPaths,
|
|
9
|
-
} from '../lib/file-tree';
|
|
10
|
-
import { FileTreeItem } from './file-tree-item';
|
|
11
|
-
|
|
12
|
-
interface FileTreeProps {
|
|
13
|
-
files: DiffFile[];
|
|
14
|
-
search: string;
|
|
15
|
-
activeFile: string | null;
|
|
16
|
-
reviewedFiles: Set<string>;
|
|
17
|
-
filesWithComments: Set<string>;
|
|
18
|
-
onFileClick: (path: string) => void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function FileTree(props: FileTreeProps) {
|
|
22
|
-
const { files, search, activeFile, reviewedFiles, filesWithComments, onFileClick } = props;
|
|
23
|
-
|
|
24
|
-
const tree = useMemo(() => {
|
|
25
|
-
return sortTree(collapseSingleChildDirs(buildFileTree(files)));
|
|
26
|
-
}, [files]);
|
|
27
|
-
|
|
28
|
-
const prevTreeRef = useRef(tree);
|
|
29
|
-
const [expandedDirs, setExpandedDirs] = useState<Set<string>>(() => new Set(collectAllDirPaths(tree)));
|
|
30
|
-
|
|
31
|
-
if (prevTreeRef.current !== tree) {
|
|
32
|
-
prevTreeRef.current = tree;
|
|
33
|
-
setExpandedDirs(new Set(collectAllDirPaths(tree)));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const displayTree = useMemo(() => {
|
|
37
|
-
if (!search) {
|
|
38
|
-
return tree;
|
|
39
|
-
}
|
|
40
|
-
return filterTree(tree, search);
|
|
41
|
-
}, [tree, search]);
|
|
42
|
-
|
|
43
|
-
const handleToggleDir = useCallback((path: string) => {
|
|
44
|
-
setExpandedDirs(prev => {
|
|
45
|
-
const next = new Set(prev);
|
|
46
|
-
if (next.has(path)) {
|
|
47
|
-
next.delete(path);
|
|
48
|
-
} else {
|
|
49
|
-
next.add(path);
|
|
50
|
-
}
|
|
51
|
-
return next;
|
|
52
|
-
});
|
|
53
|
-
}, []);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div className="flex-1 overflow-y-auto py-1">
|
|
57
|
-
{displayTree.map(node => (
|
|
58
|
-
<FileTreeItem
|
|
59
|
-
key={node.path}
|
|
60
|
-
node={node}
|
|
61
|
-
depth={0}
|
|
62
|
-
activeFile={activeFile}
|
|
63
|
-
reviewedFiles={reviewedFiles}
|
|
64
|
-
filesWithComments={filesWithComments}
|
|
65
|
-
expandedDirs={expandedDirs}
|
|
66
|
-
onToggleDir={handleToggleDir}
|
|
67
|
-
onFileClick={onFileClick}
|
|
68
|
-
/>
|
|
69
|
-
))}
|
|
70
|
-
</div>
|
|
71
|
-
);
|
|
72
|
-
}
|