From 0fec21b9cec0f611ec0800944fe46698f2afe5c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E5=AE=AE=E8=93=AE?= <123083837+reyamir@users.noreply.github.com> Date: Sun, 30 Jun 2024 14:26:02 +0700 Subject: [PATCH] Some improments and Negentropy (#219) * feat: adjust default window size * feat: save window state * feat: add window state plugin * feat: add search * feat: use negentropy for newsfeed * feat: live feeds * feat: add search user --- apps/desktop2/src/app.tsx | 3 +- .../src/components/note/mentions/note.tsx | 8 +- .../src/components/note/preview/images.tsx | 2 +- .../src/components/note/preview/video.tsx | 3 +- .../src/components/note/preview/videos.tsx | 6 +- apps/desktop2/src/components/note/user.tsx | 2 +- apps/desktop2/src/components/repost.tsx | 2 +- apps/desktop2/src/components/text.tsx | 2 - apps/desktop2/src/components/user/avatar.tsx | 35 +- apps/desktop2/src/routes/$account.home.tsx | 50 +- apps/desktop2/src/routes/$account.tsx | 280 +- apps/desktop2/src/routes/create-group.tsx | 4 +- .../src/routes/create-newsfeed.users.tsx | 2 +- apps/desktop2/src/routes/editor/index.tsx | 14 +- apps/desktop2/src/routes/index.tsx | 2 +- apps/desktop2/src/routes/newsfeed.tsx | 101 +- apps/desktop2/src/routes/nwc.lazy.tsx | 52 - apps/desktop2/src/routes/panel.tsx | 72 +- apps/desktop2/src/routes/search.notes.tsx | 96 + apps/desktop2/src/routes/search.tsx | 168 +- apps/desktop2/src/routes/search.users.tsx | 101 + apps/desktop2/src/routes/settings/backup.tsx | 2 +- apps/desktop2/src/routes/trending.users.tsx | 4 +- package.json | 4 +- packages/system/src/commands.ts | 26 +- packages/system/src/event.ts | 15 +- packages/system/src/query.ts | 23 + packages/system/src/window.ts | 12 +- packages/tailwindcss/package.json | 3 +- packages/tailwindcss/tailwind.config.js | 2 +- packages/utils/index.ts | 1 - packages/utils/src/delay.ts | 1 - pnpm-lock.yaml | 7465 +++++++++-------- src-tauri/Cargo.lock | 35 +- src-tauri/Cargo.toml | 11 +- src-tauri/capabilities/column.json | 51 + src-tauri/capabilities/main.json | 177 +- src-tauri/gen/schemas/acl-manifests.json | 2 +- src-tauri/gen/schemas/capabilities.json | 2 +- src-tauri/gen/schemas/desktop-schema.json | 250 +- src-tauri/gen/schemas/macOS-schema.json | 250 +- src-tauri/src/main.rs | 12 +- src-tauri/src/nostr/event.rs | 68 +- src-tauri/src/nostr/keys.rs | 68 +- src-tauri/src/nostr/metadata.rs | 12 +- src-tauri/tauri.macos.conf.json | 70 +- 46 files changed, 5633 insertions(+), 3938 deletions(-) delete mode 100644 apps/desktop2/src/routes/nwc.lazy.tsx create mode 100644 apps/desktop2/src/routes/search.notes.tsx create mode 100644 apps/desktop2/src/routes/search.users.tsx delete mode 100644 packages/utils/src/delay.ts create mode 100644 src-tauri/capabilities/column.json diff --git a/apps/desktop2/src/app.tsx b/apps/desktop2/src/app.tsx index bdd3cbe0..f65c8ff6 100644 --- a/apps/desktop2/src/app.tsx +++ b/apps/desktop2/src/app.tsx @@ -1,12 +1,11 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { RouterProvider, createRouter } from "@tanstack/react-router"; -import { StrictMode } from "react"; import { type } from "@tauri-apps/plugin-os"; +import { StrictMode } from "react"; import ReactDOM from "react-dom/client"; import { routeTree } from "./router.gen"; // auto generated file import "./app.css"; -// Set up a Router instance const queryClient = new QueryClient(); const platform = type(); const router = createRouter({ diff --git a/apps/desktop2/src/components/note/mentions/note.tsx b/apps/desktop2/src/components/note/mentions/note.tsx index c81f2dfe..7b7bf1cf 100644 --- a/apps/desktop2/src/components/note/mentions/note.tsx +++ b/apps/desktop2/src/components/note/mentions/note.tsx @@ -1,8 +1,8 @@ -import { LumeWindow, useEvent } from "@lume/system"; -import { LinkIcon } from "@lume/icons"; -import { cn } from "@lume/utils"; import { User } from "@/components/user"; +import { LinkIcon } from "@lume/icons"; +import { LumeWindow, useEvent } from "@lume/system"; import { Spinner } from "@lume/ui"; +import { cn } from "@lume/utils"; export function MentionNote({ eventId, @@ -40,7 +40,7 @@ export function MentionNote({