Commit Graph
65 Commits
Author SHA1 Message Date
MythEclipseandClaude Opus 4.8 314d2baec4 feat(voice): implement full voice transmit (Browser → Discord)
Frontend (useAudioTransmit.ts):
- Capture microphone via getUserMedia
- Convert Float32 to Int16 PCM at 24kHz mono
- Base64 encode and send as JSON via WebSocket
- Send voice:transmit:start/stop commands on start/stop

Backend (ws/server.ts):
- Handle voice_transmit messages from browser
- Forward PCM data to Redis channel backend:voice:transmit
- Handle voice_command messages and forward to backend:command
- discord-gateway VoiceTransmitter receives and plays to voice channel

Flow:
   Browser Mic → getUserMedia → ScriptProcessor → Int16 PCM → base64 →
   WebSocket JSON → Backend → Redis → VoiceTransmitter → Discord Voice Channel

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 21:29:41 +07:00
MythEclipseandClaude Opus 4.8 2e9e9c1a06 fix(frontend): handle voice PCM data as JSON instead of binary
- Add onVoicePcmData and onVoiceActiveUser handlers to WebSocket interface
- Add voice_pcm_data and voice_active_user event cases in socket message handler
- Update useAudioPlayback to decode base64 PCM from JSON format
- Connect onVoicePcmData to audio.handleIncomingPcm in App.tsx

Format change:
- Old: Binary (4 bytes userId + PCM buffer)
- New: JSON {userId: string, pcm: base64string}

This matches the format sent by discord-gateway via Redis.
Now PCM audio will flow correctly: Discord → Gateway → Redis → Backend → WebSocket → Browser!

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 21:22:00 +07:00
MythEclipse e00b23f9b8 fix(concurrency): eliminate all identified double-queue and race conditions
Implements full audit from double_queue_audit.md.

## Critical

fix(backend): reanalyze-batch — per-scope in-flight guard (messages.routes.ts)
  Two concurrent admin sessions clicking 'Retry All Errors' simultaneously now
  get a 409 REANALYZE_BATCH_IN_PROGRESS for the same guildId:channelId scope.
  Prevents the recovery worker from being triggered twice for the same set of
  error messages.

fix(discord-gateway): messageUpdate embed resolution skip (messageCapture.ts)
  Discord fires messageUpdate when link previews resolve 1-2s after send
  even though the message body is unchanged. Compare newContent vs
  existingContent before resetting ai_status to pending and re-queueing LLM.
  Eliminates a spurious duplicate analysis that could overwrite a valid result.

## High

fix(discord-gateway): scheduleAutoDelete idempotency (aiAnalyzer.ts)
  Add autoDeleteInFlight Set. Both processBatch and processIndividualFallback
  call scheduleAutoDelete; without the guard, a message that races through
  both paths launches two concurrent attemptAutoDeleteFlaggedMessage calls,
  producing a duplicate moderation-action log entry and a Discord 10008 error.
  The Set is cleaned up in a .finally() block after each attempt completes.

## Medium

fix(frontend): revert optimistic pending state on HTTP failure (useMessages.ts)
  Capture the prior MessageRecord inside the setMessages functional updater
  (no extra useCallback deps needed). If reanalyzeMessage() throws, restore
  the snapshot so the UI reflects the real DB state instead of lying.

fix(discord-gateway): exclude individual_analysis_exhausted from recovery queries
  Both getConversationKeysWithIncompleteAnalysis and
  getIncompleteMessagesByConversation now add a NOT LIKE guard for
  individual_analysis_exhausted. Prevents an infinite recovery loop if a bug
  ever writes both flags to the same row.

## Low

fix(discord-gateway): unified timer path in scheduleConversationAnalysis
  Remove the separate cooldown-path that created a secondary timer calling
  scheduleConversationAnalysis recursively. Replace with a single
  clear-and-reset pattern where delayMs = max(cooldownRemainder+500, debounce).
  Eliminates the edge case where both timers were live simultaneously.

## Misc

fix(backend): cast req.params.id to String() to satisfy Express typings
  Pre-existing tsc error (string | string[]) exposed by our edit.
  String() is correct; route params are always scalar strings at runtime.
