From bc37b8c5e61a2f85e04c90e0be867899b526c70a Mon Sep 17 00:00:00 2001 From: elstua Date: Wed, 4 Mar 2026 18:40:14 +0000 Subject: [PATCH 1/3] Added enchanced summary and gradient for text --- Cargo.lock | 1 - .../components/session-preview-card.tsx | 155 ++++++++++++++++-- 2 files changed, 142 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a93816a54..d1debe13d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1367,7 +1367,6 @@ dependencies = [ "hound", "libpulse-binding", "pin-project", - "resampler", "ringbuf", "rodio", "serde", diff --git a/apps/desktop/src/session/components/session-preview-card.tsx b/apps/desktop/src/session/components/session-preview-card.tsx index 1d041c084c..fead89d85e 100644 --- a/apps/desktop/src/session/components/session-preview-card.tsx +++ b/apps/desktop/src/session/components/session-preview-card.tsx @@ -1,6 +1,8 @@ import { useMotionValue, useSpring, useTransform } from "motion/react"; import { useCallback, useMemo, useRef, useState } from "react"; +import { Streamdown } from "streamdown"; +import { isValidTiptapContent, json2md } from "@hypr/tiptap/shared"; import { HoverCard, HoverCardContent, @@ -59,13 +61,60 @@ function useSessionPreviewData(sessionId: string) { main.STORE_ID, ); - const previewText = useMemo(() => { - const text = extractPlainText(rawMd); - if (!text) return ""; - return text.length > MAX_PREVIEW_LENGTH - ? text.slice(0, MAX_PREVIEW_LENGTH) + "…" - : text; - }, [rawMd]); + const enhancedNoteIds = main.UI.useSliceRowIds( + main.INDEXES.enhancedNotesBySession, + sessionId, + main.STORE_ID, + ); + + const firstEnhancedNoteId = enhancedNoteIds?.[0]; + const enhancedContent = main.UI.useCell( + "enhanced_notes", + firstEnhancedNoteId ?? "", + "content", + main.STORE_ID, + ) as string | undefined; + const enhancedTitle = main.UI.useCell( + "enhanced_notes", + firstEnhancedNoteId ?? "", + "title", + main.STORE_ID, + ) as string | undefined; + + const hasEnhanced = !!firstEnhancedNoteId && !!enhancedContent; + + const { previewMarkdown, previewPlainText } = useMemo(() => { + const source = hasEnhanced ? enhancedContent : rawMd; + if (typeof source !== "string" || !source.trim()) { + return { previewMarkdown: null, previewPlainText: "" }; + } + + const trimmed = source.trim(); + if (trimmed.startsWith("{")) { + try { + const parsed = JSON.parse(trimmed); + if (isValidTiptapContent(parsed)) { + const md = json2md(parsed).trim(); + if (md) return { previewMarkdown: md, previewPlainText: "" }; + } + } catch {} + } + + const plain = extractPlainText(source); + const truncated = + plain.length > MAX_PREVIEW_LENGTH + ? plain.slice(0, MAX_PREVIEW_LENGTH) + "…" + : plain; + return { previewMarkdown: null, previewPlainText: truncated }; + }, [hasEnhanced, enhancedContent, rawMd]); + + const hasContent = !!previewMarkdown || !!previewPlainText; + + const previewLabel = useMemo(() => { + if (hasEnhanced && hasContent) return enhancedTitle || "Summary"; + if (hasContent) return "Notes"; + return null; + }, [hasEnhanced, hasContent, enhancedTitle]); const dateDisplay = useMemo(() => { let timestamp = createdAt; @@ -80,7 +129,14 @@ function useSessionPreviewData(sessionId: string) { return format(parsed, "MMM d, yyyy · h:mm a"); }, [createdAt, eventJson]); - return { title, previewText, dateDisplay, participantMappingIds }; + return { + title, + previewMarkdown, + previewPlainText, + previewLabel, + dateDisplay, + participantMappingIds, + }; } function useCursorFollow(axis: "x" | "y") { @@ -133,6 +189,59 @@ function useParticipantNames(mappingIds: string[]) { }, [mappingIds, allResults]); } +const previewComponents = { + h1: (props: React.HTMLAttributes) => ( +

+ {props.children as React.ReactNode} +

+ ), + h2: (props: React.HTMLAttributes) => ( +

+ {props.children as React.ReactNode} +

+ ), + h3: (props: React.HTMLAttributes) => ( +

+ {props.children as React.ReactNode} +

+ ), + h4: (props: React.HTMLAttributes) => ( +

+ {props.children as React.ReactNode} +

+ ), + h5: (props: React.HTMLAttributes) => ( +
+ {props.children as React.ReactNode} +
+ ), + h6: (props: React.HTMLAttributes) => ( +
+ {props.children as React.ReactNode} +
+ ), + ul: (props: React.HTMLAttributes) => ( +
    + {props.children as React.ReactNode} +
+ ), + ol: (props: React.HTMLAttributes) => ( +
    + {props.children as React.ReactNode} +
+ ), + li: (props: React.HTMLAttributes) => ( +
  • + {props.children as React.ReactNode} +
  • + ), + p: (props: React.HTMLAttributes) => ( +

    + {props.children as React.ReactNode} +

    + ), +} as const; + const MAX_VISIBLE_PARTICIPANTS = 3; function ParticipantsList({ mappingIds }: { mappingIds: string[] }) { @@ -164,8 +273,14 @@ export function SessionPreviewCard({ children: React.ReactNode; enabled?: boolean; }) { - const { title, previewText, dateDisplay, participantMappingIds } = - useSessionPreviewData(sessionId); + const { + title, + previewMarkdown, + previewPlainText, + previewLabel, + dateDisplay, + participantMappingIds, + } = useSessionPreviewData(sessionId); const followAxis = side === "right" ? "y" : "x"; const { triggerRef, handleMouseMove, handleMouseLeave, style } = @@ -224,9 +339,23 @@ export function SessionPreviewCard({
    {title || "Untitled"}
    - {previewText && ( -
    - {previewText} + {(previewMarkdown || previewPlainText) && ( +
    +
    + {previewMarkdown ? ( + + {previewMarkdown} + + ) : ( +
    + {previewPlainText} +
    + )} +
    )}
    From 0bc213b53c3441fc5d2edb67bbfaf1c360d5be25 Mon Sep 17 00:00:00 2001 From: elstua Date: Wed, 4 Mar 2026 18:51:16 +0000 Subject: [PATCH 2/3] fixed list dots outside the textview --- apps/desktop/src/session/components/session-preview-card.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/session/components/session-preview-card.tsx b/apps/desktop/src/session/components/session-preview-card.tsx index fead89d85e..7d73cae57f 100644 --- a/apps/desktop/src/session/components/session-preview-card.tsx +++ b/apps/desktop/src/session/components/session-preview-card.tsx @@ -221,12 +221,12 @@ const previewComponents = { ), ul: (props: React.HTMLAttributes) => ( -
      +
        {props.children as React.ReactNode}
      ), ol: (props: React.HTMLAttributes) => ( -
        +
          {props.children as React.ReactNode}
        ), From 1a1162a0c0a52c83b494274eccc9d7374ee0cd1d Mon Sep 17 00:00:00 2001 From: elstua Date: Thu, 5 Mar 2026 23:03:47 +0000 Subject: [PATCH 3/3] changed the empty screen for notes --- .../public/assets/folder placeholder.svg | 16 ++++++++ apps/desktop/src/folders/index.tsx | 32 ++++++++++------ package.json | 4 ++ pnpm-lock.yaml | 38 ++++++++++++++++++- 4 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 apps/desktop/public/assets/folder placeholder.svg diff --git a/apps/desktop/public/assets/folder placeholder.svg b/apps/desktop/public/assets/folder placeholder.svg new file mode 100644 index 0000000000..e978e92439 --- /dev/null +++ b/apps/desktop/public/assets/folder placeholder.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/apps/desktop/src/folders/index.tsx b/apps/desktop/src/folders/index.tsx index 0a6e502e3b..e3c1ad8b50 100644 --- a/apps/desktop/src/folders/index.tsx +++ b/apps/desktop/src/folders/index.tsx @@ -154,19 +154,27 @@ export function TabContentFolder({ tab }: { tab: Tab }) { } function TabContentFolderTopLevel() { - const { topLevel: topLevelFolderIds } = useFolderTree(); - return ( -
        -
        } title="Folders"> - {topLevelFolderIds.length > 0 && ( -
        - {topLevelFolderIds.map((folderId) => ( - - ))} -
        - )} -
        +
        +
        +
        + {Array.from({ length: 4 }).map((_, i) => ( + + ))} +
        +

        + Folders will be there soon +

        +

        + We're working on a way for you to organize your notes
        + Stay tuned! +

        +
        ); } diff --git a/package.json b/package.json index b0b8deb33f..961cb97778 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "@tanstack/eslint-plugin-query": "^5.91.4", "dprint": "^0.51.1", "eslint": "^9.39.2", + "lint-staged": "^16.3.2", "oxfmt": "^0.35.0", "oxlint": "^1.50.0", "oxlint-tsgolint": "^0.12.2", @@ -17,6 +18,9 @@ "turbo": "2.8.3", "typescript-eslint": "^8.55.0" }, + "lint-staged": { + "*.{ts,tsx,js,jsx,json,css,md}": "dprint fmt" + }, "packageManager": "pnpm@10.30.0", "engines": { "node": ">=22" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 19575e26dd..c489a69a92 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: eslint: specifier: ^9.39.2 version: 9.39.2(jiti@2.6.1) + lint-staged: + specifier: ^16.3.2 + version: 16.3.2 oxfmt: specifier: ^0.35.0 version: 0.35.0 @@ -12509,6 +12512,11 @@ packages: linkifyjs@4.3.2: resolution: {integrity: sha512-NT1CJtq3hHIreOianA8aSXn6Cw0JzYOuDQbOrSPe7gqFnCpKP++MQe3ODgO3oh2GJFORkAAdqredOa60z63GbA==} + lint-staged@16.3.2: + resolution: {integrity: sha512-xKqhC2AeXLwiAHXguxBjuChoTTWFC6Pees0SHPwOpwlvI3BH7ZADFPddAdN3pgo3aiKgPUx/bxE78JfUnxQnlg==} + engines: {node: '>=20.17'} + hasBin: true + listhen@1.9.0: resolution: {integrity: sha512-I8oW2+QL5KJo8zXNWX046M134WchxsXC7SawLPvRQpogCbkyQIaFxPE89A2HiwR7vAK2Dm2ERBAmyjTYGYEpBg==} hasBin: true @@ -12517,6 +12525,10 @@ packages: resolution: {integrity: sha512-4oogpJzRRGtq41B0GKZIldzYCnQTgX2DPM/XvcfNu7g2E7sxaast009150RKFZBnrHAnfMOUaedIqdIOLCCRxQ==} engines: {node: '>=22.0.0'} + listr2@9.0.5: + resolution: {integrity: sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==} + engines: {node: '>=20.0.0'} + lit-element@4.2.2: resolution: {integrity: sha512-aFKhNToWxoyhkNDmWZwEva2SlQia+jfG0fjIWV//YeTaWrVnOxD89dPKfigCUspXFmjzOEUQpOkejH5Ly6sG0w==} @@ -15485,6 +15497,10 @@ packages: strict-event-emitter@0.5.1: resolution: {integrity: sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==} + string-argv@0.3.2: + resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} + engines: {node: '>=0.6.19'} + string-convert@0.2.1: resolution: {integrity: sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==} @@ -28775,7 +28791,7 @@ snapshots: is-fullwidth-code-point@5.1.0: dependencies: - get-east-asian-width: 1.4.0 + get-east-asian-width: 1.5.0 is-generator-function@1.1.2: dependencies: @@ -29335,6 +29351,15 @@ snapshots: linkifyjs@4.3.2: {} + lint-staged@16.3.2: + dependencies: + commander: 14.0.3 + listr2: 9.0.5 + micromatch: 4.0.8 + string-argv: 0.3.2 + tinyexec: 1.0.2 + yaml: 2.8.2 + listhen@1.9.0: dependencies: '@parcel/watcher': 2.5.6 @@ -29365,6 +29390,15 @@ snapshots: rfdc: 1.4.1 wrap-ansi: 10.0.0 + listr2@9.0.5: + dependencies: + cli-truncate: 5.1.1 + colorette: 2.0.20 + eventemitter3: 5.0.4 + log-update: 6.1.0 + rfdc: 1.4.1 + wrap-ansi: 9.0.2 + lit-element@4.2.2: dependencies: '@lit-labs/ssr-dom-shim': 1.5.1 @@ -33475,6 +33509,8 @@ snapshots: strict-event-emitter@0.5.1: {} + string-argv@0.3.2: {} + string-convert@0.2.1: {} string-hash@1.1.3: {}