mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 08:23:34 +00:00
Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f1b3e6b7e | ||
|
|
749d173cf4 | ||
|
|
a7b45b5068 | ||
|
|
d26d1051f1 | ||
|
|
d99a9e1c46 | ||
|
|
8be2ef7b22 | ||
|
|
75a0d637ce | ||
|
|
a84ba7385b | ||
|
|
2fdd9e6a49 | ||
|
|
67a77419df | ||
|
|
4676738a14 | ||
|
|
444dfbc5dd | ||
|
|
5d075e02ab |
No files matched your search
Generated
+71
-29
@@ -195,6 +195,7 @@
|
|||||||
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
|
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/code-frame": "^7.27.1",
|
"@babel/code-frame": "^7.27.1",
|
||||||
"@babel/generator": "^7.28.5",
|
"@babel/generator": "^7.28.5",
|
||||||
@@ -1830,6 +1831,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
@@ -1853,6 +1855,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@@ -1874,6 +1877,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz",
|
||||||
"integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==",
|
"integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dnd-kit/accessibility": "^3.1.1",
|
"@dnd-kit/accessibility": "^3.1.1",
|
||||||
"@dnd-kit/utilities": "^3.2.2",
|
"@dnd-kit/utilities": "^3.2.2",
|
||||||
@@ -2812,9 +2816,9 @@
|
|||||||
"license": "BSD-2-Clause"
|
"license": "BSD-2-Clause"
|
||||||
},
|
},
|
||||||
"node_modules/@modelcontextprotocol/sdk": {
|
"node_modules/@modelcontextprotocol/sdk": {
|
||||||
"version": "1.25.1",
|
"version": "1.25.2",
|
||||||
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.25.1.tgz",
|
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.25.2.tgz",
|
||||||
"integrity": "sha512-yO28oVFFC7EBoiKdAn+VqRm+plcfv4v0xp6osG/VsCB0NlPZWi87ajbCZZ8f/RvOFLEu7//rSRmuZZ7lMoe3gQ==",
|
"integrity": "sha512-LZFeo4F9M5qOhC/Uc1aQSrBHxMrvxett+9KLHt7OhcExtoiRN9DKgbZffMP/nxjutWDQpfMDfP3nkHI4X9ijww==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hono/node-server": "^1.19.7",
|
"@hono/node-server": "^1.19.7",
|
||||||
@@ -4385,9 +4389,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@remix-run/router": {
|
"node_modules/@remix-run/router": {
|
||||||
"version": "1.23.0",
|
"version": "1.23.2",
|
||||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.0.tgz",
|
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.2.tgz",
|
||||||
"integrity": "sha512-O3rHJzAQKamUz1fvE0Qaw0xSFqsA/yafi2iqeE0pvdFtCO1viYx8QL6f3Ln/aCCTLxs68SLf0KPM9eSeM8yBnA==",
|
"integrity": "sha512-Ic6m2U/rMjTkhERIa/0ZtXJP17QUi2CbWE7cqx4J58M8aA3QTfW+2UlQ4psvTX9IO1RfNVhK3pcpdjej7L+t2w==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
@@ -4488,6 +4492,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4501,6 +4506,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4514,6 +4520,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4527,6 +4534,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4540,6 +4548,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4553,6 +4562,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4566,6 +4576,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4579,6 +4590,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4592,6 +4604,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4605,6 +4618,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4618,6 +4632,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"loong64"
|
"loong64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4631,6 +4646,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4644,6 +4660,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4657,6 +4674,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4670,6 +4688,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4683,6 +4702,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4696,6 +4716,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4709,6 +4730,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4722,6 +4744,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"ia32"
|
"ia32"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -4735,6 +4758,7 @@
|
|||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
@@ -5422,8 +5446,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
|
||||||
"integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==",
|
"integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"peer": true
|
|
||||||
},
|
},
|
||||||
"node_modules/@types/chrome": {
|
"node_modules/@types/chrome": {
|
||||||
"version": "0.0.74",
|
"version": "0.0.74",
|
||||||
@@ -5635,6 +5658,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.20.tgz",
|
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.20.tgz",
|
||||||
"integrity": "sha512-IPaCZN7PShZK/3t6Q87pfTkRm6oLTd4vztyoj+cbHUF1g3FfVb2tFIL79uCRKEfv16AhqDMBywP2VW3KIZUvcg==",
|
"integrity": "sha512-IPaCZN7PShZK/3t6Q87pfTkRm6oLTd4vztyoj+cbHUF1g3FfVb2tFIL79uCRKEfv16AhqDMBywP2VW3KIZUvcg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/prop-types": "*",
|
"@types/prop-types": "*",
|
||||||
"csstype": "^3.0.2"
|
"csstype": "^3.0.2"
|
||||||
@@ -5646,6 +5670,7 @@
|
|||||||
"integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
|
"integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/react": "^18.0.0"
|
"@types/react": "^18.0.0"
|
||||||
}
|
}
|
||||||
@@ -5729,6 +5754,7 @@
|
|||||||
"integrity": "sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q==",
|
"integrity": "sha512-oU/OtYVydhXnumd0BobL9rkJg7wFJ9bFFPmSmB/bf/XWN85hlViji59ko6bSKBXyseT9V8l+CN1nwmlbiN0G7Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "8.31.1",
|
"@typescript-eslint/scope-manager": "8.31.1",
|
||||||
"@typescript-eslint/types": "8.31.1",
|
"@typescript-eslint/types": "8.31.1",
|
||||||
@@ -6088,6 +6114,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
|
||||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"acorn": "bin/acorn"
|
"acorn": "bin/acorn"
|
||||||
},
|
},
|
||||||
@@ -6602,6 +6629,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"baseline-browser-mapping": "^2.8.19",
|
"baseline-browser-mapping": "^2.8.19",
|
||||||
"caniuse-lite": "^1.0.30001751",
|
"caniuse-lite": "^1.0.30001751",
|
||||||
@@ -6831,6 +6859,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
|
||||||
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
|
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"anymatch": "~3.1.2",
|
"anymatch": "~3.1.2",
|
||||||
"braces": "~3.0.2",
|
"braces": "~3.0.2",
|
||||||
@@ -7590,8 +7619,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz",
|
"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz",
|
||||||
"integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==",
|
"integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"peer": true
|
|
||||||
},
|
},
|
||||||
"node_modules/dom-helpers": {
|
"node_modules/dom-helpers": {
|
||||||
"version": "5.2.1",
|
"version": "5.2.1",
|
||||||
@@ -7656,7 +7684,8 @@
|
|||||||
"version": "8.6.0",
|
"version": "8.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.6.0.tgz",
|
||||||
"integrity": "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==",
|
"integrity": "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==",
|
||||||
"license": "MIT"
|
"license": "MIT",
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"node_modules/embla-carousel-react": {
|
"node_modules/embla-carousel-react": {
|
||||||
"version": "8.6.0",
|
"version": "8.6.0",
|
||||||
@@ -7942,6 +7971,7 @@
|
|||||||
"integrity": "sha512-QldCVh/ztyKJJZLr4jXNUByx3gR+TDYZCRXEktiZoUR3PGy4qCmSbkxcIle8GEwGpb5JBZazlaJ/CxLidXdEbQ==",
|
"integrity": "sha512-QldCVh/ztyKJJZLr4jXNUByx3gR+TDYZCRXEktiZoUR3PGy4qCmSbkxcIle8GEwGpb5JBZazlaJ/CxLidXdEbQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.12.1",
|
"@eslint-community/regexpp": "^4.12.1",
|
||||||
@@ -8207,6 +8237,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz",
|
||||||
"integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
|
"integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"accepts": "^2.0.0",
|
"accepts": "^2.0.0",
|
||||||
"body-parser": "^2.2.0",
|
"body-parser": "^2.2.0",
|
||||||
@@ -9304,6 +9335,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.27.6"
|
"@babel/runtime": "^7.27.6"
|
||||||
},
|
},
|
||||||
@@ -10097,6 +10129,7 @@
|
|||||||
"integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==",
|
"integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cssstyle": "^4.2.1",
|
"cssstyle": "^4.2.1",
|
||||||
"data-urls": "^5.0.0",
|
"data-urls": "^5.0.0",
|
||||||
@@ -10481,7 +10514,6 @@
|
|||||||
"integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==",
|
"integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"lz-string": "bin/bin.js"
|
"lz-string": "bin/bin.js"
|
||||||
}
|
}
|
||||||
@@ -12235,6 +12267,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nanoid": "^3.3.8",
|
"nanoid": "^3.3.8",
|
||||||
"picocolors": "^1.1.1",
|
"picocolors": "^1.1.1",
|
||||||
@@ -12402,7 +12435,6 @@
|
|||||||
"integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
|
"integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-regex": "^5.0.1",
|
"ansi-regex": "^5.0.1",
|
||||||
"ansi-styles": "^5.0.0",
|
"ansi-styles": "^5.0.0",
|
||||||
@@ -12418,7 +12450,6 @@
|
|||||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
@@ -12429,7 +12460,6 @@
|
|||||||
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
|
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
},
|
},
|
||||||
@@ -12442,8 +12472,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
|
||||||
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
|
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"peer": true
|
|
||||||
},
|
},
|
||||||
"node_modules/prismjs": {
|
"node_modules/prismjs": {
|
||||||
"version": "1.30.0",
|
"version": "1.30.0",
|
||||||
@@ -12528,9 +12557,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/qs": {
|
"node_modules/qs": {
|
||||||
"version": "6.14.0",
|
"version": "6.14.1",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz",
|
||||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
"integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"side-channel": "^1.1.0"
|
"side-channel": "^1.1.0"
|
||||||
@@ -12617,6 +12646,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz",
|
||||||
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
|
"integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"loose-envify": "^1.1.0"
|
"loose-envify": "^1.1.0"
|
||||||
},
|
},
|
||||||
@@ -12643,6 +12673,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz",
|
||||||
"integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
|
"integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"loose-envify": "^1.1.0",
|
"loose-envify": "^1.1.0",
|
||||||
"scheduler": "^0.23.2"
|
"scheduler": "^0.23.2"
|
||||||
@@ -12668,6 +12699,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.56.1.tgz",
|
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.56.1.tgz",
|
||||||
"integrity": "sha512-qWAVokhSpshhcEuQDSANHx3jiAEFzu2HAaaQIzi/r9FNPm1ioAvuJSD4EuZzWd7Al7nTRKcKPnBKO7sRn+zavQ==",
|
"integrity": "sha512-qWAVokhSpshhcEuQDSANHx3jiAEFzu2HAaaQIzi/r9FNPm1ioAvuJSD4EuZzWd7Al7nTRKcKPnBKO7sRn+zavQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0"
|
"node": ">=18.0.0"
|
||||||
},
|
},
|
||||||
@@ -12716,6 +12748,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-10.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-10.1.0.tgz",
|
||||||
"integrity": "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==",
|
"integrity": "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/hast": "^3.0.0",
|
"@types/hast": "^3.0.0",
|
||||||
"@types/mdast": "^4.0.0",
|
"@types/mdast": "^4.0.0",
|
||||||
@@ -12796,12 +12829,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router": {
|
"node_modules/react-router": {
|
||||||
"version": "6.30.0",
|
"version": "6.30.3",
|
||||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.30.3.tgz",
|
||||||
"integrity": "sha512-D3X8FyH9nBcTSHGdEKurK7r8OYE1kKFn3d/CF+CoxbSHkxU7o37+Uh7eAHRXr6k2tSExXYO++07PeXJtA/dEhQ==",
|
"integrity": "sha512-XRnlbKMTmktBkjCLE8/XcZFlnHvr2Ltdr1eJX4idL55/9BbORzyZEaIkBFDhFGCEWBBItsVrDxwx3gnisMitdw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@remix-run/router": "1.23.0"
|
"@remix-run/router": "1.23.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
@@ -12811,13 +12844,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router-dom": {
|
"node_modules/react-router-dom": {
|
||||||
"version": "6.30.0",
|
"version": "6.30.3",
|
||||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.30.3.tgz",
|
||||||
"integrity": "sha512-x30B78HV5tFk8ex0ITwzC9TTZMua4jGyA9IUlH1JLQYQTFyxr/ZxwOJq7evg1JX1qGVUcvhsmQSKdPncQrjTgA==",
|
"integrity": "sha512-pxPcv1AczD4vso7G4Z3TKcvlxK7g7TNt3/FNGMhfqyntocvYKj+GCatfigGDjbLozC4baguJ0ReCigoDJXb0ag==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@remix-run/router": "1.23.0",
|
"@remix-run/router": "1.23.2",
|
||||||
"react-router": "6.30.0"
|
"react-router": "6.30.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
@@ -13258,6 +13291,7 @@
|
|||||||
"integrity": "sha512-C5VvvgCCyfyotVITIAv+4efVytl5F7wt+/I2i9q9GZcEXW9BP52YYOXC58igUi+LFZVHukErIIqQSWwv/M3WRw==",
|
"integrity": "sha512-C5VvvgCCyfyotVITIAv+4efVytl5F7wt+/I2i9q9GZcEXW9BP52YYOXC58igUi+LFZVHukErIIqQSWwv/M3WRw==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/estree": "1.0.7"
|
"@types/estree": "1.0.7"
|
||||||
},
|
},
|
||||||
@@ -14312,6 +14346,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz",
|
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz",
|
||||||
"integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==",
|
"integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alloc/quick-lru": "^5.2.0",
|
"@alloc/quick-lru": "^5.2.0",
|
||||||
"arg": "^5.0.2",
|
"arg": "^5.0.2",
|
||||||
@@ -14515,6 +14550,7 @@
|
|||||||
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
@@ -14810,6 +14846,7 @@
|
|||||||
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
@@ -15337,6 +15374,7 @@
|
|||||||
"integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==",
|
"integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.25.0",
|
"esbuild": "^0.25.0",
|
||||||
"fdir": "^6.4.4",
|
"fdir": "^6.4.4",
|
||||||
@@ -15481,6 +15519,7 @@
|
|||||||
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
"integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
@@ -15952,6 +15991,7 @@
|
|||||||
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
"fast-uri": "^3.0.1",
|
"fast-uri": "^3.0.1",
|
||||||
@@ -16028,6 +16068,7 @@
|
|||||||
"integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==",
|
"integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"rollup": "dist/bin/rollup"
|
"rollup": "dist/bin/rollup"
|
||||||
},
|
},
|
||||||
@@ -16476,6 +16517,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
|
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
|
||||||
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
|
"integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/colinhacks"
|
"url": "https://github.com/sponsors/colinhacks"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import { DynamicFavicon } from '@/components/DynamicFavicon';
|
|||||||
import { OfflineIndicator } from '@/components/OfflineIndicator';
|
import { OfflineIndicator } from '@/components/OfflineIndicator';
|
||||||
import { PWAUpdatePrompt } from '@/components/PWAUpdatePrompt';
|
import { PWAUpdatePrompt } from '@/components/PWAUpdatePrompt';
|
||||||
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
||||||
|
import { NWCProvider } from '@/contexts/NWCContext';
|
||||||
|
|
||||||
import AppRouter from './AppRouter';
|
import AppRouter from './AppRouter';
|
||||||
|
|
||||||
@@ -142,6 +143,7 @@ export function App() {
|
|||||||
<NostrLoginProvider storageKey='nostr:login'>
|
<NostrLoginProvider storageKey='nostr:login'>
|
||||||
<NostrProvider>
|
<NostrProvider>
|
||||||
<NostrSync />
|
<NostrSync />
|
||||||
|
<NWCProvider>
|
||||||
<AISettingsProvider>
|
<AISettingsProvider>
|
||||||
<GitSettingsProvider>
|
<GitSettingsProvider>
|
||||||
<DeploySettingsProvider>
|
<DeploySettingsProvider>
|
||||||
@@ -161,6 +163,7 @@ export function App() {
|
|||||||
</DeploySettingsProvider>
|
</DeploySettingsProvider>
|
||||||
</GitSettingsProvider>
|
</GitSettingsProvider>
|
||||||
</AISettingsProvider>
|
</AISettingsProvider>
|
||||||
|
</NWCProvider>
|
||||||
</NostrProvider>
|
</NostrProvider>
|
||||||
</NostrLoginProvider>
|
</NostrLoginProvider>
|
||||||
</ConsoleErrorProvider>
|
</ConsoleErrorProvider>
|
||||||
|
|||||||
@@ -5,12 +5,14 @@ import { URLFragmentHandler } from "./components/URLFragmentHandler";
|
|||||||
|
|
||||||
import Index from "./pages/Index";
|
import Index from "./pages/Index";
|
||||||
import Clone from "./pages/Clone";
|
import Clone from "./pages/Clone";
|
||||||
|
import Explore from "./pages/Explore";
|
||||||
import Settings from "./pages/Settings";
|
import Settings from "./pages/Settings";
|
||||||
import Preferences from "./pages/Preferences";
|
import Preferences from "./pages/Preferences";
|
||||||
import NostrSettings from "./pages/NostrSettings";
|
import NostrSettings from "./pages/NostrSettings";
|
||||||
import AISettings from "./pages/AISettings";
|
import AISettings from "./pages/AISettings";
|
||||||
import GitSettings from "./pages/GitSettings";
|
import GitSettings from "./pages/GitSettings";
|
||||||
import DeploySettings from "./pages/DeploySettings";
|
import DeploySettings from "./pages/DeploySettings";
|
||||||
|
import WalletSettings from "./pages/WalletSettings";
|
||||||
import SystemSettings from "./pages/SystemSettings";
|
import SystemSettings from "./pages/SystemSettings";
|
||||||
import StorageSettings from "./pages/StorageSettings";
|
import StorageSettings from "./pages/StorageSettings";
|
||||||
import AboutSettings from "./pages/AboutSettings";
|
import AboutSettings from "./pages/AboutSettings";
|
||||||
@@ -37,6 +39,7 @@ export function AppRouter() {
|
|||||||
<Route path="/" element={<Index />} />
|
<Route path="/" element={<Index />} />
|
||||||
<Route path="/giftcard" element={<Index />} />
|
<Route path="/giftcard" element={<Index />} />
|
||||||
<Route path="/clone" element={<Clone />} />
|
<Route path="/clone" element={<Clone />} />
|
||||||
|
<Route path="/explore" element={<Explore />} />
|
||||||
<Route path="/oauth/github" element={<GitHubOAuth />} />
|
<Route path="/oauth/github" element={<GitHubOAuth />} />
|
||||||
<Route path="/oauth/netlify" element={<NetlifyOAuth />} />
|
<Route path="/oauth/netlify" element={<NetlifyOAuth />} />
|
||||||
<Route path="/oauth/vercel" element={<VercelOAuth />} />
|
<Route path="/oauth/vercel" element={<VercelOAuth />} />
|
||||||
@@ -48,6 +51,7 @@ export function AppRouter() {
|
|||||||
<Route path="ai" element={<AISettings />} />
|
<Route path="ai" element={<AISettings />} />
|
||||||
<Route path="git" element={<GitSettings />} />
|
<Route path="git" element={<GitSettings />} />
|
||||||
<Route path="deploy" element={<DeploySettings />} />
|
<Route path="deploy" element={<DeploySettings />} />
|
||||||
|
<Route path="wallet" element={<WalletSettings />} />
|
||||||
<Route path="system" element={<SystemSettings />} />
|
<Route path="system" element={<SystemSettings />} />
|
||||||
<Route path="storage" element={<StorageSettings />} />
|
<Route path="storage" element={<StorageSettings />} />
|
||||||
<Route path="about" element={<AboutSettings />} />
|
<Route path="about" element={<AboutSettings />} />
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState, useMemo } from 'react';
|
import React, { useEffect, useState, useMemo } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Plus, Folder, GitBranch, Loader2, ChevronDown, ChevronRight, Star, Columns2, X, Settings, HelpCircle, Search, Tag, Folders } from 'lucide-react';
|
import { Plus, Folder, GitBranch, Loader2, ChevronDown, ChevronRight, Star, Columns2, X, Settings, HelpCircle, Search, Tag, Folders, Compass } from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Skeleton } from '@/components/ui/skeleton';
|
import { Skeleton } from '@/components/ui/skeleton';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
@@ -367,6 +367,13 @@ export function ProjectSidebar({
|
|||||||
<GitBranch className="h-4 w-4" />
|
<GitBranch className="h-4 w-4" />
|
||||||
{t('importRepository')}
|
{t('importRepository')}
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
|
<DropdownMenuItem
|
||||||
|
onClick={() => navigateAndClose('/explore')}
|
||||||
|
className="flex items-center gap-2 w-full"
|
||||||
|
>
|
||||||
|
<Compass className="h-4 w-4" />
|
||||||
|
{t('exploreApps')}
|
||||||
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
onClick={() => setLabelsDialogOpen(true)}
|
onClick={() => setLabelsDialogOpen(true)}
|
||||||
className="flex items-center gap-2 w-full"
|
className="flex items-center gap-2 w-full"
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ export function ProjectTitleMenu({
|
|||||||
className="gap-2"
|
className="gap-2"
|
||||||
>
|
>
|
||||||
<MessageSquarePlus className="h-4 w-4" />
|
<MessageSquarePlus className="h-4 w-4" />
|
||||||
{t('newChat')}
|
New Chat
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
|
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
|
|||||||
@@ -1,14 +1,21 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState, useRef, useEffect, memo } from 'react';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { GitBranch, Loader2, EllipsisVertical, Edit } from 'lucide-react';
|
import { GitBranch, Loader2, EllipsisVertical, Edit, Code, ExternalLink } from 'lucide-react';
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/components/ui/dropdown-menu';
|
} from '@/components/ui/dropdown-menu';
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
} from '@/components/ui/dialog';
|
||||||
import type { Repository } from '@/hooks/useUserRepositories';
|
import type { Repository } from '@/hooks/useUserRepositories';
|
||||||
import { useAuthor } from '@/hooks/useAuthor';
|
import { useAuthor } from '@/hooks/useAuthor';
|
||||||
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar';
|
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar';
|
||||||
@@ -23,13 +30,26 @@ import { useGitSettings } from '@/hooks/useGitSettings';
|
|||||||
import { detectFork } from '@/lib/detectFork';
|
import { detectFork } from '@/lib/detectFork';
|
||||||
import { NostrRepoEditDialog } from '@/components/NostrRepoEditDialog';
|
import { NostrRepoEditDialog } from '@/components/NostrRepoEditDialog';
|
||||||
import { useQueryClient } from '@tanstack/react-query';
|
import { useQueryClient } from '@tanstack/react-query';
|
||||||
|
import { useOGImage } from '@/hooks/useOGImage';
|
||||||
|
import { ZapDialog } from '@/components/ZapDialog';
|
||||||
|
import { Zap } from 'lucide-react';
|
||||||
|
import type { Event } from 'nostr-tools';
|
||||||
|
import type { NostrMetadata } from '@nostrify/nostrify';
|
||||||
|
import { formatRelativeTime } from '@/lib/utils';
|
||||||
|
|
||||||
interface RepositoryCardProps {
|
interface RepositoryCardProps {
|
||||||
repo: Repository;
|
repo: Repository;
|
||||||
|
/** Pre-fetched author metadata to avoid individual fetches */
|
||||||
|
authorMetadata?: NostrMetadata;
|
||||||
|
/** Callback when a tag is clicked - receives the tag value */
|
||||||
|
onTagClick?: (tag: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function RepositoryCard({ repo }: RepositoryCardProps) {
|
function RepositoryCardInner({ repo, authorMetadata: preloadedMetadata, onTagClick }: RepositoryCardProps) {
|
||||||
const { data: authorData } = useAuthor(repo.pubkey);
|
// Only fetch author data if not preloaded
|
||||||
|
const { data: authorData } = useAuthor(preloadedMetadata ? undefined : repo.pubkey);
|
||||||
|
const metadata = preloadedMetadata ?? authorData?.metadata;
|
||||||
|
|
||||||
const { user } = useCurrentUser();
|
const { user } = useCurrentUser();
|
||||||
const { settings: gitSettings } = useGitSettings();
|
const { settings: gitSettings } = useGitSettings();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -39,10 +59,41 @@ export function RepositoryCard({ repo }: RepositoryCardProps) {
|
|||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const [isCloning, setIsCloning] = useState(false);
|
const [isCloning, setIsCloning] = useState(false);
|
||||||
const [editRepoOpen, setEditRepoOpen] = useState(false);
|
const [editRepoOpen, setEditRepoOpen] = useState(false);
|
||||||
|
const [imageError, setImageError] = useState(false);
|
||||||
|
const [eventViewerOpen, setEventViewerOpen] = useState(false);
|
||||||
|
const [isInViewport, setIsInViewport] = useState(false);
|
||||||
|
const cardRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
const displayName = authorData?.metadata?.name || genUserName(repo.pubkey);
|
// Lazy load OG images - only fetch when card is in viewport
|
||||||
const profileImage = authorData?.metadata?.picture;
|
useEffect(() => {
|
||||||
|
const observer = new IntersectionObserver(
|
||||||
|
([entry]) => {
|
||||||
|
if (entry.isIntersecting) {
|
||||||
|
setIsInViewport(true);
|
||||||
|
observer.disconnect();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ rootMargin: '100px' } // Start loading slightly before visible
|
||||||
|
);
|
||||||
|
|
||||||
|
if (cardRef.current) {
|
||||||
|
observer.observe(cardRef.current);
|
||||||
|
}
|
||||||
|
|
||||||
|
return () => observer.disconnect();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const displayName = metadata?.name || genUserName(repo.pubkey);
|
||||||
|
const profileImage = metadata?.picture;
|
||||||
const isOwnRepo = user?.pubkey === repo.pubkey;
|
const isOwnRepo = user?.pubkey === repo.pubkey;
|
||||||
|
const hasLightning = !!(metadata?.lud16 || metadata?.lud06);
|
||||||
|
const canZap = user && !isOwnRepo && hasLightning;
|
||||||
|
|
||||||
|
// Get OG metadata from first web URL - only when in viewport
|
||||||
|
const firstWebUrl = repo.webUrls?.[0];
|
||||||
|
const { data: ogMetadata } = useOGImage(isInViewport ? firstWebUrl : undefined);
|
||||||
|
const ogImageUrl = ogMetadata?.image ?? null;
|
||||||
|
const ogDescription = ogMetadata?.description ?? null;
|
||||||
|
|
||||||
// Construct Nostr clone URL
|
// Construct Nostr clone URL
|
||||||
const nostrURI = new NostrURI({
|
const nostrURI = new NostrURI({
|
||||||
@@ -109,52 +160,117 @@ export function RepositoryCard({ repo }: RepositoryCardProps) {
|
|||||||
queryClient.invalidateQueries({ queryKey: ['nostr', 'user-repositories', user?.pubkey] });
|
queryClient.invalidateQueries({ queryKey: ['nostr', 'user-repositories', user?.pubkey] });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Check if we have a valid OG image to show
|
||||||
|
const hasValidImage = ogImageUrl && !imageError;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="h-full flex flex-col hover:shadow-lg transition-shadow">
|
<Card ref={cardRef} className="h-full flex flex-col hover:shadow-lg transition-shadow">
|
||||||
|
{/* Preview Image or Placeholder */}
|
||||||
|
{hasValidImage && firstWebUrl ? (
|
||||||
|
<a
|
||||||
|
href={firstWebUrl}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="block aspect-video bg-muted overflow-hidden rounded-t-lg cursor-pointer hover:opacity-90 transition-opacity"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={ogImageUrl}
|
||||||
|
alt={`${repo.name} preview`}
|
||||||
|
className="w-full h-full object-cover"
|
||||||
|
onError={() => setImageError(true)}
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
) : (
|
||||||
|
<div className="aspect-video bg-gradient-to-br from-primary to-accent rounded-t-lg flex items-center justify-center">
|
||||||
|
<Code className="h-12 w-12 text-white" />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<CardContent className="p-6 flex flex-col flex-1">
|
<CardContent className="p-6 flex flex-col flex-1">
|
||||||
{/* Header with name and menu */}
|
{/* Header with name and menu */}
|
||||||
<div className="mb-4 flex items-start justify-between">
|
<div className="mb-4 flex items-start justify-between">
|
||||||
<div className="flex-1 min-w-0">
|
<div className="flex-1 min-w-0">
|
||||||
<h3 className="font-semibold text-lg leading-tight mb-2 truncate">
|
<div className="flex items-end gap-2 mb-2">
|
||||||
{repo.name}
|
<h3 className="font-semibold text-lg leading-tight truncate">
|
||||||
</h3>
|
{repo.name}
|
||||||
|
</h3>
|
||||||
|
<span className="text-sm text-muted-foreground shrink-0">
|
||||||
|
{formatRelativeTime(repo.created_at)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isOwnRepo && (
|
<div className="flex items-center -mt-1 -mr-2 shrink-0">
|
||||||
|
{canZap && (
|
||||||
|
<ZapDialog target={repo as unknown as Event}>
|
||||||
|
<Button variant="ghost" size="icon" className="h-8 w-8 text-amber-500 hover:text-amber-600 hover:bg-amber-500/10">
|
||||||
|
<Zap className="h-4 w-4" />
|
||||||
|
</Button>
|
||||||
|
</ZapDialog>
|
||||||
|
)}
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<DropdownMenuTrigger asChild>
|
<DropdownMenuTrigger asChild>
|
||||||
<Button variant="ghost" size="icon" className="h-8 w-8 -mt-1 -mr-2 shrink-0">
|
<Button variant="ghost" size="icon" className="h-8 w-8">
|
||||||
<EllipsisVertical className="h-4 w-4" />
|
<EllipsisVertical className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent align="end">
|
<DropdownMenuContent align="end">
|
||||||
<DropdownMenuItem onClick={() => setEditRepoOpen(true)} className="gap-2">
|
{firstWebUrl && (
|
||||||
<Edit className="h-4 w-4" />
|
<DropdownMenuItem asChild className="gap-2">
|
||||||
Edit Repository
|
<a href={firstWebUrl} target="_blank" rel="noopener noreferrer">
|
||||||
|
<ExternalLink className="h-4 w-4" />
|
||||||
|
Open Website
|
||||||
|
</a>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
)}
|
||||||
|
<DropdownMenuItem onClick={() => setEventViewerOpen(true)} className="gap-2">
|
||||||
|
<Code className="h-4 w-4" />
|
||||||
|
View Event
|
||||||
|
</DropdownMenuItem>
|
||||||
|
{isOwnRepo && (
|
||||||
|
<>
|
||||||
|
<DropdownMenuSeparator />
|
||||||
|
<DropdownMenuItem onClick={() => setEditRepoOpen(true)} className="gap-2">
|
||||||
|
<Edit className="h-4 w-4" />
|
||||||
|
Edit Repository
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
)}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Author */}
|
{/* Author */}
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
<div className="flex items-center gap-3 text-sm">
|
||||||
<Avatar className="h-4 w-4">
|
<Avatar className="h-10 w-10">
|
||||||
{profileImage && (
|
{profileImage && (
|
||||||
<AvatarImage src={profileImage} alt={displayName} />
|
<AvatarImage src={profileImage} alt={displayName} />
|
||||||
)}
|
)}
|
||||||
<AvatarFallback className="text-[8px]">
|
<AvatarFallback className="text-xs">
|
||||||
{displayName.slice(0, 2).toUpperCase()}
|
{displayName.slice(0, 2).toUpperCase()}
|
||||||
</AvatarFallback>
|
</AvatarFallback>
|
||||||
</Avatar>
|
</Avatar>
|
||||||
<span className="truncate">{displayName}</span>
|
<div className="flex items-center gap-2 min-w-0 flex-1">
|
||||||
|
<button
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
onTagClick?.(displayName);
|
||||||
|
}}
|
||||||
|
className="truncate font-medium text-base text-foreground hover:text-primary hover:underline transition-colors text-left"
|
||||||
|
>
|
||||||
|
{displayName}
|
||||||
|
</button>
|
||||||
|
{metadata?.nip05 && (
|
||||||
|
<span className="text-sm text-muted-foreground shrink-0">{metadata.nip05}</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Description */}
|
{/* Description */}
|
||||||
{repo.description && (
|
{(repo.description || ogDescription) && (
|
||||||
<p className="text-sm text-muted-foreground line-clamp-2 mb-4">
|
<p className="text-sm text-muted-foreground line-clamp-2 mb-4">
|
||||||
{repo.description}
|
{repo.description || ogDescription}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -162,14 +278,21 @@ export function RepositoryCard({ repo }: RepositoryCardProps) {
|
|||||||
{repo.repoTags.length > 0 && (
|
{repo.repoTags.length > 0 && (
|
||||||
<div className="flex flex-wrap gap-1 mb-4">
|
<div className="flex flex-wrap gap-1 mb-4">
|
||||||
{repo.repoTags.slice(0, 3).map((tag, index) => (
|
{repo.repoTags.slice(0, 3).map((tag, index) => (
|
||||||
<Badge key={index} variant="secondary" className="text-xs">
|
<button
|
||||||
{tag}
|
key={index}
|
||||||
</Badge>
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
onTagClick?.(tag);
|
||||||
|
}}
|
||||||
|
className="text-sm text-primary hover:text-primary/80 hover:underline transition-colors font-medium"
|
||||||
|
>
|
||||||
|
#{tag}
|
||||||
|
</button>
|
||||||
))}
|
))}
|
||||||
{repo.repoTags.length > 3 && (
|
{repo.repoTags.length > 3 && (
|
||||||
<Badge variant="secondary" className="text-xs">
|
<span className="text-sm text-muted-foreground">
|
||||||
+{repo.repoTags.length - 3}
|
+{repo.repoTags.length - 3}
|
||||||
</Badge>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -212,6 +335,31 @@ export function RepositoryCard({ repo }: RepositoryCardProps) {
|
|||||||
repoIdentifier={repo.repoId}
|
repoIdentifier={repo.repoId}
|
||||||
onSuccess={handleRepoEditSuccess}
|
onSuccess={handleRepoEditSuccess}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Event Viewer Dialog */}
|
||||||
|
<Dialog open={eventViewerOpen} onOpenChange={setEventViewerOpen}>
|
||||||
|
<DialogContent className="max-w-2xl max-h-[80vh] flex flex-col">
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>Repository Event</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
<div className="overflow-y-auto flex-1 min-h-0">
|
||||||
|
<pre className="text-xs p-4 rounded-lg overflow-x-auto">
|
||||||
|
{JSON.stringify({
|
||||||
|
id: repo.id,
|
||||||
|
pubkey: repo.pubkey,
|
||||||
|
created_at: repo.created_at,
|
||||||
|
kind: repo.kind,
|
||||||
|
tags: repo.tags,
|
||||||
|
content: repo.content,
|
||||||
|
sig: repo.sig,
|
||||||
|
}, null, 2)}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Memoize to prevent re-renders when parent re-renders with same props
|
||||||
|
export const RepositoryCard = memo(RepositoryCardInner);
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
|
|
||||||
/** Visual divider between chat sessions */
|
|
||||||
export function SessionDivider() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="flex items-center gap-3 text-xs text-muted-foreground py-4">
|
|
||||||
<div className="flex-1 h-px bg-border" />
|
|
||||||
<span className="uppercase tracking-wide">
|
|
||||||
{t('newChat', 'New chat')}
|
|
||||||
</span>
|
|
||||||
<div className="flex-1 h-px bg-border" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Skeleton } from '@/components/ui/skeleton';
|
import { Skeleton } from '@/components/ui/skeleton';
|
||||||
import { OnboardingDialog } from '@/components/OnboardingDialog';
|
import { OnboardingDialog } from '@/components/OnboardingDialog';
|
||||||
import { ChevronDown, ChevronUp, Play } from 'lucide-react';
|
import { ChevronDown, Play } from 'lucide-react';
|
||||||
import { useAISettings } from '@/hooks/useAISettings';
|
import { useAISettings } from '@/hooks/useAISettings';
|
||||||
import { useFS } from '@/hooks/useFS';
|
import { useFS } from '@/hooks/useFS';
|
||||||
import { useFSPaths } from '@/hooks/useFSPaths';
|
import { useFSPaths } from '@/hooks/useFSPaths';
|
||||||
@@ -47,12 +47,11 @@ import OpenAI from 'openai';
|
|||||||
import { useGit } from '@/hooks/useGit';
|
import { useGit } from '@/hooks/useGit';
|
||||||
import { Quilly } from '@/components/Quilly';
|
import { Quilly } from '@/components/Quilly';
|
||||||
import { ShakespeareLogo } from '@/components/ShakespeareLogo';
|
import { ShakespeareLogo } from '@/components/ShakespeareLogo';
|
||||||
import { SessionDivider } from '@/components/SessionDivider';
|
|
||||||
import { ChatInput } from '@/components/Shakespeare/ChatInput';
|
import { ChatInput } from '@/components/Shakespeare/ChatInput';
|
||||||
import { buildMessageContent } from '@/lib/buildMessageContent';
|
import { buildMessageContent } from '@/lib/buildMessageContent';
|
||||||
import { DotAI } from '@/lib/DotAI';
|
import { DotAI } from '@/lib/DotAI';
|
||||||
import { parseProviderModel } from '@/lib/parseProviderModel';
|
import { parseProviderModel } from '@/lib/parseProviderModel';
|
||||||
import { AIMessage, DisplayMessage } from '@/lib/SessionManager';
|
import { AIMessage } from '@/lib/SessionManager';
|
||||||
|
|
||||||
// Clean interfaces now handled by proper hooks
|
// Clean interfaces now handled by proper hooks
|
||||||
|
|
||||||
@@ -295,13 +294,9 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
messages,
|
messages,
|
||||||
displayMessages,
|
|
||||||
sessionName,
|
|
||||||
streamingMessage,
|
streamingMessage,
|
||||||
isLoading: internalIsLoading,
|
isLoading: internalIsLoading,
|
||||||
isLoadingHistory,
|
isLoadingHistory,
|
||||||
hasMoreHistory,
|
|
||||||
isLoadingMoreHistory,
|
|
||||||
totalCost,
|
totalCost,
|
||||||
lastInputTokens,
|
lastInputTokens,
|
||||||
lastFinishReason,
|
lastFinishReason,
|
||||||
@@ -310,7 +305,6 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
startGeneration,
|
startGeneration,
|
||||||
stopGeneration,
|
stopGeneration,
|
||||||
startNewSession: internalStartNewSession,
|
startNewSession: internalStartNewSession,
|
||||||
loadMoreHistory,
|
|
||||||
} = useAIChat({
|
} = useAIChat({
|
||||||
projectId,
|
projectId,
|
||||||
tools,
|
tools,
|
||||||
@@ -324,7 +318,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
const checkTemplateInfo = async () => {
|
const checkTemplateInfo = async () => {
|
||||||
try {
|
try {
|
||||||
// Only check if we have at least 1 message
|
// Only check if we have at least 1 message
|
||||||
if (displayMessages.length === 0) {
|
if (messages.length === 0) {
|
||||||
setShowTemplateInfo(false);
|
setShowTemplateInfo(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -363,7 +357,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
};
|
};
|
||||||
|
|
||||||
checkTemplateInfo();
|
checkTemplateInfo();
|
||||||
}, [fs, projectsPath, projectId, displayMessages.length]);
|
}, [fs, projectsPath, projectId, messages.length]);
|
||||||
|
|
||||||
// Handle console error help requests
|
// Handle console error help requests
|
||||||
const handleConsoleErrorHelp = useCallback(async () => {
|
const handleConsoleErrorHelp = useCallback(async () => {
|
||||||
@@ -442,11 +436,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
// Function to scroll to bottom
|
// Function to scroll to bottom
|
||||||
const scrollToBottom = useCallback(() => {
|
const scrollToBottom = useCallback(() => {
|
||||||
if (scrollAreaRef.current) {
|
if (scrollAreaRef.current) {
|
||||||
requestAnimationFrame(() => {
|
scrollAreaRef.current.scrollTop = scrollAreaRef.current.scrollHeight;
|
||||||
if (scrollAreaRef.current) {
|
|
||||||
scrollAreaRef.current.scrollTop = scrollAreaRef.current.scrollHeight;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -499,20 +489,17 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (scrollAreaRef.current && (messages || streamingMessage)) {
|
if (scrollAreaRef.current && (messages || streamingMessage)) {
|
||||||
const container = scrollAreaRef.current;
|
// Check if user was already at or near the bottom (within 100px threshold)
|
||||||
const lastMessage = messages[messages.length - 1];
|
|
||||||
const isUserMessage = lastMessage?.role === 'user';
|
|
||||||
|
|
||||||
// Check if user was already near the bottom (within 100px threshold)
|
|
||||||
const threshold = 100;
|
const threshold = 100;
|
||||||
|
const container = scrollAreaRef.current;
|
||||||
const isNearBottom = container.scrollTop + container.clientHeight >= container.scrollHeight - threshold;
|
const isNearBottom = container.scrollTop + container.clientHeight >= container.scrollHeight - threshold;
|
||||||
|
|
||||||
// Scroll to bottom if user sent a message or was already near the bottom
|
// Only auto-scroll if user was already near the bottom
|
||||||
if (isUserMessage || isNearBottom) {
|
if (isNearBottom) {
|
||||||
scrollToBottom();
|
container.scrollTop = container.scrollHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [messages, streamingMessage, isLoading, scrollToBottom]);
|
}, [messages, streamingMessage, isLoading]);
|
||||||
|
|
||||||
// Scroll to bottom when first visiting a project (including page refresh)
|
// Scroll to bottom when first visiting a project (including page refresh)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -590,11 +577,8 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
// Add model to recently used when sending a message
|
// Add model to recently used when sending a message
|
||||||
addRecentlyUsedModel(modelToUse);
|
addRecentlyUsedModel(modelToUse);
|
||||||
|
|
||||||
// Scroll to bottom when user sends a message
|
|
||||||
scrollToBottom();
|
|
||||||
|
|
||||||
await sendMessage(messageContent, modelToUse);
|
await sendMessage(messageContent, modelToUse);
|
||||||
}, [addRecentlyUsedModel, fs, isConfigured, isLoading, providerModel, sendMessage, tmpPath, scrollToBottom]);
|
}, [addRecentlyUsedModel, fs, isConfigured, isLoading, providerModel, sendMessage, tmpPath]);
|
||||||
|
|
||||||
// Handle textarea focus - show onboarding if not configured
|
// Handle textarea focus - show onboarding if not configured
|
||||||
const handleTextareaFocus = useCallback(() => {
|
const handleTextareaFocus = useCallback(() => {
|
||||||
@@ -773,7 +757,7 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Empty state when no messages and not loading */}
|
{/* Empty state when no messages and not loading */}
|
||||||
{!isLoadingHistory && displayMessages.length === 0 && !streamingMessage && !isLoading && (
|
{!isLoadingHistory && messages.length === 0 && !streamingMessage && !isLoading && (
|
||||||
<div className="flex-1 flex items-center justify-center min-h-[400px]">
|
<div className="flex-1 flex items-center justify-center min-h-[400px]">
|
||||||
<div className="text-center space-y-4 max-w-md mx-auto">
|
<div className="text-center space-y-4 max-w-md mx-auto">
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
@@ -797,49 +781,13 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Load older messages button */}
|
{!isLoadingHistory && messages.map((message, index) => {
|
||||||
{!isLoadingHistory && hasMoreHistory && (
|
|
||||||
<div className="flex justify-center py-3">
|
|
||||||
<Button
|
|
||||||
variant="ghost"
|
|
||||||
size="sm"
|
|
||||||
onClick={async () => {
|
|
||||||
const container = scrollAreaRef.current;
|
|
||||||
const oldScrollHeight = container?.scrollHeight || 0;
|
|
||||||
await loadMoreHistory();
|
|
||||||
// Preserve scroll position after prepending content
|
|
||||||
if (container) {
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
container.scrollTop += container.scrollHeight - oldScrollHeight;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
disabled={isLoadingMoreHistory}
|
|
||||||
className="gap-2 text-muted-foreground"
|
|
||||||
>
|
|
||||||
<ChevronUp className="h-4 w-4" />
|
|
||||||
{isLoadingMoreHistory ? t('loading') : t('loadOlderMessages', 'Load older messages')}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!isLoadingHistory && displayMessages.map((message, index) => {
|
|
||||||
// Get the current message's session ID and compare to previous
|
|
||||||
const currentSessionId = (message as DisplayMessage).sessionId;
|
|
||||||
const prevSessionId = index > 0 ? (displayMessages[index - 1] as DisplayMessage).sessionId : undefined;
|
|
||||||
|
|
||||||
// Show divider when session changes (not on first message)
|
|
||||||
const showDivider = index > 0 && currentSessionId !== prevSessionId;
|
|
||||||
|
|
||||||
// Dim messages from older sessions (compare against current active session)
|
|
||||||
const isOlderSession = currentSessionId !== sessionName;
|
|
||||||
|
|
||||||
// Find the corresponding tool call for tool messages
|
// Find the corresponding tool call for tool messages
|
||||||
let toolCall: OpenAI.Chat.Completions.ChatCompletionMessageToolCall | undefined = undefined;
|
let toolCall: OpenAI.Chat.Completions.ChatCompletionMessageToolCall | undefined = undefined;
|
||||||
if (message.role === 'tool') {
|
if (message.role === 'tool') {
|
||||||
// Look backwards to find the assistant message with matching tool call
|
// Look backwards to find the assistant message with matching tool call
|
||||||
for (let i = index - 1; i >= 0; i--) {
|
for (let i = index - 1; i >= 0; i--) {
|
||||||
const prevMessage = displayMessages[i];
|
const prevMessage = messages[i];
|
||||||
if (prevMessage.role === 'assistant' && 'tool_calls' in prevMessage && prevMessage.tool_calls) {
|
if (prevMessage.role === 'assistant' && 'tool_calls' in prevMessage && prevMessage.tool_calls) {
|
||||||
toolCall = prevMessage.tool_calls.find(tc => tc.id === message.tool_call_id);
|
toolCall = prevMessage.tool_calls.find(tc => tc.id === message.tool_call_id);
|
||||||
if (toolCall) break;
|
if (toolCall) break;
|
||||||
@@ -848,27 +796,14 @@ export const ChatPane = forwardRef<ChatPaneRef, ChatPaneProps>(({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<AIMessageItem
|
||||||
key={`${index}-${message.role}-${typeof message.content === 'string' ? message.content.slice(0, 50) : 'content'}`}
|
key={`${index}-${message.role}-${typeof message.content === 'string' ? message.content.slice(0, 50) : 'content'}`}
|
||||||
className={isOlderSession ? 'opacity-65' : ''}
|
message={message}
|
||||||
>
|
toolCall={toolCall}
|
||||||
{showDivider && <SessionDivider />}
|
/>
|
||||||
<AIMessageItem
|
|
||||||
message={message}
|
|
||||||
toolCall={toolCall}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
||||||
{/* Trailing session divider - shown when New Chat is clicked before sending a message */}
|
|
||||||
{!isLoadingHistory && displayMessages.length > 0 && (() => {
|
|
||||||
const lastSessionId = (displayMessages[displayMessages.length - 1] as DisplayMessage).sessionId;
|
|
||||||
return sessionName && lastSessionId && sessionName !== lastSessionId ? (
|
|
||||||
<SessionDivider key="trailing-divider" />
|
|
||||||
) : null;
|
|
||||||
})()}
|
|
||||||
|
|
||||||
{!isLoadingHistory && renderStreamingMessage()}
|
{!isLoadingHistory && renderStreamingMessage()}
|
||||||
|
|
||||||
{/* Resume button - shown when not loading and finish reason is not "stop" or "length" (or no finish reason) */}
|
{/* Resume button - shown when not loading and finish reason is not "stop" or "length" (or no finish reason) */}
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ export function ZapDialog({ target, children, className }: ZapDialogProps) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (target) {
|
if (target) {
|
||||||
setComment('Zapped with MKStack!');
|
setComment('Zapped from Shakespeare!');
|
||||||
}
|
}
|
||||||
}, [target]);
|
}, [target]);
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ import { useFS } from '@/hooks/useFS';
|
|||||||
import { useFSPaths } from '@/hooks/useFSPaths';
|
import { useFSPaths } from '@/hooks/useFSPaths';
|
||||||
import { useAppContext } from '@/hooks/useAppContext';
|
import { useAppContext } from '@/hooks/useAppContext';
|
||||||
import { useNostr } from '@nostrify/react';
|
import { useNostr } from '@nostrify/react';
|
||||||
|
import { useNostrPublish } from '@/hooks/useNostrPublish';
|
||||||
|
import { useGit } from '@/hooks/useGit';
|
||||||
|
import { NostrURI } from '@/lib/NostrURI';
|
||||||
|
import { createRepositoryAnnouncementEvent } from '@/lib/announceRepository';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import type { DeployProvider } from '@/contexts/DeploySettingsContext';
|
import type { DeployProvider } from '@/contexts/DeploySettingsContext';
|
||||||
import type { PresetDeployProvider } from '@/lib/deploy/types';
|
import type { PresetDeployProvider } from '@/lib/deploy/types';
|
||||||
@@ -110,6 +114,8 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
const { projectsPath } = useFSPaths();
|
const { projectsPath } = useFSPaths();
|
||||||
const { config } = useAppContext();
|
const { config } = useAppContext();
|
||||||
const { nostr } = useNostr();
|
const { nostr } = useNostr();
|
||||||
|
const { mutateAsync: publishEvent } = useNostrPublish();
|
||||||
|
const { git } = useGit();
|
||||||
|
|
||||||
const [selectedProviderId, setSelectedProviderId] = useState<string>('');
|
const [selectedProviderId, setSelectedProviderId] = useState<string>('');
|
||||||
const [isDeploying, setIsDeploying] = useState(false);
|
const [isDeploying, setIsDeploying] = useState(false);
|
||||||
@@ -323,6 +329,65 @@ export function DeploySteps({ projectId, projectName, onClose }: DeployStepsProp
|
|||||||
}
|
}
|
||||||
|
|
||||||
setDeployResult(result);
|
setDeployResult(result);
|
||||||
|
|
||||||
|
// Update repository announcement with deployment URL if using Nostr git
|
||||||
|
try {
|
||||||
|
const projectPath = `${projectsPath}/${projectId}`;
|
||||||
|
const remoteUrl = await git.getRemoteURL(projectPath, 'origin');
|
||||||
|
|
||||||
|
if (remoteUrl && remoteUrl.startsWith('nostr://') && user) {
|
||||||
|
const nostrURI = await NostrURI.parse(remoteUrl);
|
||||||
|
|
||||||
|
// Query for existing repository announcement
|
||||||
|
const existingRepos = await nostr.query(
|
||||||
|
[{ kinds: [30617], authors: [user.pubkey], '#d': [nostrURI.identifier], limit: 1 }],
|
||||||
|
{ signal: AbortSignal.timeout(5000) }
|
||||||
|
);
|
||||||
|
|
||||||
|
if (existingRepos.length > 0) {
|
||||||
|
const existingEvent = existingRepos[0];
|
||||||
|
|
||||||
|
// Extract existing data from the event
|
||||||
|
const description = existingEvent.tags.find(([tagName]) => tagName === 'description')?.[1];
|
||||||
|
const webTag = existingEvent.tags.find(([tagName]) => tagName === 'web');
|
||||||
|
const existingWebUrls = webTag ? webTag.slice(1) : [];
|
||||||
|
const cloneTag = existingEvent.tags.find(([tagName]) => tagName === 'clone');
|
||||||
|
const cloneUrls = cloneTag ? cloneTag.slice(1) : [];
|
||||||
|
const relaysTag = existingEvent.tags.find(([tagName]) => tagName === 'relays');
|
||||||
|
const relays = relaysTag ? relaysTag.slice(1) : [];
|
||||||
|
const tTags = existingEvent.tags
|
||||||
|
.filter(([tagName]) => tagName === 't')
|
||||||
|
.map(([, value]) => value);
|
||||||
|
const eucTag = existingEvent.tags.find(([tagName, , marker]) => tagName === 'r' && marker === 'euc');
|
||||||
|
const earliestCommit = eucTag?.[1];
|
||||||
|
const name = existingEvent.tags.find(([tagName]) => tagName === 'name')?.[1];
|
||||||
|
|
||||||
|
// Add deployment URL if not already present
|
||||||
|
const deploymentUrl = result.url;
|
||||||
|
const updatedWebUrls = existingWebUrls.includes(deploymentUrl)
|
||||||
|
? existingWebUrls
|
||||||
|
: [...existingWebUrls, deploymentUrl];
|
||||||
|
|
||||||
|
// Create updated repository announcement event
|
||||||
|
const eventTemplate = createRepositoryAnnouncementEvent({
|
||||||
|
repoId: nostrURI.identifier,
|
||||||
|
name,
|
||||||
|
description,
|
||||||
|
webUrls: updatedWebUrls,
|
||||||
|
cloneUrls,
|
||||||
|
relays,
|
||||||
|
tTags: tTags.length > 0 ? tTags : undefined,
|
||||||
|
earliestCommit,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Publish the updated event
|
||||||
|
await publishEvent(eventTemplate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
// Silently fail - updating web tag is not critical for deployment
|
||||||
|
console.warn('Failed to update repository announcement with deployment URL:', err);
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(err instanceof Error ? err.message : 'Deployment failed');
|
setError(err instanceof Error ? err.message : 'Deployment failed');
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
+2
-44
@@ -2,7 +2,7 @@ import { useState, useEffect, useCallback } from 'react';
|
|||||||
import { useSessionManager } from '@/hooks/useSessionManager';
|
import { useSessionManager } from '@/hooks/useSessionManager';
|
||||||
import { useSessionSubscription } from '@/hooks/useSessionSubscription';
|
import { useSessionSubscription } from '@/hooks/useSessionSubscription';
|
||||||
import { useAISettings } from '@/hooks/useAISettings';
|
import { useAISettings } from '@/hooks/useAISettings';
|
||||||
import type { AIMessage, DisplayMessage } from '@/lib/SessionManager';
|
import type { AIMessage } from '@/lib/SessionManager';
|
||||||
import type OpenAI from 'openai';
|
import type OpenAI from 'openai';
|
||||||
import type { Tool } from '@/lib/tools/Tool';
|
import type { Tool } from '@/lib/tools/Tool';
|
||||||
|
|
||||||
@@ -39,16 +39,12 @@ export function useAIChat({
|
|||||||
|
|
||||||
// Split session state into individual variables for efficient updates
|
// Split session state into individual variables for efficient updates
|
||||||
const [messages, setMessages] = useState<AIMessage[]>([]);
|
const [messages, setMessages] = useState<AIMessage[]>([]);
|
||||||
const [displayMessages, setDisplayMessages] = useState<DisplayMessage[]>([]);
|
|
||||||
const [sessionName, setSessionName] = useState<string>('');
|
|
||||||
const [streamingMessage, setStreamingMessage] = useState<StreamingMessage | undefined>(undefined);
|
const [streamingMessage, setStreamingMessage] = useState<StreamingMessage | undefined>(undefined);
|
||||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||||
const [totalCost, setTotalCost] = useState<number>(0);
|
const [totalCost, setTotalCost] = useState<number>(0);
|
||||||
const [lastInputTokens, setLastInputTokens] = useState<number>(0);
|
const [lastInputTokens, setLastInputTokens] = useState<number>(0);
|
||||||
const [lastFinishReason, setLastFinishReason] = useState<string | null>(null);
|
const [lastFinishReason, setLastFinishReason] = useState<string | null>(null);
|
||||||
const [isLoadingHistory, setIsLoadingHistory] = useState<boolean>(true);
|
const [isLoadingHistory, setIsLoadingHistory] = useState<boolean>(true);
|
||||||
const [hasMoreHistory, setHasMoreHistory] = useState<boolean>(false);
|
|
||||||
const [isLoadingMoreHistory, setIsLoadingMoreHistory] = useState<boolean>(false);
|
|
||||||
|
|
||||||
const initSession = useCallback(async () => {
|
const initSession = useCallback(async () => {
|
||||||
setIsLoadingHistory(true);
|
setIsLoadingHistory(true);
|
||||||
@@ -57,15 +53,11 @@ export function useAIChat({
|
|||||||
const session = await sessionManager.loadSession(projectId, tools, customTools, maxSteps);
|
const session = await sessionManager.loadSession(projectId, tools, customTools, maxSteps);
|
||||||
// Initialize individual state variables from existing session
|
// Initialize individual state variables from existing session
|
||||||
setMessages([...session.messages]);
|
setMessages([...session.messages]);
|
||||||
setDisplayMessages([...session.displayMessages]);
|
|
||||||
setSessionName(session.sessionName);
|
|
||||||
setStreamingMessage(session.streamingMessage ? { ...session.streamingMessage } : undefined);
|
setStreamingMessage(session.streamingMessage ? { ...session.streamingMessage } : undefined);
|
||||||
setIsLoading(session.isLoading);
|
setIsLoading(session.isLoading);
|
||||||
setTotalCost(session.totalCost || 0);
|
setTotalCost(session.totalCost || 0);
|
||||||
setLastInputTokens(session.lastInputTokens || 0);
|
setLastInputTokens(session.lastInputTokens || 0);
|
||||||
setLastFinishReason(session.lastFinishReason ?? null);
|
setLastFinishReason(session.lastFinishReason ?? null);
|
||||||
setHasMoreHistory(sessionManager.hasMoreHistory(projectId));
|
|
||||||
setIsLoadingMoreHistory(session.isLoadingMoreHistory || false);
|
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoadingHistory(false);
|
setIsLoadingHistory(false);
|
||||||
}
|
}
|
||||||
@@ -131,25 +123,6 @@ export function useAIChat({
|
|||||||
}
|
}
|
||||||
}, [projectId]);
|
}, [projectId]);
|
||||||
|
|
||||||
useSessionSubscription('displayMessageAdded', (updatedProjectId: string, message: DisplayMessage) => {
|
|
||||||
if (updatedProjectId === projectId) {
|
|
||||||
setDisplayMessages(prev => [...prev, message]);
|
|
||||||
}
|
|
||||||
}, [projectId]);
|
|
||||||
|
|
||||||
useSessionSubscription('displayMessagesPrepended', (updatedProjectId: string, newMessages: DisplayMessage[]) => {
|
|
||||||
if (updatedProjectId === projectId) {
|
|
||||||
setDisplayMessages(prev => [...newMessages, ...prev]);
|
|
||||||
setHasMoreHistory(sessionManager.hasMoreHistory(projectId));
|
|
||||||
}
|
|
||||||
}, [projectId, sessionManager]);
|
|
||||||
|
|
||||||
useSessionSubscription('loadingMoreHistoryChanged', (updatedProjectId: string, loading: boolean) => {
|
|
||||||
if (updatedProjectId === projectId) {
|
|
||||||
setIsLoadingMoreHistory(loading);
|
|
||||||
}
|
|
||||||
}, [projectId]);
|
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
const sendMessage = useCallback(async (
|
const sendMessage = useCallback(async (
|
||||||
content: string | Array<OpenAI.Chat.Completions.ChatCompletionContentPartText | OpenAI.Chat.Completions.ChatCompletionContentPartImage>,
|
content: string | Array<OpenAI.Chat.Completions.ChatCompletionContentPartText | OpenAI.Chat.Completions.ChatCompletionContentPartImage>,
|
||||||
@@ -191,13 +164,7 @@ export function useAIChat({
|
|||||||
const startNewSession = useCallback(async () => {
|
const startNewSession = useCallback(async () => {
|
||||||
await sessionManager.startNewSession(projectId);
|
await sessionManager.startNewSession(projectId);
|
||||||
|
|
||||||
// Get the updated session to retrieve the new session name
|
// Reset individual state variables
|
||||||
const session = sessionManager.getSession(projectId);
|
|
||||||
if (session) {
|
|
||||||
setSessionName(session.sessionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset only AI prompt state (not display state which is handled via events)
|
|
||||||
setMessages([]);
|
setMessages([]);
|
||||||
setStreamingMessage(undefined);
|
setStreamingMessage(undefined);
|
||||||
setTotalCost(0);
|
setTotalCost(0);
|
||||||
@@ -210,19 +177,11 @@ export function useAIChat({
|
|||||||
await startNewSession();
|
await startNewSession();
|
||||||
}, [startNewSession]);
|
}, [startNewSession]);
|
||||||
|
|
||||||
const loadMoreHistory = useCallback(async () => {
|
|
||||||
await sessionManager.loadOlderSession(projectId);
|
|
||||||
}, [projectId, sessionManager]);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
messages,
|
messages,
|
||||||
displayMessages,
|
|
||||||
sessionName,
|
|
||||||
streamingMessage,
|
streamingMessage,
|
||||||
isLoading,
|
isLoading,
|
||||||
isLoadingHistory,
|
isLoadingHistory,
|
||||||
hasMoreHistory,
|
|
||||||
isLoadingMoreHistory,
|
|
||||||
totalCost,
|
totalCost,
|
||||||
lastInputTokens,
|
lastInputTokens,
|
||||||
lastFinishReason,
|
lastFinishReason,
|
||||||
@@ -232,7 +191,6 @@ export function useAIChat({
|
|||||||
clearMessages,
|
clearMessages,
|
||||||
startNewSession,
|
startNewSession,
|
||||||
addMessage,
|
addMessage,
|
||||||
loadMoreHistory,
|
|
||||||
isConfigured,
|
isConfigured,
|
||||||
projectId
|
projectId
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export function useFollowedRepositories(followedPubkeys: string[] = []) {
|
|||||||
const { nostr } = useNostr();
|
const { nostr } = useNostr();
|
||||||
|
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['nostr', 'followed-repositories', followedPubkeys.sort().join(',')],
|
queryKey: ['nostr', 'followed-repositories', followedPubkeys],
|
||||||
queryFn: async (): Promise<Repository[]> => {
|
queryFn: async (): Promise<Repository[]> => {
|
||||||
if (followedPubkeys.length === 0) {
|
if (followedPubkeys.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
@@ -50,10 +50,19 @@ export function useFollowedRepositories(followedPubkeys: string[] = []) {
|
|||||||
|
|
||||||
const name = event.tags.find(tag => tag[0] === 'name')?.[1] || dTag;
|
const name = event.tags.find(tag => tag[0] === 'name')?.[1] || dTag;
|
||||||
const description = event.tags.find(tag => tag[0] === 'description')?.[1] || '';
|
const description = event.tags.find(tag => tag[0] === 'description')?.[1] || '';
|
||||||
const webUrls = event.tags.filter(tag => tag[0] === 'web').map(tag => tag[1]).filter(Boolean);
|
|
||||||
const cloneUrls = event.tags.filter(tag => tag[0] === 'clone').map(tag => tag[1]).filter(Boolean);
|
// Extract multi-value tags correctly (all values are in a single tag per NIP-34)
|
||||||
const relays = event.tags.filter(tag => tag[0] === 'relays').map(tag => tag[1]).filter(Boolean);
|
const webTag = event.tags.find(tag => tag[0] === 'web');
|
||||||
const maintainers = event.tags.filter(tag => tag[0] === 'maintainers').map(tag => tag[1]).filter(Boolean);
|
const webUrls = webTag ? webTag.slice(1).filter(Boolean) : [];
|
||||||
|
|
||||||
|
const cloneTag = event.tags.find(tag => tag[0] === 'clone');
|
||||||
|
const cloneUrls = cloneTag ? cloneTag.slice(1).filter(Boolean) : [];
|
||||||
|
|
||||||
|
const relaysTag = event.tags.find(tag => tag[0] === 'relays');
|
||||||
|
const relays = relaysTag ? relaysTag.slice(1).filter(Boolean) : [];
|
||||||
|
|
||||||
|
const maintainersTag = event.tags.find(tag => tag[0] === 'maintainers');
|
||||||
|
const maintainers = maintainersTag ? maintainersTag.slice(1).filter(Boolean) : [];
|
||||||
const repoTags = event.tags.filter(tag => tag[0] === 't' && tag[1] !== 'personal-fork').map(tag => tag[1]);
|
const repoTags = event.tags.filter(tag => tag[0] === 't' && tag[1] !== 'personal-fork').map(tag => tag[1]);
|
||||||
const earliestUniqueCommit = event.tags.find(tag => tag[0] === 'r' && tag[2] === 'euc')?.[1];
|
const earliestUniqueCommit = event.tags.find(tag => tag[0] === 'r' && tag[2] === 'euc')?.[1];
|
||||||
const isPersonalFork = event.tags.some(tag => tag[0] === 't' && tag[1] === 'personal-fork');
|
const isPersonalFork = event.tags.some(tag => tag[0] === 't' && tag[1] === 'personal-fork');
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
import { useAppContext } from './useAppContext';
|
||||||
|
import { proxyUrl } from '@/lib/proxyUrl';
|
||||||
|
|
||||||
|
export interface OGMetadata {
|
||||||
|
image: string | null;
|
||||||
|
description: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hook to fetch Open Graph metadata from a web URL using CORS proxy
|
||||||
|
* @param webUrl - The web URL to fetch OG metadata from
|
||||||
|
* @returns Query result with OG image URL and description
|
||||||
|
*/
|
||||||
|
export function useOGImage(webUrl?: string) {
|
||||||
|
const { config } = useAppContext();
|
||||||
|
|
||||||
|
return useQuery({
|
||||||
|
queryKey: ['og-metadata', webUrl],
|
||||||
|
queryFn: async (): Promise<OGMetadata> => {
|
||||||
|
if (!webUrl) {
|
||||||
|
return { image: null, description: null };
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Use CORS proxy to fetch the HTML
|
||||||
|
const proxiedUrl = proxyUrl(config.corsProxy, webUrl);
|
||||||
|
const response = await fetch(proxiedUrl, {
|
||||||
|
signal: AbortSignal.timeout(5000),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
return { image: null, description: null };
|
||||||
|
}
|
||||||
|
|
||||||
|
const html = await response.text();
|
||||||
|
const parser = new DOMParser();
|
||||||
|
const doc = parser.parseFromString(html, 'text/html');
|
||||||
|
|
||||||
|
// Extract OG image
|
||||||
|
let ogImage: string | null = null;
|
||||||
|
const ogImageMeta = doc.querySelector('meta[property="og:image"]')?.getAttribute('content');
|
||||||
|
if (ogImageMeta) {
|
||||||
|
try {
|
||||||
|
ogImage = new URL(ogImageMeta, webUrl).href;
|
||||||
|
} catch {
|
||||||
|
ogImage = ogImageMeta.startsWith('http') ? ogImageMeta : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to twitter:image if og:image not found
|
||||||
|
if (!ogImage) {
|
||||||
|
const twitterImage = doc.querySelector('meta[name="twitter:image"]')?.getAttribute('content');
|
||||||
|
if (twitterImage) {
|
||||||
|
try {
|
||||||
|
ogImage = new URL(twitterImage, webUrl).href;
|
||||||
|
} catch {
|
||||||
|
ogImage = twitterImage.startsWith('http') ? twitterImage : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extract OG description
|
||||||
|
let ogDescription: string | null = null;
|
||||||
|
const ogDescriptionMeta = doc.querySelector('meta[property="og:description"]')?.getAttribute('content');
|
||||||
|
if (ogDescriptionMeta) {
|
||||||
|
ogDescription = ogDescriptionMeta.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to twitter:description if og:description not found
|
||||||
|
if (!ogDescription) {
|
||||||
|
const twitterDescription = doc.querySelector('meta[name="twitter:description"]')?.getAttribute('content');
|
||||||
|
if (twitterDescription) {
|
||||||
|
ogDescription = twitterDescription.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
image: ogImage,
|
||||||
|
description: ogDescription || null,
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('Failed to fetch OG metadata:', error);
|
||||||
|
return { image: null, description: null };
|
||||||
|
}
|
||||||
|
},
|
||||||
|
enabled: !!webUrl,
|
||||||
|
staleTime: 1000 * 60 * 60, // 1 hour
|
||||||
|
retry: 1,
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -55,10 +55,19 @@ export function useUserRepositories(userPubkey?: string) {
|
|||||||
try {
|
try {
|
||||||
const name = event.tags.find(tag => tag[0] === 'name')?.[1] || dTag;
|
const name = event.tags.find(tag => tag[0] === 'name')?.[1] || dTag;
|
||||||
const description = event.tags.find(tag => tag[0] === 'description')?.[1] || '';
|
const description = event.tags.find(tag => tag[0] === 'description')?.[1] || '';
|
||||||
const webUrls = event.tags.filter(tag => tag[0] === 'web').map(tag => tag[1]).filter(Boolean);
|
|
||||||
const cloneUrls = event.tags.filter(tag => tag[0] === 'clone').map(tag => tag[1]).filter(Boolean);
|
// Extract multi-value tags correctly (all values are in a single tag per NIP-34)
|
||||||
const relays = event.tags.filter(tag => tag[0] === 'relays').map(tag => tag[1]).filter(Boolean);
|
const webTag = event.tags.find(tag => tag[0] === 'web');
|
||||||
const maintainers = event.tags.filter(tag => tag[0] === 'maintainers').map(tag => tag[1]).filter(Boolean);
|
const webUrls = webTag ? webTag.slice(1).filter(Boolean) : [];
|
||||||
|
|
||||||
|
const cloneTag = event.tags.find(tag => tag[0] === 'clone');
|
||||||
|
const cloneUrls = cloneTag ? cloneTag.slice(1).filter(Boolean) : [];
|
||||||
|
|
||||||
|
const relaysTag = event.tags.find(tag => tag[0] === 'relays');
|
||||||
|
const relays = relaysTag ? relaysTag.slice(1).filter(Boolean) : [];
|
||||||
|
|
||||||
|
const maintainersTag = event.tags.find(tag => tag[0] === 'maintainers');
|
||||||
|
const maintainers = maintainersTag ? maintainersTag.slice(1).filter(Boolean) : [];
|
||||||
const repoTags = event.tags.filter(tag => tag[0] === 't' && tag[1] !== 'personal-fork').map(tag => tag[1]);
|
const repoTags = event.tags.filter(tag => tag[0] === 't' && tag[1] !== 'personal-fork').map(tag => tag[1]);
|
||||||
const earliestUniqueCommit = event.tags.find(tag => tag[0] === 'r' && tag[2] === 'euc')?.[1];
|
const earliestUniqueCommit = event.tags.find(tag => tag[0] === 'r' && tag[2] === 'euc')?.[1];
|
||||||
const isPersonalFork = event.tags.some(tag => tag[0] === 't' && tag[1] === 'personal-fork');
|
const isPersonalFork = event.tags.some(tag => tag[0] === 't' && tag[1] === 'personal-fork');
|
||||||
|
|||||||
@@ -27,6 +27,73 @@ describe('DotAI', () => {
|
|||||||
dotAI = new DotAI(mockFS, '/test-project');
|
dotAI = new DotAI(mockFS, '/test-project');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('readLastSessionHistory', () => {
|
||||||
|
it('should return null when history directory does not exist', async () => {
|
||||||
|
// Mock historyDirExists to return false
|
||||||
|
vi.spyOn(dotAI, 'historyDirExists').mockResolvedValue(false);
|
||||||
|
|
||||||
|
const result = await dotAI.readLastSessionHistory();
|
||||||
|
expect(result).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return null when no session files exist', async () => {
|
||||||
|
// Mock historyDirExists to return true
|
||||||
|
vi.spyOn(dotAI, 'historyDirExists').mockResolvedValue(true);
|
||||||
|
|
||||||
|
// Mock readdir to return empty array
|
||||||
|
vi.mocked(mockFS.readdir).mockResolvedValue([]);
|
||||||
|
|
||||||
|
const result = await dotAI.readLastSessionHistory();
|
||||||
|
expect(result).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return messages and session name from most recent file', async () => {
|
||||||
|
// Mock historyDirExists to return true
|
||||||
|
vi.spyOn(dotAI, 'historyDirExists').mockResolvedValue(true);
|
||||||
|
|
||||||
|
// Mock readdir to return session files
|
||||||
|
vi.mocked(mockFS.readdir).mockResolvedValue([
|
||||||
|
'2024-08-24T16-30-45Z-abc.jsonl',
|
||||||
|
'2024-08-24T17-15-22Z-def.jsonl', // This should be the most recent
|
||||||
|
'2024-08-24T15-00-00Z-xyz.jsonl'
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Mock readFile to return JSONL content
|
||||||
|
const mockContent = `{"role":"user","content":"Hello"}
|
||||||
|
{"role":"assistant","content":"Hi there!"}`;
|
||||||
|
vi.mocked(mockFS.readFile).mockResolvedValue(mockContent);
|
||||||
|
|
||||||
|
const result = await dotAI.readLastSessionHistory();
|
||||||
|
|
||||||
|
expect(result).not.toBeNull();
|
||||||
|
expect(result?.sessionName).toBe('2024-08-24T17-15-22Z-def');
|
||||||
|
expect(result?.messages).toHaveLength(2);
|
||||||
|
expect(result?.messages[0]).toEqual({ role: 'user', content: 'Hello' });
|
||||||
|
expect(result?.messages[1]).toEqual({ role: 'assistant', content: 'Hi there!' });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should handle malformed JSON lines gracefully', async () => {
|
||||||
|
// Mock historyDirExists to return true
|
||||||
|
vi.spyOn(dotAI, 'historyDirExists').mockResolvedValue(true);
|
||||||
|
|
||||||
|
// Mock readdir to return session files
|
||||||
|
vi.mocked(mockFS.readdir).mockResolvedValue(['session.jsonl']);
|
||||||
|
|
||||||
|
// Mock readFile to return content with malformed JSON
|
||||||
|
const mockContent = `{"role":"user","content":"Hello"}
|
||||||
|
invalid json line
|
||||||
|
{"role":"assistant","content":"Hi there!"}`;
|
||||||
|
vi.mocked(mockFS.readFile).mockResolvedValue(mockContent);
|
||||||
|
|
||||||
|
const result = await dotAI.readLastSessionHistory();
|
||||||
|
|
||||||
|
expect(result).not.toBeNull();
|
||||||
|
expect(result?.messages).toHaveLength(2); // Should skip the malformed line
|
||||||
|
expect(result?.messages[0]).toEqual({ role: 'user', content: 'Hello' });
|
||||||
|
expect(result?.messages[1]).toEqual({ role: 'assistant', content: 'Hi there!' });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('setHistory', () => {
|
describe('setHistory', () => {
|
||||||
it('should create history directory if it does not exist', async () => {
|
it('should create history directory if it does not exist', async () => {
|
||||||
// Mock historyDirExists to return false initially
|
// Mock historyDirExists to return false initially
|
||||||
|
|||||||
+52
-36
@@ -216,50 +216,66 @@ export class DotAI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List all session names sorted chronologically (oldest first)
|
* Read the most recent session history
|
||||||
* Fast operation - does not load message content
|
* @returns Object containing messages array and session name, or null if no history found
|
||||||
* @returns Array of session names (filenames without .jsonl extension)
|
|
||||||
*/
|
*/
|
||||||
async listSessionNames(): Promise<string[]> {
|
async readLastSessionHistory(): Promise<{
|
||||||
|
messages: OpenAI.Chat.Completions.ChatCompletionMessageParam[];
|
||||||
|
sessionName: string;
|
||||||
|
} | null> {
|
||||||
try {
|
try {
|
||||||
|
// Check if history directory exists
|
||||||
if (!(await this.historyDirExists())) {
|
if (!(await this.historyDirExists())) {
|
||||||
return [];
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const files = await this.fs.readdir(this.historyDir);
|
// Find the most recent session file
|
||||||
return files
|
try {
|
||||||
.filter(file => file.endsWith('.jsonl'))
|
const files = await this.fs.readdir(this.historyDir);
|
||||||
.map(file => file.replace('.jsonl', ''))
|
const sessionFiles = files
|
||||||
.sort(); // Chronological order (oldest first) - filenames contain timestamps
|
.filter(file => file.endsWith('.jsonl'))
|
||||||
} catch {
|
.sort()
|
||||||
return [];
|
.reverse(); // Most recent first
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
if (sessionFiles.length === 0) {
|
||||||
* Read messages for a single session
|
return null;
|
||||||
* @param sessionName The session name (filename without .jsonl)
|
|
||||||
* @returns Array of messages, or empty array if session not found
|
|
||||||
*/
|
|
||||||
async readSessionHistory(sessionName: string): Promise<OpenAI.Chat.Completions.ChatCompletionMessageParam[]> {
|
|
||||||
try {
|
|
||||||
const sessionPath = join(this.historyDir, sessionName + '.jsonl');
|
|
||||||
const content = await this.fs.readFile(sessionPath, 'utf8');
|
|
||||||
const lines = content.trim().split('\n').filter(line => line.trim());
|
|
||||||
const messages: OpenAI.Chat.Completions.ChatCompletionMessageParam[] = [];
|
|
||||||
|
|
||||||
for (const line of lines) {
|
|
||||||
try {
|
|
||||||
const message = JSON.parse(line) as OpenAI.Chat.Completions.ChatCompletionMessageParam;
|
|
||||||
messages.push(message);
|
|
||||||
} catch {
|
|
||||||
// Skip malformed lines
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return messages;
|
const latestSessionFile = sessionFiles[0];
|
||||||
} catch {
|
const sessionPath = join(this.historyDir, latestSessionFile);
|
||||||
return [];
|
|
||||||
|
try {
|
||||||
|
const content = await this.fs.readFile(sessionPath, 'utf8');
|
||||||
|
const lines = content.trim().split('\n').filter(line => line.trim());
|
||||||
|
const messages: OpenAI.Chat.Completions.ChatCompletionMessageParam[] = [];
|
||||||
|
|
||||||
|
for (const line of lines) {
|
||||||
|
try {
|
||||||
|
const message = JSON.parse(line) as OpenAI.Chat.Completions.ChatCompletionMessageParam;
|
||||||
|
messages.push(message);
|
||||||
|
} catch (parseError) {
|
||||||
|
console.warn('Failed to parse message from history:', parseError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return session name without .jsonl extension
|
||||||
|
const sessionName = latestSessionFile.replace('.jsonl', '');
|
||||||
|
|
||||||
|
return {
|
||||||
|
messages,
|
||||||
|
sessionName
|
||||||
|
};
|
||||||
|
} catch (readError) {
|
||||||
|
console.warn('Failed to read session file:', readError);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (readdirError) {
|
||||||
|
console.warn('Failed to read history directory:', readdirError);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('Failed to read last session history:', error);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-118
@@ -24,20 +24,12 @@ export type AIMessage = OpenAI.Chat.Completions.ChatCompletionMessageParam | {
|
|||||||
tool_calls?: OpenAI.Chat.Completions.ChatCompletionMessageToolCall[];
|
tool_calls?: OpenAI.Chat.Completions.ChatCompletionMessageToolCall[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** AIMessage with session tracking for UI display */
|
|
||||||
export type DisplayMessage = AIMessage & {
|
|
||||||
sessionId?: string; // Session identifier for grouping messages in UI
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface SessionState {
|
export interface SessionState {
|
||||||
projectId: string;
|
projectId: string;
|
||||||
tools: Record<string, OpenAI.Chat.Completions.ChatCompletionTool>;
|
tools: Record<string, OpenAI.Chat.Completions.ChatCompletionTool>;
|
||||||
customTools: Record<string, Tool<unknown>>;
|
customTools: Record<string, Tool<unknown>>;
|
||||||
maxSteps?: number;
|
maxSteps?: number;
|
||||||
messages: AIMessage[]; // Current session messages (sent to AI)
|
messages: AIMessage[];
|
||||||
displayMessages: DisplayMessage[]; // All messages from all sessions (for UI, with sessionId)
|
|
||||||
availableSessionNames: string[]; // All session names (for lazy loading)
|
|
||||||
loadedSessionCount: number; // How many sessions loaded from the end
|
|
||||||
streamingMessage?: {
|
streamingMessage?: {
|
||||||
role: 'assistant';
|
role: 'assistant';
|
||||||
content: string;
|
content: string;
|
||||||
@@ -45,7 +37,6 @@ export interface SessionState {
|
|||||||
tool_calls?: OpenAI.Chat.Completions.ChatCompletionMessageToolCall[];
|
tool_calls?: OpenAI.Chat.Completions.ChatCompletionMessageToolCall[];
|
||||||
};
|
};
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
isLoadingMoreHistory: boolean; // Loading older sessions
|
|
||||||
sessionName: string;
|
sessionName: string;
|
||||||
lastActivity: Date;
|
lastActivity: Date;
|
||||||
abortController?: AbortController;
|
abortController?: AbortController;
|
||||||
@@ -59,11 +50,8 @@ export interface SessionManagerEvents {
|
|||||||
sessionCreated: (projectId: string) => void;
|
sessionCreated: (projectId: string) => void;
|
||||||
sessionDeleted: (projectId: string) => void;
|
sessionDeleted: (projectId: string) => void;
|
||||||
messageAdded: (projectId: string, message: AIMessage) => void;
|
messageAdded: (projectId: string, message: AIMessage) => void;
|
||||||
displayMessageAdded: (projectId: string, message: DisplayMessage) => void;
|
|
||||||
displayMessagesPrepended: (projectId: string, messages: DisplayMessage[]) => void;
|
|
||||||
streamingUpdate: (projectId: string, content: string, reasoningContent?: string, toolCalls?: OpenAI.Chat.Completions.ChatCompletionMessageToolCall[]) => void;
|
streamingUpdate: (projectId: string, content: string, reasoningContent?: string, toolCalls?: OpenAI.Chat.Completions.ChatCompletionMessageToolCall[]) => void;
|
||||||
loadingChanged: (projectId: string, isLoading: boolean) => void;
|
loadingChanged: (projectId: string, isLoading: boolean) => void;
|
||||||
loadingMoreHistoryChanged: (projectId: string, isLoading: boolean) => void;
|
|
||||||
costUpdated: (projectId: string, totalCost: number) => void;
|
costUpdated: (projectId: string, totalCost: number) => void;
|
||||||
contextUsageUpdated: (projectId: string, inputTokens: number) => void;
|
contextUsageUpdated: (projectId: string, inputTokens: number) => void;
|
||||||
fileChanged: (projectId: string, filePath: string) => void;
|
fileChanged: (projectId: string, filePath: string) => void;
|
||||||
@@ -109,7 +97,7 @@ export class SessionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new session for a project (lazy loading - only loads most recent session)
|
* Create a new session for a project
|
||||||
*/
|
*/
|
||||||
async loadSession(
|
async loadSession(
|
||||||
projectId: string,
|
projectId: string,
|
||||||
@@ -117,39 +105,18 @@ export class SessionManager {
|
|||||||
customTools: Record<string, Tool<unknown>>,
|
customTools: Record<string, Tool<unknown>>,
|
||||||
maxSteps?: number
|
maxSteps?: number
|
||||||
): Promise<SessionState> {
|
): Promise<SessionState> {
|
||||||
const messages: AIMessage[] = [];
|
let messages: OpenAI.Chat.Completions.ChatCompletionMessageParam[] = [];
|
||||||
const displayMessages: DisplayMessage[] = [];
|
|
||||||
let sessionName = DotAI.generateSessionName();
|
let sessionName = DotAI.generateSessionName();
|
||||||
let availableSessionNames: string[] = [];
|
|
||||||
let loadedSessionCount = 0;
|
|
||||||
let lastFinishReason: string | null | undefined;
|
let lastFinishReason: string | null | undefined;
|
||||||
|
|
||||||
// Try to load existing history (lazy - only load last session)
|
// Try to load existing history
|
||||||
try {
|
try {
|
||||||
const config = this.getConfig();
|
const config = this.getConfig();
|
||||||
const dotAI = new DotAI(this.fs, `${config.fsPathProjects}/${projectId}`);
|
const dotAI = new DotAI(this.fs, `${config.fsPathProjects}/${projectId}`);
|
||||||
|
const lastSession = await dotAI.readLastSessionHistory();
|
||||||
// Get all available session names (fast - no content loading)
|
if (lastSession) {
|
||||||
availableSessionNames = await dotAI.listSessionNames();
|
messages = lastSession.messages;
|
||||||
|
sessionName = lastSession.sessionName;
|
||||||
if (availableSessionNames.length > 0) {
|
|
||||||
// Only load the most recent session
|
|
||||||
const lastSessionName = availableSessionNames[availableSessionNames.length - 1];
|
|
||||||
const lastSessionMessages = await dotAI.readSessionHistory(lastSessionName);
|
|
||||||
|
|
||||||
if (lastSessionMessages.length > 0) {
|
|
||||||
// Add messages with sessionId annotation
|
|
||||||
for (const msg of lastSessionMessages) {
|
|
||||||
displayMessages.push({
|
|
||||||
...msg as AIMessage,
|
|
||||||
sessionId: lastSessionName,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
messages.push(...lastSessionMessages as AIMessage[]);
|
|
||||||
sessionName = lastSessionName;
|
|
||||||
loadedSessionCount = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load last finish reason
|
// Load last finish reason
|
||||||
@@ -164,33 +131,21 @@ export class SessionManager {
|
|||||||
customTools,
|
customTools,
|
||||||
maxSteps,
|
maxSteps,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
isLoadingMoreHistory: false,
|
|
||||||
lastActivity: new Date(),
|
lastActivity: new Date(),
|
||||||
totalCost: 0,
|
totalCost: 0,
|
||||||
lastInputTokens: 0,
|
lastInputTokens: 0,
|
||||||
lastFinishReason,
|
lastFinishReason,
|
||||||
...this.sessions.get(projectId),
|
...this.sessions.get(projectId),
|
||||||
messages,
|
messages,
|
||||||
displayMessages,
|
|
||||||
availableSessionNames,
|
|
||||||
loadedSessionCount,
|
|
||||||
sessionName,
|
sessionName,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update session configuration
|
// Update session configuration
|
||||||
session.projectId = projectId;
|
session.projectId = projectId;
|
||||||
session.tools = tools;
|
session.tools = tools;
|
||||||
|
|
||||||
session.customTools = customTools;
|
session.customTools = customTools;
|
||||||
session.maxSteps = maxSteps;
|
session.maxSteps = maxSteps;
|
||||||
|
|
||||||
// Update messages from loaded history if not already set by an existing session
|
|
||||||
if (!this.sessions.has(projectId)) {
|
|
||||||
session.messages = messages;
|
|
||||||
session.displayMessages = displayMessages;
|
|
||||||
session.availableSessionNames = availableSessionNames;
|
|
||||||
session.loadedSessionCount = loadedSessionCount;
|
|
||||||
session.sessionName = sessionName;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sessions.set(projectId, session);
|
this.sessions.set(projectId, session);
|
||||||
|
|
||||||
@@ -232,69 +187,11 @@ export class SessionManager {
|
|||||||
const session = this.sessions.get(projectId);
|
const session = this.sessions.get(projectId);
|
||||||
if (!session) return;
|
if (!session) return;
|
||||||
|
|
||||||
// Add to current session messages (for AI prompts)
|
|
||||||
session.messages.push(message);
|
session.messages.push(message);
|
||||||
|
|
||||||
// Also add to display messages with session ID annotation (for UI)
|
|
||||||
const displayMessage: DisplayMessage = { ...message, sessionId: session.sessionName };
|
|
||||||
session.displayMessages.push(displayMessage);
|
|
||||||
|
|
||||||
session.lastActivity = new Date();
|
session.lastActivity = new Date();
|
||||||
|
|
||||||
await this.saveSessionHistory(projectId);
|
await this.saveSessionHistory(projectId);
|
||||||
this.emit('messageAdded', projectId, message);
|
this.emit('messageAdded', projectId, message);
|
||||||
this.emit('displayMessageAdded', projectId, displayMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if there are more historical sessions to load
|
|
||||||
*/
|
|
||||||
hasMoreHistory(projectId: string): boolean {
|
|
||||||
const session = this.sessions.get(projectId);
|
|
||||||
if (!session) return false;
|
|
||||||
return session.loadedSessionCount < session.availableSessionNames.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load the next older session and prepend to displayMessages
|
|
||||||
*/
|
|
||||||
async loadOlderSession(projectId: string): Promise<void> {
|
|
||||||
const session = this.sessions.get(projectId);
|
|
||||||
if (!session || !this.hasMoreHistory(projectId) || session.isLoadingMoreHistory) return;
|
|
||||||
|
|
||||||
session.isLoadingMoreHistory = true;
|
|
||||||
this.emit('loadingMoreHistoryChanged', projectId, true);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const config = this.getConfig();
|
|
||||||
const dotAI = new DotAI(this.fs, `${config.fsPathProjects}/${projectId}`);
|
|
||||||
|
|
||||||
// Get the next older session (counting from the end)
|
|
||||||
const nextIndex = session.availableSessionNames.length - session.loadedSessionCount - 1;
|
|
||||||
if (nextIndex < 0) return;
|
|
||||||
|
|
||||||
const olderSessionName = session.availableSessionNames[nextIndex];
|
|
||||||
const olderMessages = await dotAI.readSessionHistory(olderSessionName);
|
|
||||||
|
|
||||||
if (olderMessages.length > 0) {
|
|
||||||
// Create display messages with sessionId
|
|
||||||
const newDisplayMessages: DisplayMessage[] = olderMessages.map(msg => ({
|
|
||||||
...msg as AIMessage,
|
|
||||||
sessionId: olderSessionName,
|
|
||||||
}));
|
|
||||||
|
|
||||||
// Prepend to displayMessages
|
|
||||||
session.displayMessages = [...newDisplayMessages, ...session.displayMessages];
|
|
||||||
session.loadedSessionCount++;
|
|
||||||
|
|
||||||
this.emit('displayMessagesPrepended', projectId, newDisplayMessages);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.warn('Failed to load older session:', error);
|
|
||||||
} finally {
|
|
||||||
session.isLoadingMoreHistory = false;
|
|
||||||
this.emit('loadingMoreHistoryChanged', projectId, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -802,7 +699,7 @@ export class SessionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a new session (clear AI messages but keep display history)
|
* Start a new session (clear messages but keep configuration)
|
||||||
*/
|
*/
|
||||||
async startNewSession(projectId: string): Promise<void> {
|
async startNewSession(projectId: string): Promise<void> {
|
||||||
const session = this.sessions.get(projectId);
|
const session = this.sessions.get(projectId);
|
||||||
@@ -810,13 +707,9 @@ export class SessionManager {
|
|||||||
|
|
||||||
this.stopGeneration(projectId);
|
this.stopGeneration(projectId);
|
||||||
|
|
||||||
// Generate new session name - new messages will automatically get this sessionId
|
|
||||||
const newSessionName = DotAI.generateSessionName();
|
|
||||||
|
|
||||||
// Clear only the AI prompt messages (not display messages)
|
|
||||||
session.messages = [];
|
session.messages = [];
|
||||||
session.streamingMessage = undefined;
|
session.streamingMessage = undefined;
|
||||||
session.sessionName = newSessionName;
|
session.sessionName = DotAI.generateSessionName();
|
||||||
session.lastActivity = new Date();
|
session.lastActivity = new Date();
|
||||||
session.totalCost = 0;
|
session.totalCost = 0;
|
||||||
session.lastInputTokens = 0;
|
session.lastInputTokens = 0;
|
||||||
|
|||||||
+2
-1
@@ -1107,7 +1107,8 @@ class GitHttp implements HttpClient {
|
|||||||
|
|
||||||
constructor(proxy?: string, fetch?: typeof globalThis.fetch) {
|
constructor(proxy?: string, fetch?: typeof globalThis.fetch) {
|
||||||
this.proxy = proxy;
|
this.proxy = proxy;
|
||||||
this.fetch = fetch ?? globalThis.fetch;
|
// Bind fetch to globalThis to preserve context when called as this.fetch()
|
||||||
|
this.fetch = fetch ?? globalThis.fetch.bind(globalThis);
|
||||||
}
|
}
|
||||||
|
|
||||||
async request(request: GitHttpRequest): Promise<GitHttpResponse> {
|
async request(request: GitHttpRequest): Promise<GitHttpResponse> {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Bot, GitBranch, Database, Wifi, Settings2, Info, Settings, Rocket } from 'lucide-react';
|
import { Bot, GitBranch, Database, Wifi, Settings2, Info, Settings, Rocket, Wallet } from 'lucide-react';
|
||||||
|
|
||||||
export interface SettingsItem {
|
export interface SettingsItem {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -59,6 +59,12 @@ export const getSettingsCategories = (t: (key: string) => string): SettingsCateg
|
|||||||
title: t('nostrSettings'),
|
title: t('nostrSettings'),
|
||||||
href: '/settings/nostr',
|
href: '/settings/nostr',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'wallet',
|
||||||
|
icon: Wallet,
|
||||||
|
title: t('walletSettings'),
|
||||||
|
href: '/settings/wallet',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
+31
-2
@@ -9,8 +9,6 @@
|
|||||||
"anonymous": "Anonymous",
|
"anonymous": "Anonymous",
|
||||||
"logIn": "Log in",
|
"logIn": "Log in",
|
||||||
"signUp": "Sign up",
|
"signUp": "Sign up",
|
||||||
"newChat": "New Chat",
|
|
||||||
"loadOlderMessages": "Load older messages",
|
|
||||||
"preferencesDescription": "Manage your general application preferences and appearance settings.",
|
"preferencesDescription": "Manage your general application preferences and appearance settings.",
|
||||||
"theme": "Theme",
|
"theme": "Theme",
|
||||||
"themeDescription": "Choose between light, dark, or system theme preference.",
|
"themeDescription": "Choose between light, dark, or system theme preference.",
|
||||||
@@ -108,12 +106,43 @@
|
|||||||
"deploySettingsDescription": "Configure deployment providers",
|
"deploySettingsDescription": "Configure deployment providers",
|
||||||
"nostrSettings": "Nostr",
|
"nostrSettings": "Nostr",
|
||||||
"nostrSettingsDescription": "Configure relay connections and Nostr preferences",
|
"nostrSettingsDescription": "Configure relay connections and Nostr preferences",
|
||||||
|
"walletSettings": "Wallet",
|
||||||
|
"walletSettingsDescription": "Connect Lightning wallets for zaps",
|
||||||
|
"currentStatus": "Current Status",
|
||||||
|
"browserExtension": "Browser extension",
|
||||||
|
"ready": "Ready",
|
||||||
|
"notFound": "Not Found",
|
||||||
|
"nostrWalletConnect": "Nostr Wallet Connect",
|
||||||
|
"walletsConnected": "{{count}} wallet(s) connected",
|
||||||
|
"remoteWalletConnection": "Remote wallet connection",
|
||||||
|
"none": "None",
|
||||||
|
"noWalletsConnected": "No wallets connected",
|
||||||
|
"addNwcWalletToGetStarted": "Add an NWC wallet to get started",
|
||||||
|
"lightningWallet": "Lightning Wallet",
|
||||||
|
"nwcConnection": "NWC Connection",
|
||||||
|
"setAsActive": "Set as active",
|
||||||
|
"activeWalletChanged": "Active wallet changed",
|
||||||
|
"selectedWalletNowActive": "The selected wallet is now active for zaps.",
|
||||||
|
"installWeblnOrConnectNwc": "Install a WebLN extension or connect an NWC wallet to send zaps.",
|
||||||
|
"connectNwcWallet": "Connect NWC Wallet",
|
||||||
|
"enterConnectionStringFromWallet": "Enter your connection string from a compatible wallet.",
|
||||||
|
"walletNameOptional": "Wallet Name (optional)",
|
||||||
|
"myLightningWallet": "My Lightning Wallet",
|
||||||
|
"connectionUri": "Connection URI",
|
||||||
|
"connecting": "Connecting...",
|
||||||
|
"connect": "Connect",
|
||||||
|
"connectionUriRequired": "Connection URI required",
|
||||||
|
"pleaseEnterValidNwcUri": "Please enter a valid NWC connection URI.",
|
||||||
"storageSettings": "Storage",
|
"storageSettings": "Storage",
|
||||||
"storageSettingsDescription": "Export files and manage local data",
|
"storageSettingsDescription": "Export files and manage local data",
|
||||||
"emailUpdates": "Email Updates",
|
"emailUpdates": "Email Updates",
|
||||||
"emailUpdatesDescription": "Subscribe to Shakespeare updates and resources",
|
"emailUpdatesDescription": "Subscribe to Shakespeare updates and resources",
|
||||||
"newProject": "New Project",
|
"newProject": "New Project",
|
||||||
"importRepository": "Import Repository",
|
"importRepository": "Import Repository",
|
||||||
|
"explore": "Explore",
|
||||||
|
"exploreApps": "Explore Apps",
|
||||||
|
"exploreRepositories": "Explore repositories from the Nostr network",
|
||||||
|
"pleaseLogInToExplore": "Please log in to explore repositories",
|
||||||
"noProjectsYet": "No projects yet",
|
"noProjectsYet": "No projects yet",
|
||||||
"createFirstProject": "Create your first project to get started",
|
"createFirstProject": "Create your first project to get started",
|
||||||
"searchProjects": "Search projects...",
|
"searchProjects": "Search projects...",
|
||||||
|
|||||||
+31
-2
@@ -9,8 +9,6 @@
|
|||||||
"anonymous": "Maras Suna",
|
"anonymous": "Maras Suna",
|
||||||
"logIn": "Shiga",
|
"logIn": "Shiga",
|
||||||
"signUp": "Yi Rajista",
|
"signUp": "Yi Rajista",
|
||||||
"newChat": "Sabon Tattaunawa",
|
|
||||||
"loadOlderMessages": "Loda saƙonni masu tsufa",
|
|
||||||
"preferencesDescription": "Sarrafa zaɓuɓɓukan aikace-aikacenku da saitunan bayyanar.",
|
"preferencesDescription": "Sarrafa zaɓuɓɓukan aikace-aikacenku da saitunan bayyanar.",
|
||||||
"theme": "Jigogi",
|
"theme": "Jigogi",
|
||||||
"themeDescription": "Zaɓi tsakanin haske, duhu, ko zaɓin jigogi na tsarin.",
|
"themeDescription": "Zaɓi tsakanin haske, duhu, ko zaɓin jigogi na tsarin.",
|
||||||
@@ -106,6 +104,33 @@
|
|||||||
"nostrSettingsDescription": "Saita haɗin relay da zaɓuɓɓukan Nostr",
|
"nostrSettingsDescription": "Saita haɗin relay da zaɓuɓɓukan Nostr",
|
||||||
"storageSettings": "Ajiya",
|
"storageSettings": "Ajiya",
|
||||||
"storageSettingsDescription": "Fitar da fayiloli da sarrafa bayanan gida",
|
"storageSettingsDescription": "Fitar da fayiloli da sarrafa bayanan gida",
|
||||||
|
"walletSettings": "Walat",
|
||||||
|
"walletSettingsDescription": "Haɗa walat na Lightning don zaps",
|
||||||
|
"currentStatus": "Matsayin Yanzu",
|
||||||
|
"browserExtension": "Ƙari na bincike",
|
||||||
|
"ready": "Shirye",
|
||||||
|
"notFound": "Ba a Samu ba",
|
||||||
|
"nostrWalletConnect": "Nostr Wallet Connect",
|
||||||
|
"walletsConnected": "{{count}} walat da aka haɗa",
|
||||||
|
"remoteWalletConnection": "Haɗin walat na nesa",
|
||||||
|
"none": "Babu",
|
||||||
|
"noWalletsConnected": "Babu walat da aka haɗa",
|
||||||
|
"addNwcWalletToGetStarted": "Ƙara walat NWC don farawa",
|
||||||
|
"lightningWallet": "Walat na Lightning",
|
||||||
|
"nwcConnection": "Haɗin NWC",
|
||||||
|
"setAsActive": "Saita a matsayin mai aiki",
|
||||||
|
"activeWalletChanged": "Walat mai aiki ya canza",
|
||||||
|
"selectedWalletNowActive": "Walat da aka zaɓa yanzu yana aiki don zaps.",
|
||||||
|
"installWeblnOrConnectNwc": "Shigar da ƙarin WebLN ko haɗa walat NWC don aika zaps.",
|
||||||
|
"connectNwcWallet": "Haɗa Walat NWC",
|
||||||
|
"enterConnectionStringFromWallet": "Shigar da igiyar haɗin ku daga walat mai dacewa.",
|
||||||
|
"walletNameOptional": "Sunan Walat (na zaɓi)",
|
||||||
|
"myLightningWallet": "Walat na Lightning Na",
|
||||||
|
"connectionUri": "URI Haɗi",
|
||||||
|
"connecting": "Ana haɗawa...",
|
||||||
|
"connect": "Haɗa",
|
||||||
|
"connectionUriRequired": "URI haɗi yana buƙata",
|
||||||
|
"pleaseEnterValidNwcUri": "Da fatan za a shigar da URI haɗin NWC mai inganci.",
|
||||||
"emailUpdates": "Sabuntawar Imel",
|
"emailUpdates": "Sabuntawar Imel",
|
||||||
"emailUpdatesDescription": "Yi rajista don karbar sabuntawar Shakespeare da albarkatu",
|
"emailUpdatesDescription": "Yi rajista don karbar sabuntawar Shakespeare da albarkatu",
|
||||||
"newProject": "Sabon Aikin",
|
"newProject": "Sabon Aikin",
|
||||||
@@ -142,6 +167,10 @@
|
|||||||
"unsavedChanges": "Canje-canjen da ba a ajiye ba",
|
"unsavedChanges": "Canje-canjen da ba a ajiye ba",
|
||||||
"saving": "Ana ajiyewa...",
|
"saving": "Ana ajiyewa...",
|
||||||
"languageLabel": "Harshe",
|
"languageLabel": "Harshe",
|
||||||
|
"explore": "Bincika",
|
||||||
|
"exploreApps": "Bincika Ayyuka",
|
||||||
|
"exploreRepositories": "Bincika ma'ajiyar bayanai daga hanyar sadarwa ta Nostr",
|
||||||
|
"pleaseLogInToExplore": "Da fatan za a shiga don bincika ma'ajiyar bayanai",
|
||||||
"searchFiles": "Neman fayiloli...",
|
"searchFiles": "Neman fayiloli...",
|
||||||
"noFilesFound": "Babu fayilolin da aka samu",
|
"noFilesFound": "Babu fayilolin da aka samu",
|
||||||
"noFilesFoundSearch": "Babu fayilolin da suka dace da bincikenku",
|
"noFilesFoundSearch": "Babu fayilolin da suka dace da bincikenku",
|
||||||
|
|||||||
+31
-2
@@ -9,8 +9,6 @@
|
|||||||
"anonymous": "Onye na-amaghị aha",
|
"anonymous": "Onye na-amaghị aha",
|
||||||
"logIn": "Banye",
|
"logIn": "Banye",
|
||||||
"signUp": "Debanye aha",
|
"signUp": "Debanye aha",
|
||||||
"newChat": "Nkata Ọhụrụ",
|
|
||||||
"loadOlderMessages": "Bulite ozi ochie",
|
|
||||||
"preferencesDescription": "Jikwaa nhọrọ ngwa gị na ntọala ngosipụta.",
|
"preferencesDescription": "Jikwaa nhọrọ ngwa gị na ntọala ngosipụta.",
|
||||||
"theme": "Isiokwu",
|
"theme": "Isiokwu",
|
||||||
"themeDescription": "Họrọ n'etiti ìhè, ọchịchịrị, ma ọ bụ nhọrọ isiokwu sistemu.",
|
"themeDescription": "Họrọ n'etiti ìhè, ọchịchịrị, ma ọ bụ nhọrọ isiokwu sistemu.",
|
||||||
@@ -106,6 +104,33 @@
|
|||||||
"nostrSettingsDescription": "Hazie njikọ relay na nhọrọ Nostr",
|
"nostrSettingsDescription": "Hazie njikọ relay na nhọrọ Nostr",
|
||||||
"storageSettings": "Nchekwa",
|
"storageSettings": "Nchekwa",
|
||||||
"storageSettingsDescription": "Bupụta faịlụ na jikwaa data mpaghara",
|
"storageSettingsDescription": "Bupụta faịlụ na jikwaa data mpaghara",
|
||||||
|
"walletSettings": "Obere Akpa",
|
||||||
|
"walletSettingsDescription": "Jikọọ obere akpa Lightning maka zaps",
|
||||||
|
"currentStatus": "Ọnọdụ Ugbu A",
|
||||||
|
"browserExtension": "Mgbatị ihe nchọgharị",
|
||||||
|
"ready": "Njikere",
|
||||||
|
"notFound": "Achọtaghị",
|
||||||
|
"nostrWalletConnect": "Nostr Wallet Connect",
|
||||||
|
"walletsConnected": "{{count}} obere akpa jikọrọ",
|
||||||
|
"remoteWalletConnection": "Njikọ obere akpa dị anya",
|
||||||
|
"none": "Ọ dịghị",
|
||||||
|
"noWalletsConnected": "Enweghị obere akpa jikọrọ",
|
||||||
|
"addNwcWalletToGetStarted": "Tinye obere akpa NWC iji malite",
|
||||||
|
"lightningWallet": "Obere Akpa Lightning",
|
||||||
|
"nwcConnection": "Njikọ NWC",
|
||||||
|
"setAsActive": "Tọọ dị ka ọrụ",
|
||||||
|
"activeWalletChanged": "Obere akpa na-arụ ọrụ agbanweela",
|
||||||
|
"selectedWalletNowActive": "Obere akpa ahọpụtara na-arụ ọrụ ugbu a maka zaps.",
|
||||||
|
"installWeblnOrConnectNwc": "Wụnye mgbatị WebLN ma ọ bụ jikọọ obere akpa NWC iji zipu zaps.",
|
||||||
|
"connectNwcWallet": "Jikọọ Obere Akpa NWC",
|
||||||
|
"enterConnectionStringFromWallet": "Tinye eriri njikọ gị site na obere akpa dakọtara.",
|
||||||
|
"walletNameOptional": "Aha Obere Akpa (nhọrọ)",
|
||||||
|
"myLightningWallet": "Obere Akpa Lightning M",
|
||||||
|
"connectionUri": "URI Njikọ",
|
||||||
|
"connecting": "Na-ejikọ...",
|
||||||
|
"connect": "Jikọọ",
|
||||||
|
"connectionUriRequired": "URI njikọ achọrọ",
|
||||||
|
"pleaseEnterValidNwcUri": "Biko tinye URI njikọ NWC dị mma.",
|
||||||
"emailUpdates": "Nmelite Email",
|
"emailUpdates": "Nmelite Email",
|
||||||
"emailUpdatesDescription": "Debanye aha maka nmelite Shakespeare na akụrụngwa",
|
"emailUpdatesDescription": "Debanye aha maka nmelite Shakespeare na akụrụngwa",
|
||||||
"newProject": "Ọrụ Ọhụrụ",
|
"newProject": "Ọrụ Ọhụrụ",
|
||||||
@@ -142,6 +167,10 @@
|
|||||||
"unsavedChanges": "Mgbanwe ndị na-echekwaghị",
|
"unsavedChanges": "Mgbanwe ndị na-echekwaghị",
|
||||||
"saving": "Na-echekwa...",
|
"saving": "Na-echekwa...",
|
||||||
"languageLabel": "Asụsụ",
|
"languageLabel": "Asụsụ",
|
||||||
|
"explore": "Chọpụta",
|
||||||
|
"exploreApps": "Chọpụta Ngwa",
|
||||||
|
"exploreRepositories": "Chọpụta ebe nchekwa sitere na netwọk Nostr",
|
||||||
|
"pleaseLogInToExplore": "Biko banye iji chọpụta ebe nchekwa",
|
||||||
"searchFiles": "Chọọ faịlụ...",
|
"searchFiles": "Chọọ faịlụ...",
|
||||||
"noFilesFound": "Ahụghị faịlụ ọ bụla",
|
"noFilesFound": "Ahụghị faịlụ ọ bụla",
|
||||||
"noFilesFoundSearch": "Ahụghị faịlụ ọ bụla dabara na nchọgharị gị",
|
"noFilesFoundSearch": "Ahụghị faịlụ ọ bụla dabara na nchọgharị gị",
|
||||||
|
|||||||
+31
-2
@@ -9,8 +9,6 @@
|
|||||||
"anonymous": "Anônimo",
|
"anonymous": "Anônimo",
|
||||||
"logIn": "Entrar",
|
"logIn": "Entrar",
|
||||||
"signUp": "Cadastrar",
|
"signUp": "Cadastrar",
|
||||||
"newChat": "Nova Conversa",
|
|
||||||
"loadOlderMessages": "Carregar mensagens anteriores",
|
|
||||||
"preferencesDescription": "Gerencie suas preferências gerais da aplicação e configurações de aparência.",
|
"preferencesDescription": "Gerencie suas preferências gerais da aplicação e configurações de aparência.",
|
||||||
"theme": "Tema",
|
"theme": "Tema",
|
||||||
"themeDescription": "Escolha entre preferência de tema claro, escuro ou do sistema.",
|
"themeDescription": "Escolha entre preferência de tema claro, escuro ou do sistema.",
|
||||||
@@ -108,6 +106,33 @@
|
|||||||
"nostrSettingsDescription": "Configure conexões de relay e preferências do Nostr",
|
"nostrSettingsDescription": "Configure conexões de relay e preferências do Nostr",
|
||||||
"storageSettings": "Armazenamento",
|
"storageSettings": "Armazenamento",
|
||||||
"storageSettingsDescription": "Exporte arquivos e gerencie dados locais",
|
"storageSettingsDescription": "Exporte arquivos e gerencie dados locais",
|
||||||
|
"walletSettings": "Carteira",
|
||||||
|
"walletSettingsDescription": "Conecte carteiras Lightning para zaps",
|
||||||
|
"currentStatus": "Status Atual",
|
||||||
|
"browserExtension": "Extensão do navegador",
|
||||||
|
"ready": "Pronto",
|
||||||
|
"notFound": "Não Encontrado",
|
||||||
|
"nostrWalletConnect": "Nostr Wallet Connect",
|
||||||
|
"walletsConnected": "{{count}} carteira(s) conectada(s)",
|
||||||
|
"remoteWalletConnection": "Conexão de carteira remota",
|
||||||
|
"none": "Nenhum",
|
||||||
|
"noWalletsConnected": "Nenhuma carteira conectada",
|
||||||
|
"addNwcWalletToGetStarted": "Adicione uma carteira NWC para começar",
|
||||||
|
"lightningWallet": "Carteira Lightning",
|
||||||
|
"nwcConnection": "Conexão NWC",
|
||||||
|
"setAsActive": "Definir como ativa",
|
||||||
|
"activeWalletChanged": "Carteira ativa alterada",
|
||||||
|
"selectedWalletNowActive": "A carteira selecionada está agora ativa para zaps.",
|
||||||
|
"installWeblnOrConnectNwc": "Instale uma extensão WebLN ou conecte uma carteira NWC para enviar zaps.",
|
||||||
|
"connectNwcWallet": "Conectar Carteira NWC",
|
||||||
|
"enterConnectionStringFromWallet": "Digite sua string de conexão de uma carteira compatível.",
|
||||||
|
"walletNameOptional": "Nome da Carteira (opcional)",
|
||||||
|
"myLightningWallet": "Minha Carteira Lightning",
|
||||||
|
"connectionUri": "URI de Conexão",
|
||||||
|
"connecting": "Conectando...",
|
||||||
|
"connect": "Conectar",
|
||||||
|
"connectionUriRequired": "URI de conexão obrigatória",
|
||||||
|
"pleaseEnterValidNwcUri": "Por favor, insira um URI de conexão NWC válido.",
|
||||||
"emailUpdates": "Atualizações por Email",
|
"emailUpdates": "Atualizações por Email",
|
||||||
"emailUpdatesDescription": "Inscreva-se para receber atualizações e recursos do Shakespeare",
|
"emailUpdatesDescription": "Inscreva-se para receber atualizações e recursos do Shakespeare",
|
||||||
"newProject": "Novo Projeto",
|
"newProject": "Novo Projeto",
|
||||||
@@ -144,6 +169,10 @@
|
|||||||
"unsavedChanges": "Alterações não salvas",
|
"unsavedChanges": "Alterações não salvas",
|
||||||
"saving": "Salvando...",
|
"saving": "Salvando...",
|
||||||
"languageLabel": "Linguagem",
|
"languageLabel": "Linguagem",
|
||||||
|
"explore": "Explorar",
|
||||||
|
"exploreApps": "Explorar Aplicativos",
|
||||||
|
"exploreRepositories": "Explorar repositórios da rede Nostr",
|
||||||
|
"pleaseLogInToExplore": "Por favor, faça login para explorar repositórios",
|
||||||
"searchFiles": "Buscar arquivos...",
|
"searchFiles": "Buscar arquivos...",
|
||||||
"noFilesFound": "Nenhum arquivo encontrado",
|
"noFilesFound": "Nenhum arquivo encontrado",
|
||||||
"noFilesFoundSearch": "Nenhum arquivo encontrado correspondente à sua busca",
|
"noFilesFoundSearch": "Nenhum arquivo encontrado correspondente à sua busca",
|
||||||
|
|||||||
+31
-2
@@ -9,8 +9,6 @@
|
|||||||
"anonymous": "Alainidamọ",
|
"anonymous": "Alainidamọ",
|
||||||
"logIn": "Wọle",
|
"logIn": "Wọle",
|
||||||
"signUp": "Forukọsilẹ",
|
"signUp": "Forukọsilẹ",
|
||||||
"newChat": "Ọrọ Tuntun",
|
|
||||||
"loadOlderMessages": "Gbe awọn ifiranṣẹ atijọ",
|
|
||||||
"preferencesDescription": "Ṣakoso awọn ayanfẹ ohun elo rẹ ati awọn eto iwoye.",
|
"preferencesDescription": "Ṣakoso awọn ayanfẹ ohun elo rẹ ati awọn eto iwoye.",
|
||||||
"theme": "Akori",
|
"theme": "Akori",
|
||||||
"themeDescription": "Yan laarin imọlẹ, okunkun, tabi ayanfẹ akori eto.",
|
"themeDescription": "Yan laarin imọlẹ, okunkun, tabi ayanfẹ akori eto.",
|
||||||
@@ -106,6 +104,33 @@
|
|||||||
"nostrSettingsDescription": "Tunto awọn asopọ relay ati awọn ayanfẹ Nostr",
|
"nostrSettingsDescription": "Tunto awọn asopọ relay ati awọn ayanfẹ Nostr",
|
||||||
"storageSettings": "Ibi ipamọ",
|
"storageSettings": "Ibi ipamọ",
|
||||||
"storageSettingsDescription": "Gbe awọn faili jade ati ṣakoso data agbegbe",
|
"storageSettingsDescription": "Gbe awọn faili jade ati ṣakoso data agbegbe",
|
||||||
|
"walletSettings": "Apamọwọ",
|
||||||
|
"walletSettingsDescription": "So awọn apamọwọ Lightning mọ fun zaps",
|
||||||
|
"currentStatus": "Ipo Lọwọlọwọ",
|
||||||
|
"browserExtension": "Afikun awoṣe",
|
||||||
|
"ready": "Ṣetan",
|
||||||
|
"notFound": "Ko Ri",
|
||||||
|
"nostrWalletConnect": "Nostr Wallet Connect",
|
||||||
|
"walletsConnected": "{{count}} apamọwọ ti a sopọ mọ",
|
||||||
|
"remoteWalletConnection": "Asopọ apamọwọ latọna jijin",
|
||||||
|
"none": "Ko si",
|
||||||
|
"noWalletsConnected": "Ko si awọn apamọwọ ti a sopọ mọ",
|
||||||
|
"addNwcWalletToGetStarted": "Fi apamọwọ NWC kun lati bẹrẹ",
|
||||||
|
"lightningWallet": "Apamọwọ Lightning",
|
||||||
|
"nwcConnection": "Asopọ NWC",
|
||||||
|
"setAsActive": "Ṣeto bi ti nṣiṣẹ",
|
||||||
|
"activeWalletChanged": "Apamọwọ ti nṣiṣẹ ti yipada",
|
||||||
|
"selectedWalletNowActive": "Apamọwọ ti a yan ti nṣiṣẹ bayi fun zaps.",
|
||||||
|
"installWeblnOrConnectNwc": "Fi afikun WebLN sori tabi sopọ apamọwọ NWC lati fi zaps ranṣẹ.",
|
||||||
|
"connectNwcWallet": "Sopọ Apamọwọ NWC",
|
||||||
|
"enterConnectionStringFromWallet": "Tẹ okun asopọ rẹ lati apamọwọ ti o baamu.",
|
||||||
|
"walletNameOptional": "Orukọ Apamọwọ (aṣayan)",
|
||||||
|
"myLightningWallet": "Apamọwọ Lightning Mi",
|
||||||
|
"connectionUri": "URI Asopọ",
|
||||||
|
"connecting": "N sopọ mọ...",
|
||||||
|
"connect": "Sopọ mọ",
|
||||||
|
"connectionUriRequired": "URI asopọ nilo",
|
||||||
|
"pleaseEnterValidNwcUri": "Jọwọ tẹ URI asopọ NWC ti o tọ.",
|
||||||
"emailUpdates": "Awọn Imudojuiwọn Imeeli",
|
"emailUpdates": "Awọn Imudojuiwọn Imeeli",
|
||||||
"emailUpdatesDescription": "Forukọsilẹ fun awọn imudojuiwọn Shakespeare ati awọn ohun elo",
|
"emailUpdatesDescription": "Forukọsilẹ fun awọn imudojuiwọn Shakespeare ati awọn ohun elo",
|
||||||
"newProject": "Iṣẹ akanṣe Tuntun",
|
"newProject": "Iṣẹ akanṣe Tuntun",
|
||||||
@@ -142,6 +167,10 @@
|
|||||||
"unsavedChanges": "Awọn iyipada ti a ko fi pamọ",
|
"unsavedChanges": "Awọn iyipada ti a ko fi pamọ",
|
||||||
"saving": "N fi pamọ...",
|
"saving": "N fi pamọ...",
|
||||||
"languageLabel": "Ede",
|
"languageLabel": "Ede",
|
||||||
|
"explore": "Ṣawari",
|
||||||
|
"exploreApps": "Ṣawari Awọn Ohun Elo",
|
||||||
|
"exploreRepositories": "Ṣawari awọn ibi ipamọ lati nẹtiwọki Nostr",
|
||||||
|
"pleaseLogInToExplore": "Jọwọ wọle lati ṣawari awọn ibi ipamọ",
|
||||||
"searchFiles": "Wa awọn faili...",
|
"searchFiles": "Wa awọn faili...",
|
||||||
"noFilesFound": "Ko si awọn faili ti a ri",
|
"noFilesFound": "Ko si awọn faili ti a ri",
|
||||||
"noFilesFoundSearch": "Ko si awọn faili ti o baamu wiwa rẹ",
|
"noFilesFoundSearch": "Ko si awọn faili ti o baamu wiwa rẹ",
|
||||||
|
|||||||
+31
-2
@@ -9,8 +9,6 @@
|
|||||||
"anonymous": "匿名",
|
"anonymous": "匿名",
|
||||||
"logIn": "登录",
|
"logIn": "登录",
|
||||||
"signUp": "注册",
|
"signUp": "注册",
|
||||||
"newChat": "新对话",
|
|
||||||
"loadOlderMessages": "加载更早的消息",
|
|
||||||
"preferencesDescription": "管理您的应用程序偏好设置和外观设置。",
|
"preferencesDescription": "管理您的应用程序偏好设置和外观设置。",
|
||||||
"theme": "主题",
|
"theme": "主题",
|
||||||
"themeDescription": "选择浅色、深色或系统主题偏好。",
|
"themeDescription": "选择浅色、深色或系统主题偏好。",
|
||||||
@@ -108,6 +106,33 @@
|
|||||||
"nostrSettingsDescription": "配置中继连接和Nostr偏好",
|
"nostrSettingsDescription": "配置中继连接和Nostr偏好",
|
||||||
"storageSettings": "存储",
|
"storageSettings": "存储",
|
||||||
"storageSettingsDescription": "导出文件和管理本地数据",
|
"storageSettingsDescription": "导出文件和管理本地数据",
|
||||||
|
"walletSettings": "钱包",
|
||||||
|
"walletSettingsDescription": "连接闪电钱包以进行打赏",
|
||||||
|
"currentStatus": "当前状态",
|
||||||
|
"browserExtension": "浏览器扩展",
|
||||||
|
"ready": "就绪",
|
||||||
|
"notFound": "未找到",
|
||||||
|
"nostrWalletConnect": "Nostr钱包连接",
|
||||||
|
"walletsConnected": "已连接{{count}}个钱包",
|
||||||
|
"remoteWalletConnection": "远程钱包连接",
|
||||||
|
"none": "无",
|
||||||
|
"noWalletsConnected": "未连接钱包",
|
||||||
|
"addNwcWalletToGetStarted": "添加NWC钱包以开始使用",
|
||||||
|
"lightningWallet": "闪电钱包",
|
||||||
|
"nwcConnection": "NWC连接",
|
||||||
|
"setAsActive": "设为活动",
|
||||||
|
"activeWalletChanged": "活动钱包已更改",
|
||||||
|
"selectedWalletNowActive": "所选钱包现在已激活用于打赏。",
|
||||||
|
"installWeblnOrConnectNwc": "安装WebLN扩展或连接NWC钱包以发送打赏。",
|
||||||
|
"connectNwcWallet": "连接NWC钱包",
|
||||||
|
"enterConnectionStringFromWallet": "输入来自兼容钱包的连接字符串。",
|
||||||
|
"walletNameOptional": "钱包名称(可选)",
|
||||||
|
"myLightningWallet": "我的闪电钱包",
|
||||||
|
"connectionUri": "连接URI",
|
||||||
|
"connecting": "连接中...",
|
||||||
|
"connect": "连接",
|
||||||
|
"connectionUriRequired": "需要连接URI",
|
||||||
|
"pleaseEnterValidNwcUri": "请输入有效的NWC连接URI。",
|
||||||
"emailUpdates": "邮件更新",
|
"emailUpdates": "邮件更新",
|
||||||
"emailUpdatesDescription": "订阅Shakespeare更新和资源",
|
"emailUpdatesDescription": "订阅Shakespeare更新和资源",
|
||||||
"newProject": "新项目",
|
"newProject": "新项目",
|
||||||
@@ -144,6 +169,10 @@
|
|||||||
"unsavedChanges": "未保存的更改",
|
"unsavedChanges": "未保存的更改",
|
||||||
"saving": "保存中...",
|
"saving": "保存中...",
|
||||||
"languageLabel": "语言",
|
"languageLabel": "语言",
|
||||||
|
"explore": "探索",
|
||||||
|
"exploreApps": "探索应用",
|
||||||
|
"exploreRepositories": "探索Nostr网络中的仓库",
|
||||||
|
"pleaseLogInToExplore": "请登录以探索仓库",
|
||||||
"searchFiles": "搜索文件...",
|
"searchFiles": "搜索文件...",
|
||||||
"noFilesFound": "未找到文件",
|
"noFilesFound": "未找到文件",
|
||||||
"noFilesFoundSearch": "未找到与您搜索匹配的文件",
|
"noFilesFoundSearch": "未找到与您搜索匹配的文件",
|
||||||
|
|||||||
+75
-359
@@ -1,32 +1,19 @@
|
|||||||
import { useState, useEffect, useCallback, useRef, useMemo } from 'react';
|
import { useState, useEffect, useCallback, useRef } from 'react';
|
||||||
import { useNavigate, useSearchParams } from 'react-router-dom';
|
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { AppLayout } from '@/components/AppLayout';
|
import { AppLayout } from '@/components/AppLayout';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { GitBranch, Loader2, AlertCircle, FileArchive, MoreHorizontal, Search } from 'lucide-react';
|
import { GitBranch, Loader2, AlertCircle, FileArchive, MoreHorizontal } from 'lucide-react';
|
||||||
import { useProjectsManager } from '@/hooks/useProjectsManager';
|
import { useProjectsManager } from '@/hooks/useProjectsManager';
|
||||||
import { useToast } from '@/hooks/useToast';
|
import { useToast } from '@/hooks/useToast';
|
||||||
import { ZipImportDialog } from '@/components/ZipImportDialog';
|
import { ZipImportDialog } from '@/components/ZipImportDialog';
|
||||||
import { useSeoMeta } from '@unhead/react';
|
import { useSeoMeta } from '@unhead/react';
|
||||||
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@/components/ui/dropdown-menu';
|
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@/components/ui/dropdown-menu';
|
||||||
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||||
import { useUserRepositories } from '@/hooks/useUserRepositories';
|
|
||||||
import { useContacts } from '@/hooks/useContacts';
|
|
||||||
import { useFollowedRepositories } from '@/hooks/useFollowedRepositories';
|
|
||||||
import { RepositoryCard } from '@/components/RepositoryCard';
|
|
||||||
import { Skeleton } from '@/components/ui/skeleton';
|
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
|
||||||
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
|
|
||||||
import type { Repository } from '@/hooks/useUserRepositories';
|
|
||||||
import { useNostr } from '@nostrify/react';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { nip19 } from 'nostr-tools';
|
|
||||||
import { NSchema as n } from '@nostrify/nostrify';
|
|
||||||
import type { NostrMetadata } from '@nostrify/nostrify';
|
|
||||||
import { NostrURI } from '@/lib/NostrURI';
|
|
||||||
import { useGitSettings } from '@/hooks/useGitSettings';
|
import { useGitSettings } from '@/hooks/useGitSettings';
|
||||||
import { detectFork } from '@/lib/detectFork';
|
import { detectFork } from '@/lib/detectFork';
|
||||||
|
import { NostrURI } from '@/lib/NostrURI';
|
||||||
|
|
||||||
export default function Clone() {
|
export default function Clone() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -41,46 +28,6 @@ export default function Clone() {
|
|||||||
const [isZipDialogOpen, setIsZipDialogOpen] = useState(false);
|
const [isZipDialogOpen, setIsZipDialogOpen] = useState(false);
|
||||||
const { user } = useCurrentUser();
|
const { user } = useCurrentUser();
|
||||||
const { settings: gitSettings } = useGitSettings();
|
const { settings: gitSettings } = useGitSettings();
|
||||||
const { data: repositories = [], isLoading: isLoadingRepos } = useUserRepositories(user?.pubkey);
|
|
||||||
const { data: contacts = [] } = useContacts(user?.pubkey);
|
|
||||||
const { data: followedRepositories = [], isLoading: isLoadingFollowedRepos } = useFollowedRepositories(contacts);
|
|
||||||
const [activeTab, setActiveTab] = useState<'my-projects' | 'follows'>('my-projects');
|
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
|
||||||
|
|
||||||
// Get unique pubkeys from all repositories
|
|
||||||
const allRepos = useMemo(() => [...repositories, ...followedRepositories], [repositories, followedRepositories]);
|
|
||||||
const uniquePubkeys = useMemo(() => {
|
|
||||||
const pubkeys = new Set<string>();
|
|
||||||
allRepos.forEach(repo => pubkeys.add(repo.pubkey));
|
|
||||||
return Array.from(pubkeys);
|
|
||||||
}, [allRepos]);
|
|
||||||
|
|
||||||
// Fetch author metadata for all unique pubkeys
|
|
||||||
const { nostr } = useNostr();
|
|
||||||
const { data: authorMetadataMap = new Map<string, NostrMetadata>() } = useQuery({
|
|
||||||
queryKey: ['repository-authors', uniquePubkeys.sort().join(',')],
|
|
||||||
queryFn: async () => {
|
|
||||||
if (uniquePubkeys.length === 0) return new Map<string, NostrMetadata>();
|
|
||||||
|
|
||||||
const events = await nostr.query(
|
|
||||||
[{ kinds: [0], authors: uniquePubkeys, limit: uniquePubkeys.length }],
|
|
||||||
{ signal: AbortSignal.timeout(3000) }
|
|
||||||
);
|
|
||||||
|
|
||||||
const metadataMap = new Map<string, NostrMetadata>();
|
|
||||||
for (const event of events) {
|
|
||||||
try {
|
|
||||||
const metadata = n.json().pipe(n.metadata()).parse(event.content);
|
|
||||||
metadataMap.set(event.pubkey, metadata);
|
|
||||||
} catch {
|
|
||||||
// If parsing fails, continue without metadata for this pubkey
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return metadataMap;
|
|
||||||
},
|
|
||||||
enabled: uniquePubkeys.length > 0,
|
|
||||||
staleTime: 60000, // 1 minute
|
|
||||||
});
|
|
||||||
|
|
||||||
useSeoMeta({
|
useSeoMeta({
|
||||||
title: `${t('importRepository')} - Shakespeare`,
|
title: `${t('importRepository')} - Shakespeare`,
|
||||||
@@ -256,140 +203,83 @@ export default function Clone() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Filter repositories based on search query
|
|
||||||
const filterRepositories = useCallback((repos: Repository[], query: string): Repository[] => {
|
|
||||||
if (!query.trim()) {
|
|
||||||
return repos;
|
|
||||||
}
|
|
||||||
|
|
||||||
const lowerQuery = query.toLowerCase();
|
|
||||||
|
|
||||||
return repos.filter((repo) => {
|
|
||||||
// Filter by repository name
|
|
||||||
if (repo.name.toLowerCase().includes(lowerQuery)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by description
|
|
||||||
if (repo.description?.toLowerCase().includes(lowerQuery)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by tags (hashtags)
|
|
||||||
if (repo.repoTags.some(tag => tag.toLowerCase().includes(lowerQuery))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by hex pubkey
|
|
||||||
if (repo.pubkey.toLowerCase().includes(lowerQuery)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by npub (bech32 encoded pubkey)
|
|
||||||
try {
|
|
||||||
const npub = nip19.npubEncode(repo.pubkey);
|
|
||||||
if (npub.toLowerCase().includes(lowerQuery)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
// If encoding fails, skip npub search
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by author name
|
|
||||||
const authorMetadata = authorMetadataMap.get(repo.pubkey);
|
|
||||||
if (authorMetadata?.name?.toLowerCase().includes(lowerQuery)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}, [authorMetadataMap]);
|
|
||||||
|
|
||||||
// Filtered repositories for "My Projects" tab
|
|
||||||
const filteredMyRepositories = useMemo(() => {
|
|
||||||
return filterRepositories(repositories, searchQuery);
|
|
||||||
}, [repositories, searchQuery, filterRepositories]);
|
|
||||||
|
|
||||||
// Filtered repositories for "Follows" tab
|
|
||||||
const filteredFollowedRepositories = useMemo(() => {
|
|
||||||
return filterRepositories(followedRepositories, searchQuery);
|
|
||||||
}, [followedRepositories, searchQuery, filterRepositories]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppLayout title={t('importRepository')}>
|
<AppLayout title={t('importRepository')}>
|
||||||
<div className="max-w-2xl mx-auto">
|
<div className="min-h-[calc(100vh-12rem)] flex items-center justify-center">
|
||||||
<div className="text-center mb-8">
|
<div className="max-w-2xl mx-auto w-full">
|
||||||
<div className="text-4xl mb-4">
|
<div className="text-center mb-8">
|
||||||
<GitBranch className="h-12 w-12 mx-auto text-primary" />
|
<div className="text-4xl mb-4">
|
||||||
</div>
|
<GitBranch className="h-12 w-12 mx-auto text-primary" />
|
||||||
<h1 className="text-3xl font-bold mb-3 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
|
||||||
{t('importRepository')}
|
|
||||||
</h1>
|
|
||||||
<p className="text-lg text-muted-foreground">
|
|
||||||
{t('cloneGitRepository')}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-2">
|
|
||||||
<Input
|
|
||||||
id="repo-url"
|
|
||||||
type="text"
|
|
||||||
placeholder="https://github.com/username/repository.git"
|
|
||||||
value={repoUrl}
|
|
||||||
onChange={(e) => {
|
|
||||||
setRepoUrl(e.target.value);
|
|
||||||
setError(null); // Clear error when user types
|
|
||||||
}}
|
|
||||||
onKeyDown={handleKeyDown}
|
|
||||||
disabled={isCloning}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{error && (
|
|
||||||
<div className="flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-md">
|
|
||||||
<AlertCircle className="h-4 w-4 text-destructive flex-shrink-0" />
|
|
||||||
<p className="text-sm text-destructive">{error}</p>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
<h1 className="text-3xl font-bold mb-3 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
||||||
|
{t('importRepository')}
|
||||||
|
</h1>
|
||||||
|
<p className="text-lg text-muted-foreground">
|
||||||
|
{t('cloneGitRepository')}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Button
|
<div className="space-y-2">
|
||||||
onClick={() => handleClone()}
|
<Input
|
||||||
disabled={!repoUrl.trim() || isCloning}
|
id="repo-url"
|
||||||
className="w-full focus-ring bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg"
|
type="text"
|
||||||
size="lg"
|
placeholder="https://github.com/username/repository.git"
|
||||||
>
|
value={repoUrl}
|
||||||
{isCloning ? (
|
onChange={(e) => {
|
||||||
<>
|
setRepoUrl(e.target.value);
|
||||||
<Loader2 className="h-4 w-4 mr-2 animate-spin" />
|
setError(null); // Clear error when user types
|
||||||
{t('cloningRepository')}
|
}}
|
||||||
</>
|
onKeyDown={handleKeyDown}
|
||||||
) : (
|
disabled={isCloning}
|
||||||
<>
|
/>
|
||||||
<GitBranch className="mr-2 h-4 w-4" />
|
|
||||||
{t('importRepository')}
|
{error && (
|
||||||
</>
|
<div className="flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-md">
|
||||||
|
<AlertCircle className="h-4 w-4 text-destructive flex-shrink-0" />
|
||||||
|
<p className="text-sm text-destructive">{error}</p>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Import ZIP File Link */}
|
<Button
|
||||||
<div className="mt-8 text-center">
|
onClick={() => handleClone()}
|
||||||
<DropdownMenu>
|
disabled={!repoUrl.trim() || isCloning}
|
||||||
<DropdownMenuTrigger asChild>
|
className="w-full focus-ring bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg"
|
||||||
<Button variant="ghost" size="icon" className="text-muted-foreground hover:text-primary hover:bg-transparent">
|
size="lg"
|
||||||
<MoreHorizontal className="h-5 w-5" />
|
>
|
||||||
<span className="sr-only">More options</span>
|
{isCloning ? (
|
||||||
</Button>
|
<>
|
||||||
</DropdownMenuTrigger>
|
<Loader2 className="h-4 w-4 mr-2 animate-spin" />
|
||||||
<DropdownMenuContent align="center">
|
{t('cloningRepository')}
|
||||||
<DropdownMenuItem
|
</>
|
||||||
className="flex items-center gap-2 w-full"
|
) : (
|
||||||
onClick={() => setIsZipDialogOpen(true)}
|
<>
|
||||||
>
|
<GitBranch className="mr-2 h-4 w-4" />
|
||||||
<FileArchive className="h-4 w-4" />
|
{t('importRepository')}
|
||||||
Import ZIP File
|
</>
|
||||||
</DropdownMenuItem>
|
)}
|
||||||
</DropdownMenuContent>
|
</Button>
|
||||||
</DropdownMenu>
|
</div>
|
||||||
|
|
||||||
|
{/* Import ZIP File Link */}
|
||||||
|
<div className="mt-8 text-center">
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button variant="ghost" size="icon" className="text-muted-foreground hover:text-primary hover:bg-transparent">
|
||||||
|
<MoreHorizontal className="h-5 w-5" />
|
||||||
|
<span className="sr-only">More options</span>
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent align="center">
|
||||||
|
<DropdownMenuItem
|
||||||
|
className="flex items-center gap-2 w-full"
|
||||||
|
onClick={() => setIsZipDialogOpen(true)}
|
||||||
|
>
|
||||||
|
<FileArchive className="h-4 w-4" />
|
||||||
|
Import ZIP File
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -399,180 +289,6 @@ export default function Clone() {
|
|||||||
open={isZipDialogOpen}
|
open={isZipDialogOpen}
|
||||||
onOpenChange={setIsZipDialogOpen}
|
onOpenChange={setIsZipDialogOpen}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* NIP-34 Repositories with Tabs */}
|
|
||||||
{user && (
|
|
||||||
<div className="mt-16 max-w-7xl mx-auto">
|
|
||||||
<Tabs value={activeTab} onValueChange={(value) => setActiveTab(value as 'my-projects' | 'follows')}>
|
|
||||||
<div className="flex items-center gap-4 mb-6 flex-wrap">
|
|
||||||
<TabsList>
|
|
||||||
<TabsTrigger value="my-projects">
|
|
||||||
My Projects
|
|
||||||
</TabsTrigger>
|
|
||||||
<TabsTrigger value="follows">
|
|
||||||
Follows
|
|
||||||
</TabsTrigger>
|
|
||||||
</TabsList>
|
|
||||||
|
|
||||||
{/* Search Input */}
|
|
||||||
{(repositories.length > 0 || followedRepositories.length > 0) && (
|
|
||||||
<div className="relative flex-1 min-w-[200px] max-w-md">
|
|
||||||
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none" />
|
|
||||||
<Input
|
|
||||||
type="text"
|
|
||||||
placeholder="Search repositories..."
|
|
||||||
value={searchQuery}
|
|
||||||
onChange={(e) => setSearchQuery(e.target.value)}
|
|
||||||
className="pl-9 h-10 text-sm"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<TabsContent value="my-projects">
|
|
||||||
{isLoadingRepos ? (
|
|
||||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
||||||
{Array.from({ length: 3 }).map((_, i) => (
|
|
||||||
<Card key={i} className="h-full flex flex-col">
|
|
||||||
<CardContent className="p-6 flex flex-col flex-1">
|
|
||||||
<div className="flex items-start gap-3 mb-4">
|
|
||||||
<Skeleton className="w-12 h-12 rounded-lg" />
|
|
||||||
<div className="flex-1 space-y-2">
|
|
||||||
<Skeleton className="h-5 w-32" />
|
|
||||||
<Skeleton className="h-4 w-24" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="space-y-2 mb-4">
|
|
||||||
<Skeleton className="h-4 w-full" />
|
|
||||||
<Skeleton className="h-4 w-4/5" />
|
|
||||||
</div>
|
|
||||||
<div className="flex gap-1 mb-4">
|
|
||||||
<Skeleton className="h-5 w-16" />
|
|
||||||
<Skeleton className="h-5 w-20" />
|
|
||||||
</div>
|
|
||||||
<div className="mt-auto flex gap-2">
|
|
||||||
<Skeleton className="h-9 flex-1" />
|
|
||||||
<Skeleton className="h-9 w-9" />
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : filteredMyRepositories.length > 0 ? (
|
|
||||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
||||||
{filteredMyRepositories.map((repo) => (
|
|
||||||
<RepositoryCard key={repo.id} repo={repo} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : searchQuery.trim() ? (
|
|
||||||
<Card className="border-dashed">
|
|
||||||
<CardContent className="py-12 px-8 text-center">
|
|
||||||
<div className="max-w-sm mx-auto space-y-4">
|
|
||||||
<Search className="h-8 w-8 mx-auto mb-2 opacity-50 text-muted-foreground" />
|
|
||||||
<p className="text-muted-foreground">
|
|
||||||
No repositories found matching "{searchQuery}".
|
|
||||||
</p>
|
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setSearchQuery('')}
|
|
||||||
>
|
|
||||||
Clear search
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
) : (
|
|
||||||
<Card className="border-dashed">
|
|
||||||
<CardContent className="py-12 px-8 text-center">
|
|
||||||
<div className="max-w-sm mx-auto space-y-4">
|
|
||||||
<p className="text-muted-foreground">
|
|
||||||
No repositories found. Publish your first repository to Nostr to see it here.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
)}
|
|
||||||
</TabsContent>
|
|
||||||
|
|
||||||
<TabsContent value="follows">
|
|
||||||
{isLoadingFollowedRepos ? (
|
|
||||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
||||||
{Array.from({ length: 6 }).map((_, i) => (
|
|
||||||
<Card key={i} className="h-full flex flex-col">
|
|
||||||
<CardContent className="p-6 flex flex-col flex-1">
|
|
||||||
<div className="flex items-start gap-3 mb-4">
|
|
||||||
<Skeleton className="w-12 h-12 rounded-lg" />
|
|
||||||
<div className="flex-1 space-y-2">
|
|
||||||
<Skeleton className="h-5 w-32" />
|
|
||||||
<Skeleton className="h-4 w-24" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="space-y-2 mb-4">
|
|
||||||
<Skeleton className="h-4 w-full" />
|
|
||||||
<Skeleton className="h-4 w-4/5" />
|
|
||||||
</div>
|
|
||||||
<div className="flex gap-1 mb-4">
|
|
||||||
<Skeleton className="h-5 w-16" />
|
|
||||||
<Skeleton className="h-5 w-20" />
|
|
||||||
</div>
|
|
||||||
<div className="mt-auto flex gap-2">
|
|
||||||
<Skeleton className="h-9 flex-1" />
|
|
||||||
<Skeleton className="h-9 w-9" />
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : filteredFollowedRepositories.length > 0 ? (
|
|
||||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
||||||
{filteredFollowedRepositories.map((repo) => (
|
|
||||||
<RepositoryCard key={repo.id} repo={repo} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
) : searchQuery.trim() ? (
|
|
||||||
<Card className="border-dashed">
|
|
||||||
<CardContent className="py-12 px-8 text-center">
|
|
||||||
<div className="max-w-sm mx-auto space-y-4">
|
|
||||||
<Search className="h-8 w-8 mx-auto mb-2 opacity-50 text-muted-foreground" />
|
|
||||||
<p className="text-muted-foreground">
|
|
||||||
No repositories found matching "{searchQuery}".
|
|
||||||
</p>
|
|
||||||
<Button
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => setSearchQuery('')}
|
|
||||||
>
|
|
||||||
Clear search
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
) : contacts.length > 0 ? (
|
|
||||||
<Card className="border-dashed">
|
|
||||||
<CardContent className="py-12 px-8 text-center">
|
|
||||||
<div className="max-w-sm mx-auto space-y-4">
|
|
||||||
<p className="text-muted-foreground">
|
|
||||||
None of the people you follow have published repositories yet.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
) : (
|
|
||||||
<Card className="border-dashed">
|
|
||||||
<CardContent className="py-12 px-8 text-center">
|
|
||||||
<div className="max-w-sm mx-auto space-y-4">
|
|
||||||
<p className="text-muted-foreground">
|
|
||||||
You're not following anyone yet. Follow people on Nostr to see their repositories here.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
)}
|
|
||||||
</TabsContent>
|
|
||||||
</Tabs>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</AppLayout>
|
</AppLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,358 @@
|
|||||||
|
import { useState, useMemo, useDeferredValue } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { AppLayout } from '@/components/AppLayout';
|
||||||
|
import { Input } from '@/components/ui/input';
|
||||||
|
import { Search, Compass } from 'lucide-react';
|
||||||
|
import { useCurrentUser } from '@/hooks/useCurrentUser';
|
||||||
|
import { useUserRepositories } from '@/hooks/useUserRepositories';
|
||||||
|
import { useContacts } from '@/hooks/useContacts';
|
||||||
|
import { useFollowedRepositories } from '@/hooks/useFollowedRepositories';
|
||||||
|
import { RepositoryCard } from '@/components/RepositoryCard';
|
||||||
|
import { Skeleton } from '@/components/ui/skeleton';
|
||||||
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
|
import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/components/ui/tabs';
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import type { Repository } from '@/hooks/useUserRepositories';
|
||||||
|
import { useNostr } from '@nostrify/react';
|
||||||
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
import { nip19 } from 'nostr-tools';
|
||||||
|
import { NSchema as n } from '@nostrify/nostrify';
|
||||||
|
import type { NostrMetadata } from '@nostrify/nostrify';
|
||||||
|
import { useSeoMeta } from '@unhead/react';
|
||||||
|
|
||||||
|
export default function Explore() {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { user } = useCurrentUser();
|
||||||
|
const { data: repositories = [], isLoading: isLoadingRepos } = useUserRepositories(user?.pubkey);
|
||||||
|
const { data: contacts = [] } = useContacts(user?.pubkey);
|
||||||
|
const { data: followedRepositories = [], isLoading: isLoadingFollowedRepos } = useFollowedRepositories(contacts);
|
||||||
|
const [activeTab, setActiveTab] = useState<'my-projects' | 'follows'>('follows');
|
||||||
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
|
|
||||||
|
// Defer search query to prevent blocking UI on every keystroke
|
||||||
|
const deferredSearchQuery = useDeferredValue(searchQuery);
|
||||||
|
|
||||||
|
// Get unique pubkeys from all repositories
|
||||||
|
const allRepos = useMemo(() => [...repositories, ...followedRepositories], [repositories, followedRepositories]);
|
||||||
|
const uniquePubkeys = useMemo(() => {
|
||||||
|
const pubkeys = new Set<string>();
|
||||||
|
allRepos.forEach(repo => pubkeys.add(repo.pubkey));
|
||||||
|
return Array.from(pubkeys);
|
||||||
|
}, [allRepos]);
|
||||||
|
|
||||||
|
// Pre-compute npubs once to avoid expensive encoding on every search
|
||||||
|
const npubMap = useMemo(() => {
|
||||||
|
const map = new Map<string, string>();
|
||||||
|
allRepos.forEach(repo => {
|
||||||
|
if (!map.has(repo.pubkey)) {
|
||||||
|
try {
|
||||||
|
map.set(repo.pubkey, nip19.npubEncode(repo.pubkey));
|
||||||
|
} catch {
|
||||||
|
// ignore encoding failures
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return map;
|
||||||
|
}, [allRepos]);
|
||||||
|
|
||||||
|
// Fetch author metadata for all unique pubkeys
|
||||||
|
const { nostr } = useNostr();
|
||||||
|
const { data: authorMetadataMap = new Map<string, NostrMetadata>() } = useQuery({
|
||||||
|
queryKey: ['repository-authors', uniquePubkeys],
|
||||||
|
queryFn: async () => {
|
||||||
|
if (uniquePubkeys.length === 0) return new Map<string, NostrMetadata>();
|
||||||
|
|
||||||
|
const events = await nostr.query(
|
||||||
|
[{ kinds: [0], authors: uniquePubkeys, limit: uniquePubkeys.length }],
|
||||||
|
{ signal: AbortSignal.timeout(3000) }
|
||||||
|
);
|
||||||
|
|
||||||
|
const metadataMap = new Map<string, NostrMetadata>();
|
||||||
|
for (const event of events) {
|
||||||
|
try {
|
||||||
|
const metadata = n.json().pipe(n.metadata()).parse(event.content);
|
||||||
|
metadataMap.set(event.pubkey, metadata);
|
||||||
|
} catch {
|
||||||
|
// If parsing fails, continue without metadata for this pubkey
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return metadataMap;
|
||||||
|
},
|
||||||
|
enabled: uniquePubkeys.length > 0,
|
||||||
|
staleTime: 60000, // 1 minute
|
||||||
|
});
|
||||||
|
|
||||||
|
useSeoMeta({
|
||||||
|
title: `${t('explore')} - Shakespeare`,
|
||||||
|
description: t('exploreRepositories'),
|
||||||
|
});
|
||||||
|
|
||||||
|
// Filter repositories based on search query - stable function with no dependencies
|
||||||
|
const filterRepositories = (
|
||||||
|
repos: Repository[],
|
||||||
|
query: string,
|
||||||
|
metadata: Map<string, NostrMetadata>,
|
||||||
|
npubs: Map<string, string>
|
||||||
|
): Repository[] => {
|
||||||
|
if (!query.trim()) {
|
||||||
|
return repos;
|
||||||
|
}
|
||||||
|
|
||||||
|
const lowerQuery = query.toLowerCase();
|
||||||
|
|
||||||
|
return repos.filter((repo) => {
|
||||||
|
// Filter by repository name
|
||||||
|
if (repo.name.toLowerCase().includes(lowerQuery)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by description
|
||||||
|
if (repo.description?.toLowerCase().includes(lowerQuery)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by tags (hashtags)
|
||||||
|
if (repo.repoTags.some(tag => tag.toLowerCase().includes(lowerQuery))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by hex pubkey
|
||||||
|
if (repo.pubkey.toLowerCase().includes(lowerQuery)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by npub (pre-computed)
|
||||||
|
const npub = npubs.get(repo.pubkey);
|
||||||
|
if (npub?.toLowerCase().includes(lowerQuery)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter by author name
|
||||||
|
const authorMetadata = metadata.get(repo.pubkey);
|
||||||
|
if (authorMetadata?.name?.toLowerCase().includes(lowerQuery)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Filtered repositories for "My Projects" tab - uses deferred query
|
||||||
|
const filteredMyRepositories = useMemo(() => {
|
||||||
|
return filterRepositories(repositories, deferredSearchQuery, authorMetadataMap, npubMap);
|
||||||
|
}, [repositories, deferredSearchQuery, authorMetadataMap, npubMap]);
|
||||||
|
|
||||||
|
// Filtered repositories for "Follows" tab - uses deferred query
|
||||||
|
const filteredFollowedRepositories = useMemo(() => {
|
||||||
|
return filterRepositories(followedRepositories, deferredSearchQuery, authorMetadataMap, npubMap);
|
||||||
|
}, [followedRepositories, deferredSearchQuery, authorMetadataMap, npubMap]);
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
|
return (
|
||||||
|
<AppLayout title={t('exploreApps')}>
|
||||||
|
<div className="max-w-2xl mx-auto text-center py-12">
|
||||||
|
<p className="text-lg text-muted-foreground">
|
||||||
|
{t('pleaseLogInToExplore')}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</AppLayout>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AppLayout title={t('exploreApps')}>
|
||||||
|
<div className="max-w-7xl mx-auto">
|
||||||
|
<div className="mb-8">
|
||||||
|
<div className="flex items-center gap-3 mb-3">
|
||||||
|
<Compass className="h-8 w-8 text-primary flex-shrink-0" />
|
||||||
|
<h1 className="text-3xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
||||||
|
{t('exploreApps')}
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
<p className="text-lg text-muted-foreground">
|
||||||
|
{t('exploreRepositories')}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Tabs value={activeTab} onValueChange={(value) => setActiveTab(value as 'my-projects' | 'follows')}>
|
||||||
|
<div className="flex items-center gap-4 mb-6 flex-wrap">
|
||||||
|
<TabsList>
|
||||||
|
<TabsTrigger value="my-projects">
|
||||||
|
My Projects
|
||||||
|
</TabsTrigger>
|
||||||
|
<TabsTrigger value="follows">
|
||||||
|
Follows
|
||||||
|
</TabsTrigger>
|
||||||
|
</TabsList>
|
||||||
|
|
||||||
|
{/* Search Input */}
|
||||||
|
{(repositories.length > 0 || followedRepositories.length > 0) && (
|
||||||
|
<div className="relative flex-1 min-w-[200px] max-w-md">
|
||||||
|
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none" />
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search repositories..."
|
||||||
|
value={searchQuery}
|
||||||
|
onChange={(e) => setSearchQuery(e.target.value)}
|
||||||
|
className="pl-9 h-10 text-sm"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<TabsContent value="my-projects">
|
||||||
|
{isLoadingRepos ? (
|
||||||
|
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
|
{Array.from({ length: 3 }).map((_, i) => (
|
||||||
|
<Card key={i} className="h-full flex flex-col">
|
||||||
|
<CardContent className="p-6 flex flex-col flex-1">
|
||||||
|
<div className="flex items-start gap-3 mb-4">
|
||||||
|
<Skeleton className="w-12 h-12 rounded-lg" />
|
||||||
|
<div className="flex-1 space-y-2">
|
||||||
|
<Skeleton className="h-5 w-32" />
|
||||||
|
<Skeleton className="h-4 w-24" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="space-y-2 mb-4">
|
||||||
|
<Skeleton className="h-4 w-full" />
|
||||||
|
<Skeleton className="h-4 w-4/5" />
|
||||||
|
</div>
|
||||||
|
<div className="flex gap-1 mb-4">
|
||||||
|
<Skeleton className="h-5 w-16" />
|
||||||
|
<Skeleton className="h-5 w-20" />
|
||||||
|
</div>
|
||||||
|
<div className="mt-auto flex gap-2">
|
||||||
|
<Skeleton className="h-9 flex-1" />
|
||||||
|
<Skeleton className="h-9 w-9" />
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : filteredMyRepositories.length > 0 ? (
|
||||||
|
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
|
{filteredMyRepositories.map((repo) => (
|
||||||
|
<RepositoryCard
|
||||||
|
key={repo.id}
|
||||||
|
repo={repo}
|
||||||
|
authorMetadata={authorMetadataMap.get(repo.pubkey)}
|
||||||
|
onTagClick={(tag) => setSearchQuery(tag)}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : searchQuery.trim() ? (
|
||||||
|
<Card className="border-dashed">
|
||||||
|
<CardContent className="py-12 px-8 text-center">
|
||||||
|
<div className="max-w-sm mx-auto space-y-4">
|
||||||
|
<Search className="h-8 w-8 mx-auto mb-2 opacity-50 text-muted-foreground" />
|
||||||
|
<p className="text-muted-foreground">
|
||||||
|
No repositories found matching "{searchQuery}".
|
||||||
|
</p>
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => setSearchQuery('')}
|
||||||
|
>
|
||||||
|
Clear search
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
) : (
|
||||||
|
<Card className="border-dashed">
|
||||||
|
<CardContent className="py-12 px-8 text-center">
|
||||||
|
<div className="max-w-sm mx-auto space-y-4">
|
||||||
|
<p className="text-muted-foreground">
|
||||||
|
No repositories found. Publish your first repository to Nostr to see it here.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
|
</TabsContent>
|
||||||
|
|
||||||
|
<TabsContent value="follows">
|
||||||
|
{isLoadingFollowedRepos ? (
|
||||||
|
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
|
{Array.from({ length: 6 }).map((_, i) => (
|
||||||
|
<Card key={i} className="h-full flex flex-col">
|
||||||
|
<CardContent className="p-6 flex flex-col flex-1">
|
||||||
|
<div className="flex items-start gap-3 mb-4">
|
||||||
|
<Skeleton className="w-12 h-12 rounded-lg" />
|
||||||
|
<div className="flex-1 space-y-2">
|
||||||
|
<Skeleton className="h-5 w-32" />
|
||||||
|
<Skeleton className="h-4 w-24" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="space-y-2 mb-4">
|
||||||
|
<Skeleton className="h-4 w-full" />
|
||||||
|
<Skeleton className="h-4 w-4/5" />
|
||||||
|
</div>
|
||||||
|
<div className="flex gap-1 mb-4">
|
||||||
|
<Skeleton className="h-5 w-16" />
|
||||||
|
<Skeleton className="h-5 w-20" />
|
||||||
|
</div>
|
||||||
|
<div className="mt-auto flex gap-2">
|
||||||
|
<Skeleton className="h-9 flex-1" />
|
||||||
|
<Skeleton className="h-9 w-9" />
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : filteredFollowedRepositories.length > 0 ? (
|
||||||
|
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||||
|
{filteredFollowedRepositories.map((repo) => (
|
||||||
|
<RepositoryCard
|
||||||
|
key={repo.id}
|
||||||
|
repo={repo}
|
||||||
|
authorMetadata={authorMetadataMap.get(repo.pubkey)}
|
||||||
|
onTagClick={(tag) => setSearchQuery(tag)}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : searchQuery.trim() ? (
|
||||||
|
<Card className="border-dashed">
|
||||||
|
<CardContent className="py-12 px-8 text-center">
|
||||||
|
<div className="max-w-sm mx-auto space-y-4">
|
||||||
|
<Search className="h-8 w-8 mx-auto mb-2 opacity-50 text-muted-foreground" />
|
||||||
|
<p className="text-muted-foreground">
|
||||||
|
No repositories found matching "{searchQuery}".
|
||||||
|
</p>
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => setSearchQuery('')}
|
||||||
|
>
|
||||||
|
Clear search
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
) : contacts.length > 0 ? (
|
||||||
|
<Card className="border-dashed">
|
||||||
|
<CardContent className="py-12 px-8 text-center">
|
||||||
|
<div className="max-w-sm mx-auto space-y-4">
|
||||||
|
<p className="text-muted-foreground">
|
||||||
|
None of the people you follow have published repositories yet.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
) : (
|
||||||
|
<Card className="border-dashed">
|
||||||
|
<CardContent className="py-12 px-8 text-center">
|
||||||
|
<div className="max-w-sm mx-auto space-y-4">
|
||||||
|
<p className="text-muted-foreground">
|
||||||
|
You're not following anyone yet. Follow people on Nostr to see their repositories here.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
|
</TabsContent>
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
</AppLayout>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,254 @@
|
|||||||
|
import { useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { Wallet, Plus, Trash2, Zap, Globe, WalletMinimal, CheckCircle } from 'lucide-react';
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import { Input } from '@/components/ui/input';
|
||||||
|
import { Label } from '@/components/ui/label';
|
||||||
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
|
import { Badge } from '@/components/ui/badge';
|
||||||
|
import { Separator } from '@/components/ui/separator';
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogDescription,
|
||||||
|
DialogFooter,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
} from '@/components/ui/dialog';
|
||||||
|
import { useNWC } from '@/hooks/useNWCContext';
|
||||||
|
import { useWallet } from '@/hooks/useWallet';
|
||||||
|
import { useToast } from '@/hooks/useToast';
|
||||||
|
import { SettingsPageLayout } from '@/components/SettingsPageLayout';
|
||||||
|
|
||||||
|
export function WalletSettings() {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [addDialogOpen, setAddDialogOpen] = useState(false);
|
||||||
|
const [connectionUri, setConnectionUri] = useState('');
|
||||||
|
const [alias, setAlias] = useState('');
|
||||||
|
const [isConnecting, setIsConnecting] = useState(false);
|
||||||
|
const { toast } = useToast();
|
||||||
|
|
||||||
|
const {
|
||||||
|
connections,
|
||||||
|
activeConnection,
|
||||||
|
connectionInfo,
|
||||||
|
addConnection,
|
||||||
|
removeConnection,
|
||||||
|
setActiveConnection
|
||||||
|
} = useNWC();
|
||||||
|
|
||||||
|
const { webln } = useWallet();
|
||||||
|
|
||||||
|
const hasNWC = connections.length > 0 && connections.some(c => c.isConnected);
|
||||||
|
|
||||||
|
const handleAddConnection = async () => {
|
||||||
|
if (!connectionUri.trim()) {
|
||||||
|
toast({
|
||||||
|
title: t('connectionUriRequired'),
|
||||||
|
description: t('pleaseEnterValidNwcUri'),
|
||||||
|
variant: 'destructive',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setIsConnecting(true);
|
||||||
|
try {
|
||||||
|
const success = await addConnection(connectionUri.trim(), alias.trim() || undefined);
|
||||||
|
if (success) {
|
||||||
|
setConnectionUri('');
|
||||||
|
setAlias('');
|
||||||
|
setAddDialogOpen(false);
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setIsConnecting(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleRemoveConnection = (connectionString: string) => {
|
||||||
|
removeConnection(connectionString);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSetActive = (connectionString: string) => {
|
||||||
|
setActiveConnection(connectionString);
|
||||||
|
toast({
|
||||||
|
title: t('activeWalletChanged'),
|
||||||
|
description: t('selectedWalletNowActive'),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SettingsPageLayout
|
||||||
|
icon={Wallet}
|
||||||
|
titleKey="walletSettings"
|
||||||
|
descriptionKey="walletSettingsDescription"
|
||||||
|
>
|
||||||
|
{/* Current Status */}
|
||||||
|
<div className="space-y-3">
|
||||||
|
<h3 className="font-medium">{t('currentStatus')}</h3>
|
||||||
|
<div className="grid gap-3">
|
||||||
|
{/* WebLN */}
|
||||||
|
<div className="flex items-center justify-between p-3 border rounded-lg">
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<Globe className="h-4 w-4 text-muted-foreground" />
|
||||||
|
<div>
|
||||||
|
<p className="text-sm font-medium">WebLN</p>
|
||||||
|
<p className="text-xs text-muted-foreground">{t('browserExtension')}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
{webln && <CheckCircle className="h-4 w-4 text-green-600" />}
|
||||||
|
<Badge variant={webln ? "default" : "secondary"} className="text-xs">
|
||||||
|
{webln ? t('ready') : t('notFound')}
|
||||||
|
</Badge>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/* NWC */}
|
||||||
|
<div className="flex items-center justify-between p-3 border rounded-lg">
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<WalletMinimal className="h-4 w-4 text-muted-foreground" />
|
||||||
|
<div>
|
||||||
|
<p className="text-sm font-medium">{t('nostrWalletConnect')}</p>
|
||||||
|
<p className="text-xs text-muted-foreground">
|
||||||
|
{connections.length > 0
|
||||||
|
? t('walletsConnected', { count: connections.length })
|
||||||
|
: t('remoteWalletConnection')
|
||||||
|
}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
{hasNWC && <CheckCircle className="h-4 w-4 text-green-600" />}
|
||||||
|
<Badge variant={hasNWC ? "default" : "secondary"} className="text-xs">
|
||||||
|
{hasNWC ? t('ready') : t('none')}
|
||||||
|
</Badge>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Separator />
|
||||||
|
|
||||||
|
{/* NWC Management */}
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="flex items-center justify-between">
|
||||||
|
<h3 className="font-medium">{t('nostrWalletConnect')}</h3>
|
||||||
|
<Button size="sm" variant="outline" onClick={() => setAddDialogOpen(true)}>
|
||||||
|
<Plus className="h-4 w-4 mr-1" />
|
||||||
|
{t('add')}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Connected Wallets List */}
|
||||||
|
{connections.length === 0 ? (
|
||||||
|
<div className="text-center py-6 text-muted-foreground border border-dashed rounded-lg">
|
||||||
|
<WalletMinimal className="h-8 w-8 mx-auto mb-2 opacity-50" />
|
||||||
|
<p className="text-sm">{t('noWalletsConnected')}</p>
|
||||||
|
<p className="text-xs mt-1">{t('addNwcWalletToGetStarted')}</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="space-y-2">
|
||||||
|
{connections.map((connection) => {
|
||||||
|
const info = connectionInfo[connection.connectionString];
|
||||||
|
const isActive = activeConnection === connection.connectionString;
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
key={connection.connectionString}
|
||||||
|
className={`flex items-center justify-between p-3 border rounded-lg ${isActive ? 'ring-2 ring-primary' : ''}`}
|
||||||
|
>
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<WalletMinimal className="h-4 w-4 text-muted-foreground" />
|
||||||
|
<div>
|
||||||
|
<p className="text-sm font-medium">
|
||||||
|
{connection.alias || info?.alias || t('lightningWallet')}
|
||||||
|
</p>
|
||||||
|
<p className="text-xs text-muted-foreground">
|
||||||
|
{t('nwcConnection')}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
{isActive && <CheckCircle className="h-4 w-4 text-green-600" />}
|
||||||
|
{!isActive && (
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => handleSetActive(connection.connectionString)}
|
||||||
|
title={t('setAsActive')}
|
||||||
|
>
|
||||||
|
<Zap className="h-3 w-3" />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
variant="ghost"
|
||||||
|
onClick={() => handleRemoveConnection(connection.connectionString)}
|
||||||
|
title={t('remove')}
|
||||||
|
>
|
||||||
|
<Trash2 className="h-3 w-3" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Help */}
|
||||||
|
{!webln && connections.length === 0 && (
|
||||||
|
<>
|
||||||
|
<Separator />
|
||||||
|
<div className="text-center py-4 space-y-2">
|
||||||
|
<p className="text-sm text-muted-foreground">
|
||||||
|
{t('installWeblnOrConnectNwc')}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Add Wallet Dialog */}
|
||||||
|
<Dialog open={addDialogOpen} onOpenChange={setAddDialogOpen}>
|
||||||
|
<DialogContent className="sm:max-w-[425px]">
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>{t('connectNwcWallet')}</DialogTitle>
|
||||||
|
<DialogDescription>
|
||||||
|
{t('enterConnectionStringFromWallet')}
|
||||||
|
</DialogDescription>
|
||||||
|
</DialogHeader>
|
||||||
|
<div className="space-y-4 py-4">
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="alias">{t('walletNameOptional')}</Label>
|
||||||
|
<Input
|
||||||
|
id="alias"
|
||||||
|
placeholder={t('myLightningWallet')}
|
||||||
|
value={alias}
|
||||||
|
onChange={(e) => setAlias(e.target.value)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="connection-uri">{t('connectionUri')}</Label>
|
||||||
|
<Textarea
|
||||||
|
id="connection-uri"
|
||||||
|
placeholder="nostr+walletconnect://..."
|
||||||
|
value={connectionUri}
|
||||||
|
onChange={(e) => setConnectionUri(e.target.value)}
|
||||||
|
rows={3}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<DialogFooter>
|
||||||
|
<Button
|
||||||
|
onClick={handleAddConnection}
|
||||||
|
disabled={isConnecting || !connectionUri.trim()}
|
||||||
|
className="w-full"
|
||||||
|
>
|
||||||
|
{isConnecting ? t('connecting') : t('connect')}
|
||||||
|
</Button>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
</SettingsPageLayout>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default WalletSettings;
|
||||||
Reference in new issue
Block a user