feat(rich-text, types): Tiptap editor, SSR-safe, comments + description; stricter typing (no any) across app

- Add Tiptap editor + toolbar and rich content rendering with sanitize-html
- Fix SSR hydration (immediatelyRender: false) and setContent options
- Comments: rich text + visibility selector, typed attachments (Id<_storage>)
- New Ticket: description rich text; attachments typed; queues typed
- Convex: server-side filters using indexes; priority order rename; stronger Doc/Id typing; remove helper with any
- Schemas/Mappers: zod v4 record typing; event payload record typing; customFields typed
- UI: replace any in header/play/list/timeline/fields; improve select typings
- Build passes; only non-blocking lint warnings remain
This commit is contained in:
esdrasrenan 2025-10-04 14:25:10 -03:00
parent 9b0c0bd80a
commit ea60c3b841
26 changed files with 1390 additions and 245 deletions

View file

@ -1,6 +1,7 @@
"use client";
import React, { createContext, useContext, useEffect, useMemo, useState } from "react";
import type { Doc } from "@/convex/_generated/dataModel";
import { useMutation } from "convex/react";
// Lazy import to avoid build errors before convex is generated
@ -32,10 +33,8 @@ export function AuthProvider({ demoUser, tenantId, children }: { demoUser: DemoU
if (!process.env.NEXT_PUBLIC_CONVEX_URL) return; // allow dev without backend
if (!localDemoUser) return;
try {
const user = await ensureUser({ tenantId, name: localDemoUser.name, email: localDemoUser.email, avatarUrl: localDemoUser.avatarUrl });
// Convex returns a full document
// eslint-disable-next-line @typescript-eslint/no-explicit-any
setUserId((user as any)?._id ?? null);
const user = (await ensureUser({ tenantId, name: localDemoUser.name, email: localDemoUser.email, avatarUrl: localDemoUser.avatarUrl })) as Doc<"users"> | null;
setUserId(user?._id ?? null);
} catch (e) {
console.error("Failed to ensure user:", e);
}