Merge branch 'code-refactor'

This commit is contained in:
Raza Rauf
2026-01-15 06:29:30 +05:00
4 changed files with 14152 additions and 11488 deletions

4
.gitignore vendored
View File

@@ -49,3 +49,7 @@ logs/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
#VS Code
.VSCodeCounter
.qodo

76
package-lock.json generated
View File

@@ -257,6 +257,7 @@
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.28.5",
@@ -660,6 +661,7 @@
}
],
"license": "MIT",
"peer": true,
"engines": {
"node": ">=18"
},
@@ -703,6 +705,7 @@
}
],
"license": "MIT",
"peer": true,
"engines": {
"node": ">=18"
}
@@ -2276,6 +2279,7 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz",
"integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": ">=8.0.0"
}
@@ -2297,6 +2301,7 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/context-async-hooks/-/context-async-hooks-2.2.0.tgz",
"integrity": "sha512-qRkLWiUEZNAmYapZ7KGS5C4OmBLcP/H2foXeOEaowYCR0wi89fHejrfYfbuLVCMLp/dWZXKvQusdbUEZjERfwQ==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": "^18.19.0 || >=20.6.0"
},
@@ -2309,6 +2314,7 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-2.2.0.tgz",
"integrity": "sha512-FuabnnUm8LflnieVxs6eP7Z383hgQU4W1e3KJS6aOG3RxWxcHyBxH8fDMHNgu/gFx/M2jvTOW/4/PHhLz6bjWw==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@opentelemetry/semantic-conventions": "^1.29.0"
},
@@ -2324,6 +2330,7 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.208.0.tgz",
"integrity": "sha512-Eju0L4qWcQS+oXxi6pgh7zvE2byogAkcsVv0OjHF/97iOz1N/aKE6etSGowYkie+YA1uo6DNwdSxaaNnLvcRlA==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@opentelemetry/api-logs": "0.208.0",
"import-in-the-middle": "^2.0.0",
@@ -2711,6 +2718,7 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-2.2.0.tgz",
"integrity": "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@opentelemetry/core": "2.2.0",
"@opentelemetry/semantic-conventions": "^1.29.0"
@@ -2727,6 +2735,7 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-2.2.0.tgz",
"integrity": "sha512-xWQgL0Bmctsalg6PaXExmzdedSp3gyKV8mQBwK/j9VGdCDu2fmXIb2gAehBKbkXCpJ4HPkgv3QfoJWRT4dHWbw==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@opentelemetry/core": "2.2.0",
"@opentelemetry/resources": "2.2.0",
@@ -2744,6 +2753,7 @@
"resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.38.0.tgz",
"integrity": "sha512-kocjix+/sSggfJhwXqClZ3i9Y/MI0fp7b+g7kCRm6psy2dsf8uApTRclwG18h8Avm7C9+fnt+O36PspJ/OzoWg==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"node": ">=14"
}
@@ -3634,8 +3644,7 @@
"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
"integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/@types/babel__core": {
"version": "7.20.5",
@@ -4166,6 +4175,7 @@
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.27.tgz",
"integrity": "sha512-cisd7gxkzjBKU2GgdYrTdtQx1SORymWyaAFhaxQPK9bYO9ot3Y5OikQRvY0VYQtvwjeQnizCINJAenh/V7MK2w==",
"license": "MIT",
"peer": true,
"dependencies": {
"@types/prop-types": "*",
"csstype": "^3.2.2"
@@ -4177,6 +4187,7 @@
"integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
"dev": true,
"license": "MIT",
"peer": true,
"peerDependencies": {
"@types/react": "^18.0.0"
}
@@ -4302,6 +4313,7 @@
"integrity": "sha512-hM5faZwg7aVNa819m/5r7D0h0c9yC4DUlWAOvHAtISdFTc8xB86VmX5Xqabrama3wIPJ/q9RbGS1worb6JfnMg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.50.1",
"@typescript-eslint/types": "8.50.1",
@@ -4732,6 +4744,7 @@
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"license": "MIT",
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -4813,6 +4826,7 @@
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
@@ -5816,6 +5830,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.8.25",
"caniuse-lite": "^1.0.30001754",
@@ -6298,6 +6313,7 @@
"resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-11.0.3.tgz",
"integrity": "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"@chevrotain/cst-dts-gen": "11.0.3",
"@chevrotain/gast": "11.0.3",
@@ -7023,6 +7039,7 @@
"resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.33.1.tgz",
"integrity": "sha512-iJc4TwyANnOGR1OmWhsS9ayRS3s+XQ185FmuHObThD+5AeJCakAAbWv8KimMTt08xCCLNgneQwFp+JRJOr9qGQ==",
"license": "MIT",
"peer": true,
"engines": {
"node": ">=0.10"
}
@@ -7432,6 +7449,7 @@
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
"license": "ISC",
"peer": true,
"engines": {
"node": ">=12"
}
@@ -7929,6 +7947,7 @@
"integrity": "sha512-rcJUkMfnJpfCboZoOOPf4L29TRtEieHNOeAbYPWPxlaBw/Z1RKrRA86dOI9rwaI4tQSc/RD82zTNHprfUHXsoQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"app-builder-lib": "24.13.3",
"builder-util": "24.13.1",
@@ -8024,8 +8043,7 @@
"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz",
"integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/dompurify": {
"version": "3.3.0",
@@ -8169,7 +8187,6 @@
"integrity": "sha512-oHkV0iogWfyK+ah9ZIvMDpei1m9ZRpdXcvde1wTpra2U8AFDNNpqJdnin5z+PM1GbQ5BoaKCWas2HSjtR0HwMg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"app-builder-lib": "24.13.3",
"archiver": "^5.3.1",
@@ -8183,7 +8200,6 @@
"integrity": "sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"archiver-utils": "^2.1.0",
"async": "^3.2.4",
@@ -8203,7 +8219,6 @@
"integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"glob": "^7.1.4",
"graceful-fs": "^4.2.0",
@@ -8226,7 +8241,6 @@
"integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
@@ -8243,7 +8257,6 @@
"integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"buffer-crc32": "^0.2.13",
"crc32-stream": "^4.0.2",
@@ -8260,7 +8273,6 @@
"integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"crc-32": "^1.2.0",
"readable-stream": "^3.4.0"
@@ -8275,7 +8287,6 @@
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
@@ -8291,7 +8302,6 @@
"integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"universalify": "^2.0.0"
},
@@ -8304,8 +8314,7 @@
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/electron-builder-squirrel-windows/node_modules/string_decoder": {
"version": "1.1.1",
@@ -8313,7 +8322,6 @@
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"safe-buffer": "~5.1.0"
}
@@ -8324,7 +8332,6 @@
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">= 10.0.0"
}
@@ -8335,7 +8342,6 @@
"integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"archiver-utils": "^3.0.4",
"compress-commons": "^4.1.2",
@@ -8351,7 +8357,6 @@
"integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"glob": "^7.2.3",
"graceful-fs": "^4.2.0",
@@ -9023,6 +9028,7 @@
"integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.1",
@@ -10903,6 +10909,7 @@
"resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz",
"integrity": "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==",
"license": "MIT",
"peer": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/immer"
@@ -11723,6 +11730,7 @@
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
"dev": true,
"license": "MIT",
"peer": true,
"bin": {
"jiti": "bin/jiti.js"
}
@@ -12136,16 +12144,14 @@
"resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
"integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/lodash.difference": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz",
"integrity": "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/lodash.escaperegexp": {
"version": "4.1.2",
@@ -12158,8 +12164,7 @@
"resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz",
"integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
@@ -12173,8 +12178,7 @@
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
"integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/lodash.merge": {
"version": "4.6.2",
@@ -12188,8 +12192,7 @@
"resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz",
"integrity": "sha512-c4pB2CdGrGdjMKYLA+XiRDO7Y0PRQbm/Gzg8qMj+QH+pFVAoTp5sBpO0odL3FjoPCGjK96p6qsP+yQoiLoOBcw==",
"dev": true,
"license": "MIT",
"peer": true
"license": "MIT"
},
"node_modules/log-symbols": {
"version": "4.1.0",
@@ -12280,7 +12283,6 @@
"integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==",
"dev": true,
"license": "MIT",
"peer": true,
"bin": {
"lz-string": "bin/bin.js"
}
@@ -14771,6 +14773,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
@@ -14995,7 +14998,6 @@
"integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"ansi-regex": "^5.0.1",
"ansi-styles": "^5.0.0",
@@ -15011,7 +15013,6 @@
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=10"
},
@@ -15356,6 +15357,7 @@
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"loose-envify": "^1.1.0"
},
@@ -15385,6 +15387,7 @@
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
"integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
"license": "MIT",
"peer": true,
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.2"
@@ -15432,6 +15435,7 @@
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz",
"integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==",
"license": "MIT",
"peer": true,
"dependencies": {
"@types/use-sync-external-store": "^0.0.6",
"use-sync-external-store": "^1.4.0"
@@ -15618,7 +15622,8 @@
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
"integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/redux-thunk": {
"version": "3.1.0",
@@ -17368,6 +17373,7 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},
@@ -17678,6 +17684,7 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -18026,6 +18033,7 @@
"integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "^0.21.3",
"postcss": "^8.4.43",
@@ -18531,6 +18539,7 @@
"integrity": "sha512-n1RxDp8UJm6N0IbJLQo+yzLZ2sQCDyl1o0LeugbPWf8+8Fttp29GghsQBjYJVmWq3gBFfe9Hs1spR44vovn2wA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@vitest/expect": "4.0.15",
"@vitest/mocker": "4.0.15",
@@ -19121,6 +19130,7 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},
@@ -19134,6 +19144,7 @@
"integrity": "sha512-tI2l/nFHC5rLh7+5+o7QjKjSR04ivXDF4jcgV0f/bTQ+OJiITy5S6gaynVsEM+7RqzufMnVbIon6Sr5x1SDYaQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.5.0",
@@ -19724,6 +19735,7 @@
"integrity": "sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==",
"dev": true,
"license": "MIT",
"peer": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,15 @@
* Phase 2 of App.tsx decomposition - see refactor-details-2.md for full plan.
*/
import React, { createContext, useContext, useState, useCallback, useMemo, ReactNode, useRef } from 'react';
import React, {
createContext,
useContext,
useState,
useCallback,
useMemo,
ReactNode,
useRef
} from 'react';
import type { FocusArea, RightPanelTab } from '../types';
import type { FlatFileItem } from '../components/FileSearchModal';
@@ -15,81 +23,83 @@ import type { FlatFileItem } from '../components/FileSearchModal';
* UI Layout context value - all layout states and their setters
*/
export interface UILayoutContextValue {
// Sidebar State
leftSidebarOpen: boolean;
setLeftSidebarOpen: (open: boolean) => void;
toggleLeftSidebar: () => void;
rightPanelOpen: boolean;
setRightPanelOpen: (open: boolean) => void;
toggleRightPanel: () => void;
// Sidebar State
leftSidebarOpen: boolean;
setLeftSidebarOpen: React.Dispatch<React.SetStateAction<boolean>>;
toggleLeftSidebar: () => void;
rightPanelOpen: boolean;
setRightPanelOpen: React.Dispatch<React.SetStateAction<boolean>>;
toggleRightPanel: () => void;
// Focus State
activeFocus: FocusArea;
setActiveFocus: (focus: FocusArea) => void;
activeRightTab: RightPanelTab;
setActiveRightTab: (tab: RightPanelTab) => void;
// Focus State
activeFocus: FocusArea;
setActiveFocus: React.Dispatch<React.SetStateAction<FocusArea>>;
activeRightTab: RightPanelTab;
setActiveRightTab: React.Dispatch<React.SetStateAction<RightPanelTab>>;
// Sidebar collapse/expand state
bookmarksCollapsed: boolean;
setBookmarksCollapsed: (collapsed: boolean) => void;
toggleBookmarksCollapsed: () => void;
groupChatsExpanded: boolean;
setGroupChatsExpanded: (expanded: boolean) => void;
toggleGroupChatsExpanded: () => void;
// Sidebar collapse/expand state
bookmarksCollapsed: boolean;
setBookmarksCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
toggleBookmarksCollapsed: () => void;
groupChatsExpanded: boolean;
setGroupChatsExpanded: React.Dispatch<React.SetStateAction<boolean>>;
toggleGroupChatsExpanded: () => void;
// Session list filter state
showUnreadOnly: boolean;
setShowUnreadOnly: (show: boolean) => void;
toggleShowUnreadOnly: () => void;
preFilterActiveTabIdRef: React.MutableRefObject<string | null>;
// Session list filter state
showUnreadOnly: boolean;
setShowUnreadOnly: React.Dispatch<React.SetStateAction<boolean>>;
toggleShowUnreadOnly: () => void;
preFilterActiveTabIdRef: React.MutableRefObject<string | null>;
// Session sidebar selection
selectedSidebarIndex: number;
setSelectedSidebarIndex: (index: number) => void;
// Session sidebar selection
selectedSidebarIndex: number;
setSelectedSidebarIndex: React.Dispatch<React.SetStateAction<number>>;
// File Explorer State
previewFile: { name: string; content: string; path: string } | null;
setPreviewFile: (file: { name: string; content: string; path: string } | null) => void;
selectedFileIndex: number;
setSelectedFileIndex: (index: number) => void;
flatFileList: FlatFileItem[];
setFlatFileList: (list: FlatFileItem[]) => void;
fileTreeFilter: string;
setFileTreeFilter: (filter: string) => void;
fileTreeFilterOpen: boolean;
setFileTreeFilterOpen: (open: boolean) => void;
// File Explorer State
previewFile: { name: string; content: string; path: string } | null;
setPreviewFile: React.Dispatch<
React.SetStateAction<{ name: string; content: string; path: string } | null>
>;
selectedFileIndex: number;
setSelectedFileIndex: React.Dispatch<React.SetStateAction<number>>;
flatFileList: FlatFileItem[];
setFlatFileList: React.Dispatch<React.SetStateAction<FlatFileItem[]>>;
fileTreeFilter: string;
setFileTreeFilter: React.Dispatch<React.SetStateAction<string>>;
fileTreeFilterOpen: boolean;
setFileTreeFilterOpen: React.Dispatch<React.SetStateAction<boolean>>;
// Flash notification state (inline notifications)
flashNotification: string | null;
setFlashNotification: (notification: string | null) => void;
successFlashNotification: string | null;
setSuccessFlashNotification: (notification: string | null) => void;
// Flash notification state (inline notifications)
flashNotification: string | null;
setFlashNotification: React.Dispatch<React.SetStateAction<string | null>>;
successFlashNotification: string | null;
setSuccessFlashNotification: React.Dispatch<React.SetStateAction<string | null>>;
// Output search state
outputSearchOpen: boolean;
setOutputSearchOpen: (open: boolean) => void;
outputSearchQuery: string;
setOutputSearchQuery: (query: string) => void;
// Output search state
outputSearchOpen: boolean;
setOutputSearchOpen: React.Dispatch<React.SetStateAction<boolean>>;
outputSearchQuery: string;
setOutputSearchQuery: React.Dispatch<React.SetStateAction<string>>;
// Drag and drop state
draggingSessionId: string | null;
setDraggingSessionId: (id: string | null) => void;
isDraggingImage: boolean;
setIsDraggingImage: (isDragging: boolean) => void;
dragCounterRef: React.MutableRefObject<number>;
// Drag and drop state
draggingSessionId: string | null;
setDraggingSessionId: React.Dispatch<React.SetStateAction<string | null>>;
isDraggingImage: boolean;
setIsDraggingImage: React.Dispatch<React.SetStateAction<boolean>>;
dragCounterRef: React.MutableRefObject<number>;
// Editing state (inline renaming in sidebar)
editingGroupId: string | null;
setEditingGroupId: (id: string | null) => void;
editingSessionId: string | null;
setEditingSessionId: (id: string | null) => void;
// Editing state (inline renaming in sidebar)
editingGroupId: string | null;
setEditingGroupId: React.Dispatch<React.SetStateAction<string | null>>;
editingSessionId: string | null;
setEditingSessionId: React.Dispatch<React.SetStateAction<string | null>>;
}
// Create context with null as default (will throw if used outside provider)
const UILayoutContext = createContext<UILayoutContextValue | null>(null);
interface UILayoutProviderProps {
children: ReactNode;
children: ReactNode;
}
/**
@@ -106,172 +116,198 @@ interface UILayoutProviderProps {
* </UILayoutProvider>
*/
export function UILayoutProvider({ children }: UILayoutProviderProps) {
// Sidebar State
const [leftSidebarOpen, setLeftSidebarOpen] = useState(true);
const [rightPanelOpen, setRightPanelOpen] = useState(true);
// Sidebar State
const [leftSidebarOpen, setLeftSidebarOpen] = useState(true);
const [rightPanelOpen, setRightPanelOpen] = useState(true);
// Focus State
const [activeFocus, setActiveFocus] = useState<FocusArea>('main');
const [activeRightTab, setActiveRightTab] = useState<RightPanelTab>('files');
// Focus State
const [activeFocus, setActiveFocus] = useState<FocusArea>('main');
const [activeRightTab, setActiveRightTab] = useState<RightPanelTab>('files');
// Sidebar collapse/expand state
const [bookmarksCollapsed, setBookmarksCollapsed] = useState(false);
const [groupChatsExpanded, setGroupChatsExpanded] = useState(true);
// Sidebar collapse/expand state
const [bookmarksCollapsed, setBookmarksCollapsed] = useState(false);
const [groupChatsExpanded, setGroupChatsExpanded] = useState(true);
// Session list filter state
const [showUnreadOnly, setShowUnreadOnly] = useState(false);
// Track the active tab ID before entering unread filter mode, so we can restore it when exiting
const preFilterActiveTabIdRef = useRef<string | null>(null);
// Session list filter state
const [showUnreadOnly, setShowUnreadOnly] = useState(false);
// Track the active tab ID before entering unread filter mode, so we can restore it when exiting
const preFilterActiveTabIdRef = useRef<string | null>(null);
// Session sidebar selection
const [selectedSidebarIndex, setSelectedSidebarIndex] = useState(0);
// Session sidebar selection
const [selectedSidebarIndex, setSelectedSidebarIndex] = useState(0);
// File Explorer State
const [previewFile, setPreviewFile] = useState<{ name: string; content: string; path: string } | null>(null);
const [selectedFileIndex, setSelectedFileIndex] = useState(0);
const [flatFileList, setFlatFileList] = useState<FlatFileItem[]>([]);
const [fileTreeFilter, setFileTreeFilter] = useState('');
const [fileTreeFilterOpen, setFileTreeFilterOpen] = useState(false);
// File Explorer State
const [previewFile, setPreviewFile] = useState<{
name: string;
content: string;
path: string;
} | null>(null);
const [selectedFileIndex, setSelectedFileIndex] = useState(0);
const [flatFileList, setFlatFileList] = useState<FlatFileItem[]>([]);
const [fileTreeFilter, setFileTreeFilter] = useState('');
const [fileTreeFilterOpen, setFileTreeFilterOpen] = useState(false);
// Flash notification state
const [flashNotification, setFlashNotification] = useState<string | null>(null);
const [successFlashNotification, setSuccessFlashNotification] = useState<string | null>(null);
// Flash notification state
const [flashNotification, setFlashNotification] = useState<string | null>(
null
);
const [successFlashNotification, setSuccessFlashNotification] = useState<
string | null
>(null);
// Output search state
const [outputSearchOpen, setOutputSearchOpen] = useState(false);
const [outputSearchQuery, setOutputSearchQuery] = useState('');
// Output search state
const [outputSearchOpen, setOutputSearchOpen] = useState(false);
const [outputSearchQuery, setOutputSearchQuery] = useState('');
// Drag and drop state
const [draggingSessionId, setDraggingSessionId] = useState<string | null>(null);
const [isDraggingImage, setIsDraggingImage] = useState(false);
const dragCounterRef = useRef(0); // Track nested drag enter/leave events
// Drag and drop state
const [draggingSessionId, setDraggingSessionId] = useState<string | null>(
null
);
const [isDraggingImage, setIsDraggingImage] = useState(false);
const dragCounterRef = useRef(0); // Track nested drag enter/leave events
// Editing state (inline renaming in sidebar)
const [editingGroupId, setEditingGroupId] = useState<string | null>(null);
const [editingSessionId, setEditingSessionId] = useState<string | null>(null);
// Editing state (inline renaming in sidebar)
const [editingGroupId, setEditingGroupId] = useState<string | null>(null);
const [editingSessionId, setEditingSessionId] = useState<string | null>(null);
// Convenience toggle methods
const toggleLeftSidebar = useCallback(() => {
setLeftSidebarOpen(open => !open);
}, []);
// Convenience toggle methods
const toggleLeftSidebar = useCallback(() => {
setLeftSidebarOpen(open => !open);
}, []);
const toggleRightPanel = useCallback(() => {
setRightPanelOpen(open => !open);
}, []);
const toggleRightPanel = useCallback(() => {
setRightPanelOpen(open => !open);
}, []);
const toggleBookmarksCollapsed = useCallback(() => {
setBookmarksCollapsed(collapsed => !collapsed);
}, []);
const toggleBookmarksCollapsed = useCallback(() => {
setBookmarksCollapsed(collapsed => !collapsed);
}, []);
const toggleGroupChatsExpanded = useCallback(() => {
setGroupChatsExpanded(expanded => !expanded);
}, []);
const toggleGroupChatsExpanded = useCallback(() => {
setGroupChatsExpanded(expanded => !expanded);
}, []);
const toggleShowUnreadOnly = useCallback(() => {
setShowUnreadOnly(show => !show);
}, []);
const toggleShowUnreadOnly = useCallback(() => {
setShowUnreadOnly(show => !show);
}, []);
// Memoize the context value to prevent unnecessary re-renders
const value = useMemo<UILayoutContextValue>(() => ({
// Sidebar State
leftSidebarOpen,
setLeftSidebarOpen,
toggleLeftSidebar,
rightPanelOpen,
setRightPanelOpen,
toggleRightPanel,
// Memoize the context value to prevent unnecessary re-renders
const value = useMemo<UILayoutContextValue>(
() => ({
// Sidebar State
leftSidebarOpen,
setLeftSidebarOpen,
toggleLeftSidebar,
rightPanelOpen,
setRightPanelOpen,
toggleRightPanel,
// Focus State
activeFocus,
setActiveFocus,
activeRightTab,
setActiveRightTab,
// Focus State
activeFocus,
setActiveFocus,
activeRightTab,
setActiveRightTab,
// Sidebar collapse/expand state
bookmarksCollapsed,
setBookmarksCollapsed,
toggleBookmarksCollapsed,
groupChatsExpanded,
setGroupChatsExpanded,
toggleGroupChatsExpanded,
// Sidebar collapse/expand state
bookmarksCollapsed,
setBookmarksCollapsed,
toggleBookmarksCollapsed,
groupChatsExpanded,
setGroupChatsExpanded,
toggleGroupChatsExpanded,
// Session list filter state
showUnreadOnly,
setShowUnreadOnly,
toggleShowUnreadOnly,
preFilterActiveTabIdRef,
// Session list filter state
showUnreadOnly,
setShowUnreadOnly,
toggleShowUnreadOnly,
preFilterActiveTabIdRef,
// Session sidebar selection
selectedSidebarIndex,
setSelectedSidebarIndex,
// Session sidebar selection
selectedSidebarIndex,
setSelectedSidebarIndex,
// File Explorer State
previewFile,
setPreviewFile,
selectedFileIndex,
setSelectedFileIndex,
flatFileList,
setFlatFileList,
fileTreeFilter,
setFileTreeFilter,
fileTreeFilterOpen,
setFileTreeFilterOpen,
// File Explorer State
previewFile,
setPreviewFile,
selectedFileIndex,
setSelectedFileIndex,
flatFileList,
setFlatFileList,
fileTreeFilter,
setFileTreeFilter,
fileTreeFilterOpen,
setFileTreeFilterOpen,
// Flash notification state
flashNotification,
setFlashNotification,
successFlashNotification,
setSuccessFlashNotification,
// Flash notification state
flashNotification,
setFlashNotification,
successFlashNotification,
setSuccessFlashNotification,
// Output search state
outputSearchOpen,
setOutputSearchOpen,
outputSearchQuery,
setOutputSearchQuery,
// Output search state
outputSearchOpen,
setOutputSearchOpen,
outputSearchQuery,
setOutputSearchQuery,
// Drag and drop state
draggingSessionId,
setDraggingSessionId,
isDraggingImage,
setIsDraggingImage,
dragCounterRef,
// Drag and drop state
draggingSessionId,
setDraggingSessionId,
isDraggingImage,
setIsDraggingImage,
dragCounterRef,
// Editing state
editingGroupId,
setEditingGroupId,
editingSessionId,
setEditingSessionId,
}), [
// Sidebar State
leftSidebarOpen, toggleLeftSidebar,
rightPanelOpen, toggleRightPanel,
// Focus State
activeFocus, activeRightTab,
// Sidebar collapse/expand state
bookmarksCollapsed, toggleBookmarksCollapsed,
groupChatsExpanded, toggleGroupChatsExpanded,
// Session list filter state
showUnreadOnly, toggleShowUnreadOnly,
// Session sidebar selection
selectedSidebarIndex,
// File Explorer State
previewFile, selectedFileIndex, flatFileList,
fileTreeFilter, fileTreeFilterOpen,
// Flash notification state
flashNotification, successFlashNotification,
// Output search state
outputSearchOpen, outputSearchQuery,
// Drag and drop state
draggingSessionId, isDraggingImage,
// Editing state
editingGroupId, editingSessionId,
]);
// Editing state
editingGroupId,
setEditingGroupId,
editingSessionId,
setEditingSessionId
}),
[
// Sidebar State
leftSidebarOpen,
toggleLeftSidebar,
rightPanelOpen,
toggleRightPanel,
// Focus State
activeFocus,
activeRightTab,
// Sidebar collapse/expand state
bookmarksCollapsed,
toggleBookmarksCollapsed,
groupChatsExpanded,
toggleGroupChatsExpanded,
// Session list filter state
showUnreadOnly,
toggleShowUnreadOnly,
// Session sidebar selection
selectedSidebarIndex,
// File Explorer State
previewFile,
selectedFileIndex,
flatFileList,
fileTreeFilter,
fileTreeFilterOpen,
// Flash notification state
flashNotification,
successFlashNotification,
// Output search state
outputSearchOpen,
outputSearchQuery,
// Drag and drop state
draggingSessionId,
isDraggingImage,
// Editing state
editingGroupId,
editingSessionId
]
);
return (
<UILayoutContext.Provider value={value}>
{children}
</UILayoutContext.Provider>
);
return (
<UILayoutContext.Provider value={value}>
{children}
</UILayoutContext.Provider>
);
}
/**
@@ -291,11 +327,11 @@ export function UILayoutProvider({ children }: UILayoutProviderProps) {
* if (activeFocus === 'main') { ... }
*/
export function useUILayout(): UILayoutContextValue {
const context = useContext(UILayoutContext);
const context = useContext(UILayoutContext);
if (!context) {
throw new Error('useUILayout must be used within a UILayoutProvider');
}
if (!context) {
throw new Error('useUILayout must be used within a UILayoutProvider');
}
return context;
return context;
}