From 4584d42cb3339109be3a5fe2911a834da4bcd2a8 Mon Sep 17 00:00:00 2001 From: Opti1337 Date: Sat, 25 Jul 2026 00:36:27 +0600 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=B0=D0=BA=D0=B8=D0=B5-=D1=82=D0=BE=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=BA=D0=BE=D0=BB=D1=8B,=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BC=D0=BD=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- new-client/.claude/settings.local.json | 4 +- new-client/package.json | 2 + new-client/src/app/bootstrap/signaling.ts | 24 +++- .../channel/ui/CreateChannelDialog.vue | 9 +- .../src/entities/client/ui/ClientRow.vue | 93 +++++++++++++++ new-client/src/pages/auth/login.vue | 2 +- new-client/src/pages/auth/register.vue | 2 +- .../src/shared/components/ui/Avatar.vue | 30 ++++- .../src/shared/components/ui/Button.vue | 102 +++++++++++----- new-client/src/shared/components/ui/Card.vue | 18 +-- new-client/src/shared/components/ui/Input.vue | 18 ++- .../components/ui/NotificationBadge.vue | 4 +- .../shared/components/ui/PasswordInput.vue | 13 ++- .../src/shared/components/ui/Slider.vue | 86 ++++++++++++++ .../src/shared/components/ui/Spinner.vue | 6 +- .../src/shared/components/ui/Switch.vue | 90 ++++++++++++++ new-client/src/shared/components/ui/Tag.vue | 10 +- .../src/shared/components/ui/ToBottom.vue | 5 +- .../src/shared/components/ui/Toggle.vue | 7 +- .../src/shared/composables/use-event-bus.ts | 6 +- new-client/src/shared/layouts/Default.vue | 14 ++- new-client/src/shared/styles/animations.scss | 8 ++ new-client/src/shared/styles/main.scss | 1 + new-client/src/shared/styles/mixins.scss | 1 - .../src/shared/styles/mixins/animations.scss | 11 ++ .../src/shared/styles/mixins/index.scss | 2 + .../src/widgets/channel-list/ui/Channel.vue | 110 ++++++++++++++---- .../src/widgets/chat/ui/ChatAttachment.vue | 21 +--- new-client/src/widgets/chat/ui/ChatInput.vue | 2 + .../src/widgets/chat/ui/ChatMessages.vue | 7 +- new-client/vite.config.ts | 2 +- new-client/yarn.lock | 62 ++++++++++ 32 files changed, 647 insertions(+), 125 deletions(-) create mode 100644 new-client/src/entities/client/ui/ClientRow.vue create mode 100644 new-client/src/shared/components/ui/Slider.vue create mode 100644 new-client/src/shared/components/ui/Switch.vue create mode 100644 new-client/src/shared/styles/animations.scss delete mode 100644 new-client/src/shared/styles/mixins.scss create mode 100644 new-client/src/shared/styles/mixins/animations.scss create mode 100644 new-client/src/shared/styles/mixins/index.scss diff --git a/new-client/.claude/settings.local.json b/new-client/.claude/settings.local.json index 1c53390..564e78b 100644 --- a/new-client/.claude/settings.local.json +++ b/new-client/.claude/settings.local.json @@ -1,7 +1,9 @@ { "permissions": { "allow": [ - "Bash(python -c \"import sys,json; p=json.load\\(sys.stdin\\); deps={**p.get\\('dependencies',{}\\), **p.get\\('devDependencies',{}\\)}; [print\\(k,v\\) for k in sorted\\(deps\\) if any\\(x in k for x in ['mediasoup','socket','vueuse','vue']\\)]\")" + "Bash(python -c \"import sys,json; p=json.load\\(sys.stdin\\); deps={**p.get\\('dependencies',{}\\), **p.get\\('devDependencies',{}\\)}; [print\\(k,v\\) for k in sorted\\(deps\\) if any\\(x in k for x in ['mediasoup','socket','vueuse','vue']\\)]\")", + "Bash(yarn vue-tsc *)", + "Bash(yarn eslint *)" ] } } diff --git a/new-client/package.json b/new-client/package.json index 36da842..1c724b0 100644 --- a/new-client/package.json +++ b/new-client/package.json @@ -24,6 +24,8 @@ "@zag-js/file-upload": "^1.41.0", "@zag-js/file-utils": "^1.40.0", "@zag-js/password-input": "^1.40.0", + "@zag-js/slider": "^1.41.2", + "@zag-js/switch": "^1.41.1", "@zag-js/toggle": "^1.40.0", "@zag-js/vue": "^1.40.0", "date-fns": "^4.1.0", diff --git a/new-client/src/app/bootstrap/signaling.ts b/new-client/src/app/bootstrap/signaling.ts index c866853..f9013a1 100644 --- a/new-client/src/app/bootstrap/signaling.ts +++ b/new-client/src/app/bootstrap/signaling.ts @@ -1,4 +1,4 @@ -import type { ChatMessage } from '@shared/api/generated-chad-api.ts' +import type { Channel, ChatMessage } from '@shared/api/generated-chad-api.ts' import { useAuth } from '@shared/composables/use-auth.ts' import { useClients } from '@shared/composables/use-clients' import { useEventBus } from '@shared/composables/use-event-bus.ts' @@ -12,12 +12,10 @@ export default function () { const { addClient, updateClient, removeClient, clear: clearClients } = useClients() const eventBus = useEventBus() - watch(signaling.connected, (connected) => { - if (!connected) + watch(signaling.socket, (socket) => { + if (!socket) return - const socket = signaling.socket.value! - socket.on('initialized', async ({ clients }) => { addClient(...clients) }) @@ -42,6 +40,22 @@ export default function () { socket.on('chat:new-message', (message: ChatMessage) => { eventBus.emit('chat:new-message', message) }) + + socket.on('channel-created', async (channel: Channel) => { + eventBus.emit('channel:created', channel) + + await queryClient.setQueryData(['channel-list'], (channels: Channel[]) => { + return [...channels, channel] + }) + }) + + socket.on('channel-removed', async (channelId: Channel['id']) => { + eventBus.emit('channel:removed', channelId) + + await queryClient.setQueryData(['channel-list'], (channels: Channel[]) => { + return channels.filter(channel => channel.id !== channelId) + }) + }) }) watchEffect(() => { diff --git a/new-client/src/entities/channel/ui/CreateChannelDialog.vue b/new-client/src/entities/channel/ui/CreateChannelDialog.vue index 93dde6b..88a4246 100644 --- a/new-client/src/entities/channel/ui/CreateChannelDialog.vue +++ b/new-client/src/entities/channel/ui/CreateChannelDialog.vue @@ -1,9 +1,10 @@