2026-06-05 16:09:23 +07:00
MythEclipse 0a35e83a6c refactor(analytics): replace hardcoded color tokens with theme-aware CSS variables 2026-06-04 14:17:45 +07:00
MythEclipse 3ecb7bd15c chore: session auto-commit 2026-06-04 14:16:59 +07:00
MythEclipse 458f20d5c3 chore: session auto-commit 2026-06-04 14:16:26 +07:00
MythEclipse ad61af54e8 refactor(analytics): replace TrendChart gradient bars with interactive SVG line chart featuring tooltips and grid lines 2026-06-04 14:15:56 +07:00
MythEclipse ceb5fc95ba refactor(analytics): replace gradient bars with interactive SVG donut and horizontal bar charts 2026-06-04 14:15:27 +07:00
MythEclipse 00001973d8 refactor(analytics): replace ActivityChart stacked bars with interactive SVG chart featuring tooltips and grid lines 2026-06-04 14:14:49 +07:00
MythEclipse a24a5e7dfd refactor(messages): remove text channel filter and channel-section grouping 2026-06-03 20:53:47 +07:00
MythEclipse 2a2003e638 fix(messages): hide fallback attachment text when media is already displayed visually 2026-06-03 20:42:57 +07:00
MythEclipse b38f867894 refactor(messages): mark emptyText prop as unused
Rename emptyText to _emptyText to indicate it is currently unused in the
MessageFeed component, preventing linting warnings.
2026-06-03 20:38:01 +07:00
MythEclipse 198d5a6329 feat(messages): group message feed by channel and thread sections 2026-06-03 20:34:58 +07:00
MythEclipse 71801b7f77 feat(messages): show channel and thread location context in message cards 2026-06-03 20:34:06 +07:00
MythEclipse 79c2e31b17 feat(messages): add text channel filtering for message browser 2026-06-03 20:31:23 +07:00
MythEclipse a39c7a91c2 refactor(api): replace URLSearchParams param with structured object in listMessages 2026-06-03 20:29:34 +07:00
MythEclipse 2bf48f6cd0 refactor(ui): remove mascot tooltip from sidebar component
Removes the hardcoded mascot tooltip implementation from the Sidebar
component to clean up the component structure. The tooltip logic is
now handled elsewhere.
2026-06-03 20:09:45 +07:00
MythEclipse 4e12394168 fix: add error handling to analytics getTopics query and fix mascot tooltip positioning 2026-06-03 19:50:26 +07:00
MythEclipse 3c130bf813 fix(ui): adjust mascot tooltip positioning and bubble pointer
Changes the mascot tooltip from a fixed bottom-left position to an absolute
centered position above the sidebar. Updates the decorative pointer
elements to use a downward-pointing triangle clip-path instead of a
side-aligned shape.
2026-06-03 19:41:39 +07:00
MythEclipse 6a8a84fd84 fix(mascot-chat): reposition tooltip to fixed bottom-left and show when sidebar collapsed 2026-06-03 19:39:58 +07:00
MythEclipse 30b07e2c63 fix(sidebar): hide mascot animation when sidebar is collapsed 2026-06-03 18:36:38 +07:00
MythEclipse 01eaf7275b refactor(mascot): remove useMascotSummary integration from sidebar 2026-06-03 18:29:54 +07:00
MythEclipse b5a218daa1 style(analytics): format JSX and object literals consistently 2026-06-03 18:27:41 +07:00
MythEclipse b8979cbee1 feat(analytics): add AI distribution and attachment stats panels 2026-06-03 18:19:41 +07:00
MythEclipse 1669614735 feat(analytics): add warned status tracking to summary cards, trend chart, and violator table 2026-06-03 18:18:27 +07:00
MythEclipse caa9ecca63 feat(analytics): add AI stats, attachment stats, and moderation actions queries to useAnalytics hook 2026-06-03 18:17:25 +07:00
MythEclipse f1bc36d6d8 feat(analytics): add moderation actions, AI stats, and attachment stats endpoints 2026-06-03 18:16:55 +07:00
MythEclipseandClaude Opus 4.8 acf6c931e0 feat(messages): show AI analysis always expanded without toggle
- Remove collapsible toggle for AI analysis section
- Always show ai_analysis content inline
- Clean up unused ChevronDown/ChevronUp imports and showAnalysis state
- Simplify layout with flex layout instead of button + conditional div

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 18:04:08 +07:00
MythEclipseandClaude Opus 4.8 3a5e9212d9 fix(sidebar): move mascot chatbot outside framer-motion nav to fix click interaction
- Move MascotChatbot outside motion.nav to avoid framer-motion stacking context break
- Use fixed positioning with z-[9999] for reliable interaction
- Wrap sidebar return with Fragment for multiple root elements
- Add border tail to chat bubble with two-layer clip-path (outer border, inner fill)
- Fix tail direction to point bottom-left toward mascot

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 17:50:11 +07:00
MythEclipse a0029183d3 style(sidebar): improve mascot tooltip arrow appearance
Replace the clip-path based triangle with a CSS border-based implementation to create a more refined arrow with a border effect.
2026-06-03 16:07:26 +07:00
MythEclipse 7f1fd93afb refactor(sidebar): update mascot tooltip arrow styling and positioning 2026-06-03 15:23:35 +07:00
MythEclipse d4f67bf013 refactor(sidebar): adjust mascot tooltip arrow position and border direction 2026-06-03 15:17:54 +07:00
MythEclipse cdc4a2ea37 refactor(sidebar): move mascot chat tooltip outside button and add persistent visibility state 2026-06-03 15:14:38 +07:00
MythEclipse f303b04684 refactor(mascot): simplify chat visibility logic and add persistent chat mode 2026-06-03 15:08:31 +07:00
MythEclipse 7904d7f38d ``` 2026-06-03 15:01:34 +07:00
MythEclipse 84d1b55113 feat(mascot): integrate mascot chatbot with AI-powered responses in sidebar 2026-06-03 14:34:28 +07:00
MythEclipse 9f454b57bb feat(mascot): add AI-powered chat insights to sidebar mascot with useMascotSummary hook 2026-06-03 14:17:21 +07:00
MythEclipse bb65178210 refactor(mascot): replace ChibiMascot SVG with MascotImage PNG and simplify empty states 2026-06-03 13:56:11 +07:00
MythEclipse 2ea0ea5810 chore(frontend): update logo source and add mascot to sidebar
Update the favicon and sidebar logo to use remote URLs from the GitHub repository. Add a mascot image to the sidebar that is only visible when the sidebar is expanded.
2026-06-03 13:50:08 +07:00
MythEclipse b08ed237c6 refactor(messages): group messages by user and refactor card layout into header + rows 2026-06-03 03:33:30 +07:00
MythEclipse 4a1c7925fe style(frontend): organize imports alphabetically and improve code formatting 2026-06-03 03:21:20 +07:00
MythEclipse 115dacb997 style(frontend): refactor analytics components with sky palette, semantic tokens, and visual polish 2026-06-03 03:20:07 +07:00
MythEclipse e8deba93cc style(frontend): refactor UI components with sky color palette, improved spacing, and design polish 2026-06-03 03:18:04 +07:00
MythEclipse 20681ef308 Which direction fits your commit philosophy better? 2026-06-03 03:16:06 +07:00
MythEclipse e2003cd9f6 style(frontend): refactor UI components with rounded corners, light theme, and design polish 2026-06-03 03:12:14 +07:00
MythEclipse caee0c692a feat(frontend): add ChibiMascot component with animation variants 2026-06-03 03:08:36 +07:00
MythEclipse 3802ca357f feat(frontend): refactor ParticleBackground for performance and type safety 2026-06-03 03:07:51 +07:00
MythEclipse 0d83ada0ef feat(frontend): add ParticleBackground component with sakura petals and mouse-tracked sparkles 2026-06-03 03:06:41 +07:00
MythEclipse 09119ef1c2 feat(frontend): add useGsapTransition hook for page animations with reduced motion support 2026-06-03 03:04:17 +07:00
MythEclipse b667805ff3 style: add light theme tokens and framer motion variants 2026-06-03 03:02:00 +07:00