app_store: UI fix in prod

This commit is contained in:
bitful-pannul 2024-08-16 23:21:37 +03:00
parent 07afdfbde2
commit 7550bb0847
4 changed files with 67 additions and 42 deletions

80
Cargo.lock generated
View File

@ -78,7 +78,7 @@ name = "alias"
version = "0.1.0"
dependencies = [
"anyhow",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -753,7 +753,7 @@ dependencies = [
"alloy-sol-types",
"anyhow",
"bincode",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"rand 0.8.5",
"serde",
"serde_json",
@ -1123,7 +1123,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"bincode",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"url",
@ -1286,7 +1286,7 @@ name = "cat"
version = "0.1.0"
dependencies = [
"anyhow",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -1350,7 +1350,7 @@ dependencies = [
"alloy-sol-types",
"anyhow",
"bincode",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?branch=develop)",
"rand 0.8.5",
"serde",
"serde_json",
@ -1368,7 +1368,7 @@ version = "0.2.1"
dependencies = [
"anyhow",
"bincode",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"pleco",
"serde",
"serde_json",
@ -2089,7 +2089,7 @@ name = "download"
version = "0.1.0"
dependencies = [
"anyhow",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -2100,7 +2100,7 @@ name = "downloads"
version = "0.5.0"
dependencies = [
"anyhow",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?branch=develop)",
"rand 0.8.5",
"serde",
"serde_json",
@ -2136,7 +2136,7 @@ dependencies = [
name = "echo"
version = "0.1.0"
dependencies = [
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"wit-bindgen",
]
@ -2365,7 +2365,7 @@ version = "0.2.0"
dependencies = [
"anyhow",
"bincode",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"rand 0.8.5",
"serde",
"serde_json",
@ -2518,7 +2518,7 @@ dependencies = [
name = "get_block"
version = "0.1.0"
dependencies = [
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -2581,7 +2581,7 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
name = "globe"
version = "0.1.0"
dependencies = [
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"url",
@ -2708,7 +2708,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
name = "help"
version = "0.1.0"
dependencies = [
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"wit-bindgen",
]
@ -2737,7 +2737,7 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46"
name = "hi"
version = "0.1.0"
dependencies = [
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -2758,7 +2758,7 @@ version = "0.1.1"
dependencies = [
"anyhow",
"bincode",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -3086,7 +3086,7 @@ name = "install"
version = "0.1.0"
dependencies = [
"anyhow",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -3262,7 +3262,7 @@ name = "kfetch"
version = "0.1.0"
dependencies = [
"anyhow",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"rmp-serde",
"serde",
"serde_json",
@ -3274,7 +3274,7 @@ name = "kill"
version = "0.1.0"
dependencies = [
"anyhow",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -3389,6 +3389,28 @@ dependencies = [
"wit-bindgen",
]
[[package]]
name = "kinode_process_lib"
version = "0.9.0"
source = "git+https://github.com/kinode-dao/process_lib?branch=develop#5c1d8ed36cf10688808c09357ef0e43225396097"
dependencies = [
"alloy",
"alloy-primitives",
"alloy-sol-macro",
"alloy-sol-types",
"anyhow",
"bincode",
"http 1.1.0",
"mime_guess",
"rand 0.8.5",
"rmp-serde",
"serde",
"serde_json",
"thiserror",
"url",
"wit-bindgen",
]
[[package]]
name = "kit"
version = "0.6.8"
@ -3462,7 +3484,7 @@ dependencies = [
"anyhow",
"bincode",
"hex",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"rmp-serde",
"serde",
"serde_json",
@ -3677,7 +3699,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"clap",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"regex",
"serde",
"serde_json",
@ -3838,7 +3860,7 @@ dependencies = [
name = "net_diagnostics"
version = "0.1.0"
dependencies = [
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"rmp-serde",
"serde",
"wit-bindgen",
@ -4151,7 +4173,7 @@ dependencies = [
name = "peer"
version = "0.1.0"
dependencies = [
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"rmp-serde",
"serde",
"wit-bindgen",
@ -4161,7 +4183,7 @@ dependencies = [
name = "peers"
version = "0.1.0"
dependencies = [
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"rmp-serde",
"serde",
"wit-bindgen",
@ -5176,7 +5198,7 @@ dependencies = [
"anyhow",
"base64 0.22.1",
"bincode",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"rmp-serde",
"serde",
"serde_json",
@ -5394,7 +5416,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
name = "state"
version = "0.1.0"
dependencies = [
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -5588,7 +5610,7 @@ version = "0.1.1"
dependencies = [
"anyhow",
"bincode",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"rand 0.8.5",
"regex",
"serde",
@ -5602,7 +5624,7 @@ version = "0.1.1"
dependencies = [
"anyhow",
"bincode",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"process_macros",
"serde",
"serde_json",
@ -5859,7 +5881,7 @@ version = "0.2.0"
dependencies = [
"anyhow",
"clap",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",
@ -6176,7 +6198,7 @@ name = "uninstall"
version = "0.1.0"
dependencies = [
"anyhow",
"kinode_process_lib 0.9.0",
"kinode_process_lib 0.9.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.9.0)",
"serde",
"serde_json",
"wit-bindgen",

View File

@ -518,7 +518,7 @@ fn serve_paths(
format!("Missing id").into_bytes(),
));
};
let downloads = Address::from_str("our@downloads:app_store:sys")?;
match method {

View File

@ -79,8 +79,7 @@ export default function AppPage() {
};
const handleLaunch = () => {
// Implement launch functionality
console.log("Launching app:", app?.package_id.package_name);
navigate(`/${app?.package_id.package_name}:${app?.package_id.package_name}:${app?.package_id.publisher_node}/`);
};
if (isLoading) {

View File

@ -11,10 +11,16 @@ export default function StorePage() {
fetchListings();
}, [fetchListings]);
const filteredApps = Object.values(listings).filter((app) =>
app.package_id.package_name.toLowerCase().includes(searchQuery.toLowerCase()) ||
app.metadata?.description?.toLowerCase().includes(searchQuery.toLowerCase())
);
// extensive temp null handling due to weird prod bug
const filteredApps = React.useMemo(() => {
if (!listings) return [];
return Object.values(listings).filter((app) => {
if (!app || !app.package_id) return false;
const nameMatch = app.package_id.package_name.toLowerCase().includes(searchQuery.toLowerCase());
const descMatch = app.metadata?.description?.toLowerCase().includes(searchQuery.toLowerCase()) || false;
return nameMatch || descMatch;
});
}, [listings, searchQuery]);
return (
<div className="store-page">
@ -27,7 +33,7 @@ export default function StorePage() {
/>
</div>
<div className="app-list">
{Object.keys(listings).length === 0 ? (
{!listings ? (
<p>Loading...</p>
) : filteredApps.length === 0 ? (
<p>No apps available.</p>
@ -43,7 +49,7 @@ export default function StorePage() {
</thead>
<tbody>
{filteredApps.map((app) => (
<AppRow key={`${app.package_id.package_name}:${app.package_id.publisher_node}`} app={app} />
<AppRow key={`${app.package_id?.package_name}:${app.package_id?.publisher_node}`} app={app} />
))}
</tbody>
</table>
@ -53,11 +59,9 @@ export default function StorePage() {
);
}
interface AppRowProps {
app: AppListing;
}
const AppRow: React.FC<{ app: AppListing }> = ({ app }) => {
if (!app || !app.package_id) return null;
const AppRow: React.FC<AppRowProps> = ({ app }) => {
return (
<tr className="app-row">
<td>