Files
colanode/packages/ui/src/components/messages/message-container.tsx

48 lines
1.4 KiB
TypeScript
Raw Normal View History

Web version (#43) * Create client package * Create the UI package * Init web app * Use isomorphic 'ws' for web sockets * File and asset implementations * Use Opfs SAH version of sqlite in browser * Generate Svg sprites for emojis and icons * Include emojis sprite * Improve and refactor assets * More assets improvements * Implement emoji and icons db import as readonly * Improve import paths * Handle concurrency limits for sqlite * Fix event broadcast in web * Pass windowId for subscribe and unsubscribe queries in desktop * Remove asset context * Implement avatar upload/download with the new structure * Improve file handlings * Move the necessary dependencies to client and ui packages * Update packages * Improve open file dialog * Make sure database files are deleted in browser * Improve avatar loading * Improve file loading * Fix some assets * Implement asset caching for offline access * Small fixes and improvements * Use server instead of pre signed urls for file upload/download * Cleanup some client related metadata * Switch Axios with ky * Refactor mutation results * Minor concurrency fix * Refactor web sockets * Improve file uploading * Handle connection close on server * Use stream for downloading the file * Add config options for cors * Update document in all tabs on local change * Include necessary icons for web * Update docker compose * Implement server upgrade required component * Use correct client type and platform in web and desktop * Improve service worker * Improve versioning * Fix an import * Minor fixes * Update some user endpoints * Minor endpoint changes * Enable app badge for desktop * Add error handling in some database operations * Update mutation naming convention * Update query naming convention * Update event and some metadata naming conventions * Update event and job naming conventions in server * Update Github workflow files * Restructure assets directory * Update packages * Upgrade to Zod v4 * Upgrade to react 19 * Upgrade to tailwind v4 * Minor ui improvements * Fix some cursor pointers * Add browser not supported message in web * Enhance server create flow, allow insecure connections and custom api paths * Execute electron-rebuild as postinstall command * Update docker compose
2025-06-11 00:14:17 +02:00
import { LocalMessageNode } from '@colanode/client/types';
Implement new routing with tanstack router and mobile app kickoff (#248) * Init mobile app * Minor fixes and improvements * Improve assets loading * Fix event bus proxy * Improve emojis and icons loading * Improve app initialization in web * Init tanstack router * Refactor components * Refactor some more components * Refactor layouts * Improve routing * Improve routing * Routing improvements * Make sidebar work in mobile * Refactor container and breadcrumb * Fix some packages and warnings * Encode and decode yjs update for ipc communication * Refactor servers in client * Fix some errors and warnings in editor and sidebar * Add route masking for web * Improve container layout * Improve ui for mobile * Improve mobile ui * Create custom link component * Router improvements * Implement tabs for desktop * tabs improvements * Refactor routes * Layout improvements * Improve desktop tabs * Use tanstack-db for global collections * Improve tanstack db collections * Refactor workspaces and accounts databases and routes locally * Use tanstackdb for users * Use tanstackdb for uploads and downloads * Use tanstackdb for temp files * Rename database to collections * Improve tabs * Fix packages * Improve local file handling * Rename sync cursor keys * Save some bootstrap data in a file * Reset all data on new version update in desktop * Minor refactor * Implement app reset on startup * UI fixes and improvements * More Ui improvements * Fix logout * Add tab in route contexts for workspace routes * Store last used workspace id as metadata * Fix account logout * Fix file preview * Fix file thumbnail loading in tabs * Fix chat tab loading * Fix some redirect handling * Disable staletime for icon.svg.get query * Fix not found pages and throws * add readme for mobile * fix some keys * Improve add tab handler * Fix path
2025-11-11 07:00:14 -08:00
import { Breadcrumb } from '@colanode/ui/components/workspaces/breadcrumbs/breadcrumb';
Web version (#43) * Create client package * Create the UI package * Init web app * Use isomorphic 'ws' for web sockets * File and asset implementations * Use Opfs SAH version of sqlite in browser * Generate Svg sprites for emojis and icons * Include emojis sprite * Improve and refactor assets * More assets improvements * Implement emoji and icons db import as readonly * Improve import paths * Handle concurrency limits for sqlite * Fix event broadcast in web * Pass windowId for subscribe and unsubscribe queries in desktop * Remove asset context * Implement avatar upload/download with the new structure * Improve file handlings * Move the necessary dependencies to client and ui packages * Update packages * Improve open file dialog * Make sure database files are deleted in browser * Improve avatar loading * Improve file loading * Fix some assets * Implement asset caching for offline access * Small fixes and improvements * Use server instead of pre signed urls for file upload/download * Cleanup some client related metadata * Switch Axios with ky * Refactor mutation results * Minor concurrency fix * Refactor web sockets * Improve file uploading * Handle connection close on server * Use stream for downloading the file * Add config options for cors * Update document in all tabs on local change * Include necessary icons for web * Update docker compose * Implement server upgrade required component * Use correct client type and platform in web and desktop * Improve service worker * Improve versioning * Fix an import * Minor fixes * Update some user endpoints * Minor endpoint changes * Enable app badge for desktop * Add error handling in some database operations * Update mutation naming convention * Update query naming convention * Update event and some metadata naming conventions * Update event and job naming conventions in server * Update Github workflow files * Restructure assets directory * Update packages * Upgrade to Zod v4 * Upgrade to react 19 * Upgrade to tailwind v4 * Minor ui improvements * Fix some cursor pointers * Add browser not supported message in web * Enhance server create flow, allow insecure connections and custom api paths * Execute electron-rebuild as postinstall command * Update docker compose
2025-06-11 00:14:17 +02:00
import { Message } from '@colanode/ui/components/messages/message';
import { MessageNotFound } from '@colanode/ui/components/messages/message-not-found';
Implement new routing with tanstack router and mobile app kickoff (#248) * Init mobile app * Minor fixes and improvements * Improve assets loading * Fix event bus proxy * Improve emojis and icons loading * Improve app initialization in web * Init tanstack router * Refactor components * Refactor some more components * Refactor layouts * Improve routing * Improve routing * Routing improvements * Make sidebar work in mobile * Refactor container and breadcrumb * Fix some packages and warnings * Encode and decode yjs update for ipc communication * Refactor servers in client * Fix some errors and warnings in editor and sidebar * Add route masking for web * Improve container layout * Improve ui for mobile * Improve mobile ui * Create custom link component * Router improvements * Implement tabs for desktop * tabs improvements * Refactor routes * Layout improvements * Improve desktop tabs * Use tanstack-db for global collections * Improve tanstack db collections * Refactor workspaces and accounts databases and routes locally * Use tanstackdb for users * Use tanstackdb for uploads and downloads * Use tanstackdb for temp files * Rename database to collections * Improve tabs * Fix packages * Improve local file handling * Rename sync cursor keys * Save some bootstrap data in a file * Reset all data on new version update in desktop * Minor refactor * Implement app reset on startup * UI fixes and improvements * More Ui improvements * Fix logout * Add tab in route contexts for workspace routes * Store last used workspace id as metadata * Fix account logout * Fix file preview * Fix file thumbnail loading in tabs * Fix chat tab loading * Fix some redirect handling * Disable staletime for icon.svg.get query * Fix not found pages and throws * add readme for mobile * fix some keys * Improve add tab handler * Fix path
2025-11-11 07:00:14 -08:00
import { NodeBreadcrumb } from '@colanode/ui/components/nodes/node-breadcrumb';
Web version (#43) * Create client package * Create the UI package * Init web app * Use isomorphic 'ws' for web sockets * File and asset implementations * Use Opfs SAH version of sqlite in browser * Generate Svg sprites for emojis and icons * Include emojis sprite * Improve and refactor assets * More assets improvements * Implement emoji and icons db import as readonly * Improve import paths * Handle concurrency limits for sqlite * Fix event broadcast in web * Pass windowId for subscribe and unsubscribe queries in desktop * Remove asset context * Implement avatar upload/download with the new structure * Improve file handlings * Move the necessary dependencies to client and ui packages * Update packages * Improve open file dialog * Make sure database files are deleted in browser * Improve avatar loading * Improve file loading * Fix some assets * Implement asset caching for offline access * Small fixes and improvements * Use server instead of pre signed urls for file upload/download * Cleanup some client related metadata * Switch Axios with ky * Refactor mutation results * Minor concurrency fix * Refactor web sockets * Improve file uploading * Handle connection close on server * Use stream for downloading the file * Add config options for cors * Update document in all tabs on local change * Include necessary icons for web * Update docker compose * Implement server upgrade required component * Use correct client type and platform in web and desktop * Improve service worker * Improve versioning * Fix an import * Minor fixes * Update some user endpoints * Minor endpoint changes * Enable app badge for desktop * Add error handling in some database operations * Update mutation naming convention * Update query naming convention * Update event and some metadata naming conventions * Update event and job naming conventions in server * Update Github workflow files * Restructure assets directory * Update packages * Upgrade to Zod v4 * Upgrade to react 19 * Upgrade to tailwind v4 * Minor ui improvements * Fix some cursor pointers * Add browser not supported message in web * Enhance server create flow, allow insecure connections and custom api paths * Execute electron-rebuild as postinstall command * Update docker compose
2025-06-11 00:14:17 +02:00
import { ConversationContext } from '@colanode/ui/contexts/conversation';
import { useNodeContainer } from '@colanode/ui/hooks/use-node-container';
import { useNodeRadar } from '@colanode/ui/hooks/use-node-radar';
2025-02-19 19:11:46 +01:00
interface MessageContainerProps {
messageId: string;
}
export const MessageContainer = ({ messageId }: MessageContainerProps) => {
const data = useNodeContainer<LocalMessageNode>(messageId);
useNodeRadar(data.node);
if (data.isPending) {
return null;
}
if (!data.node) {
return <MessageNotFound />;
}
return (
Implement new routing with tanstack router and mobile app kickoff (#248) * Init mobile app * Minor fixes and improvements * Improve assets loading * Fix event bus proxy * Improve emojis and icons loading * Improve app initialization in web * Init tanstack router * Refactor components * Refactor some more components * Refactor layouts * Improve routing * Improve routing * Routing improvements * Make sidebar work in mobile * Refactor container and breadcrumb * Fix some packages and warnings * Encode and decode yjs update for ipc communication * Refactor servers in client * Fix some errors and warnings in editor and sidebar * Add route masking for web * Improve container layout * Improve ui for mobile * Improve mobile ui * Create custom link component * Router improvements * Implement tabs for desktop * tabs improvements * Refactor routes * Layout improvements * Improve desktop tabs * Use tanstack-db for global collections * Improve tanstack db collections * Refactor workspaces and accounts databases and routes locally * Use tanstackdb for users * Use tanstackdb for uploads and downloads * Use tanstackdb for temp files * Rename database to collections * Improve tabs * Fix packages * Improve local file handling * Rename sync cursor keys * Save some bootstrap data in a file * Reset all data on new version update in desktop * Minor refactor * Implement app reset on startup * UI fixes and improvements * More Ui improvements * Fix logout * Add tab in route contexts for workspace routes * Store last used workspace id as metadata * Fix account logout * Fix file preview * Fix file thumbnail loading in tabs * Fix chat tab loading * Fix some redirect handling * Disable staletime for icon.svg.get query * Fix not found pages and throws * add readme for mobile * fix some keys * Improve add tab handler * Fix path
2025-11-11 07:00:14 -08:00
<>
<Breadcrumb>
<NodeBreadcrumb breadcrumb={data.breadcrumb} />
</Breadcrumb>
<ConversationContext.Provider
value={{
id: data.node.id,
role: data.role,
rootId: data.node.rootId,
canCreateMessage: true,
onReply: () => {},
onLastMessageIdChange: () => {},
canDeleteMessage: () => false,
}}
>
<Message message={data.node} />
</ConversationContext.Provider>
</>
2025-02-19 19:11:46 +01:00
);
};