diff --git a/.github/workflows/infra-database.yml b/.github/workflows/infra-database.yml
index 4642ea73b44..d3843acfe0b 100644
--- a/.github/workflows/infra-database.yml
+++ b/.github/workflows/infra-database.yml
@@ -14,6 +14,7 @@ on:
- "apps/web/app/api/cron/developer-storage/**"
- "apps/web/lib/user-preferences-sql.ts"
- "apps/web/lib/meetings/trial.ts"
+ - "apps/web/lib/meetings/share.ts"
- "apps/web/lib/meetings/audio-usage.ts"
- "apps/web/lib/media-input-policy-strikes.ts"
- "apps/web/lib/organization-member-removal.ts"
@@ -52,6 +53,7 @@ on:
- "apps/web/app/api/cron/developer-storage/**"
- "apps/web/lib/user-preferences-sql.ts"
- "apps/web/lib/meetings/trial.ts"
+ - "apps/web/lib/meetings/share.ts"
- "apps/web/lib/meetings/audio-usage.ts"
- "apps/web/lib/media-input-policy-strikes.ts"
- "apps/web/lib/organization-member-removal.ts"
@@ -155,4 +157,4 @@ jobs:
CAP_INFRA_TEST_DATABASE_URL: mysql://root@127.0.0.1:3306/cap_infra_tests
CAP_INFRA_ROUND_TRIPS_DATABASE_URL: mysql://root@127.0.0.1:3306/cap_infra_tests
CAP_PASSKEYS_TEST_DATABASE_URL: mysql://root@127.0.0.1:3306/cap_infra_tests
- run: bun run vitest run __tests__/integration/infra-*-database.test.ts __tests__/integration/user-preferences-database.test.ts __tests__/integration/space-creator-membership-database.test.ts __tests__/integration/organization-pointer-database.test.ts __tests__/integration/dashboard-library-database.test.ts __tests__/integration/messenger-poll-database.test.ts __tests__/integration/passkeys-database.test.ts __tests__/integration/email-change-database.test.ts __tests__/integration/meetings-trial-database.test.ts __tests__/integration/meetings-audio-usage-database.test.ts
+ run: bun run vitest run __tests__/integration/infra-*-database.test.ts __tests__/integration/user-preferences-database.test.ts __tests__/integration/space-creator-membership-database.test.ts __tests__/integration/organization-pointer-database.test.ts __tests__/integration/dashboard-library-database.test.ts __tests__/integration/messenger-poll-database.test.ts __tests__/integration/passkeys-database.test.ts __tests__/integration/email-change-database.test.ts __tests__/integration/meetings-trial-database.test.ts __tests__/integration/meetings-audio-usage-database.test.ts __tests__/integration/meetings-share-database.test.ts
diff --git a/apps/web/__tests__/integration/dashboard-library-database.test.ts b/apps/web/__tests__/integration/dashboard-library-database.test.ts
index 4e44d876961..c3b96ea9a6a 100644
--- a/apps/web/__tests__/integration/dashboard-library-database.test.ts
+++ b/apps/web/__tests__/integration/dashboard-library-database.test.ts
@@ -233,6 +233,71 @@ describe.runIf(Boolean(databaseUrl))(
).toEqual({ [unshared]: [], [shared]: [orgId] });
});
+ it("lists and counts each kind of Cap on its own, newest first", async () => {
+ const { CapsPageView } = await import(
+ "@/app/(org)/dashboard/caps/caps-page-data"
+ );
+ const { listCapIdsInView } = await import("@/actions/caps/list-view-ids");
+ const { orgId, ownerId } = await createOrg();
+ const otherId = await addMember(orgId);
+ const at = (minute: number) => ({
+ createdAt: new Date(Date.UTC(2026, 0, 1, 0, minute)),
+ });
+ const videoIds = [
+ await createVideo(ownerId, orgId, at(1)),
+ await createVideo(ownerId, orgId, at(4)),
+ ];
+ const imageIds = [
+ await createVideo(ownerId, orgId, { ...at(2), isScreenshot: true }),
+ ];
+ const noteIds = [
+ await createVideo(ownerId, orgId, { ...at(3), isNote: true }),
+ await createVideo(ownerId, orgId, { ...at(5), isNote: true }),
+ ];
+ await createVideo(ownerId, orgId, {
+ ...at(6),
+ archivedAt: new Date(),
+ });
+ await createVideo(ownerId, orgId, {
+ ...at(7),
+ isNote: true,
+ folderId: id() as never,
+ });
+ await createVideo(otherId, orgId, { ...at(8), isNote: true });
+ fixture.sessionUserId = ownerId;
+ const expected = {
+ videos: videoIds.toReversed(),
+ images: imageIds,
+ notes: noteIds.toReversed(),
+ };
+
+ for (const kind of ["videos", "images", "notes"] as const) {
+ const page = await CapsPageView({
+ searchParams: {},
+ view: "library",
+ kind,
+ });
+ expect(
+ page.props.data.map((cap: { id: string }) => cap.id),
+ kind,
+ ).toEqual(expected[kind]);
+ expect(page.props.count, kind).toBe(expected[kind].length);
+ expect(
+ (await listCapIdsInView({ type: "personal", kind })).ids,
+ ).toEqual(expected[kind]);
+ }
+
+ const overview = await CapsPageView({
+ searchParams: {},
+ view: "library",
+ });
+ expect(
+ overview.props.data.map((cap: { id: string }) => cap.id).sort(),
+ ).toEqual([...videoIds, ...imageIds, ...noteIds].sort());
+ expect(overview.props.counts).toEqual({ videos: 2, images: 1, notes: 2 });
+ expect(overview.props.archivedCount).toBe(1);
+ });
+
it("counts comments and lists each shared organization once on My Caps", async () => {
const { CapsPageView } = await import(
"@/app/(org)/dashboard/caps/caps-page-data"
diff --git a/apps/web/__tests__/integration/meetings-share-database.test.ts b/apps/web/__tests__/integration/meetings-share-database.test.ts
new file mode 100644
index 00000000000..f09757568ab
--- /dev/null
+++ b/apps/web/__tests__/integration/meetings-share-database.test.ts
@@ -0,0 +1,337 @@
+import { randomUUID } from "node:crypto";
+import * as Db from "@cap/database/schema";
+import { eq, inArray } from "drizzle-orm";
+import { drizzle, type MySql2Database } from "drizzle-orm/mysql2";
+import type { Effect } from "effect";
+import { createPool, type Pool } from "mysql2/promise";
+import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
+
+const fixture = vi.hoisted(() => ({
+ database: undefined as unknown,
+ storageListed: [] as string[],
+}));
+
+vi.mock("server-only", () => ({}));
+vi.mock("@cap/database", async (importOriginal) => ({
+ ...(await importOriginal
- No videos or screenshots match{" "}
+ No videos, images or notes match{" "}
“{query.trim()}”
diff --git a/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx b/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx
index 6b6ea844e82..cf119819864 100644
--- a/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx
+++ b/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx
@@ -29,6 +29,7 @@ import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import {
cloneElement,
+ Fragment,
type RefObject,
useCallback,
useEffect,
@@ -41,6 +42,7 @@ import { NewOrganization } from "@/components/forms/NewOrganization";
import { SignedImageUrl } from "@/components/SignedImageUrl";
import { Tooltip } from "@/components/Tooltip";
import { UsageButton } from "@/components/UsageButton";
+import { CAP_KIND_LABEL, CAP_KINDS, capKindHref } from "@/lib/cap-kind";
import { canUseInfra } from "@/lib/infra-access";
import { INFRA_BASE_PATH } from "@/lib/infra-routes";
import {
@@ -73,7 +75,8 @@ interface Props {
const AdminNavItems = ({ toggleMobileNav }: Props) => {
const pathname = usePathname();
const [open, setOpen] = useState(false);
- const { user, sidebarCollapsed, userCapsCount } = useDashboardContext();
+ const { user, sidebarCollapsed, userCapsCount, userCapKindCounts } =
+ useDashboardContext();
const showDeveloperDashboard =
buildEnv.NEXT_PUBLIC_IS_CAP === "true" && canUseInfra(user.email);
@@ -81,33 +84,38 @@ const AdminNavItems = ({ toggleMobileNav }: Props) => {
buildEnv.NEXT_PUBLIC_IS_CAP &&
user.email.toLowerCase() === MESSENGER_ADMIN_EMAIL;
+ const noSubNav: { name: string; href: string; count?: number }[] = [];
const manageNavigation = [
{
name: "My Caps",
href: `/dashboard/caps`,
extraText: userCapsCount,
icon:
+ {kind === "videos"
+ ? "No videos yet"
+ : "No images yet"}
+
+ {kind === "videos"
+ ? "Record or upload a video and it shows up here."
+ : "Screenshots you take with Cap show up here."}
+ Download Download Duplicate Duplicate Edit video
+ {excerpt}
+
+ {formatDuration(duration)}
+ "],
+ meetingStartedAt: null,
+ duration: 120,
+ ownerName: "",
+ }),
+ );
+
+describe("shared note markdown", () => {
+ it("shows markup in a note as text, never as elements", () => {
+ const html = render(
+ [
+ "",
+ '
',
+ '',
+ 'raw',
+ "",
+ ].join("\n\n"),
+ "",
+ );
+
+ expect(html).not.toMatch(/<(script|img|iframe|style|svg)\b/i);
+ expect(html.replace(/"[^"]*"/g, '""')).not.toMatch(
+ /<[a-z][^>]*\son[a-z]+=/i,
+ );
+ expect(html).not.toMatch(/ {
+ const html = render(
+ [
+ "",
+ "[run](javascript:alert(1))",
+ "[data](data:text/html;base64,PHNjcmlwdD4=)",
+ "[vb](vbscript:msgbox(1))",
+ "[site](https://example.com/page)",
+ ].join("\n\n"),
+ );
+
+ expect(html).not.toMatch(/ {
+ const html = render("- [x] Done\n- [ ] Next");
+
+ expect(html).not.toMatch(/ ({
+ row: null as Record
+ Record your meetings in the Cap desktop app +
++ Cap takes the notes. Share one and it shows up here. +
+