Commit Graph
396 Commits
Author SHA1 Message Date
MythEclipseandClaude Opus 4.8 4117f83c1b fix(dashboard): infinite scroll, auto-refetch, analytics cache invalidation, remove topic row cap
Frontend:
- Cursor pagination (100/page) replacing hardcoded 80 message limit
- Removed .slice(0,200) cap on mergeMessages
- IntersectionObserver infinite scroll with skeleton loading
- 15s periodic refetch for message list sync

Backend:
- Removed LIMIT 2000 from topic trends SQL query
- Added invalidateAnalyticsCache on message capture (messageCreated)
- Added invalidateAnalyticsCache on batch analysis completion

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 18:14:32 +07:00
MythEclipse 5078b34ac2 fix: render custom emoji as images and feed to AI vision pipeline
- Extract custom emoji metadata with Discord CDN URLs
- Download and send emoji images to vision model for moderation analysis
- Render custom emoji as inline images in dashboard instead of raw <:name:id> text
- Add emoji vision cache with deterministic keying by emoji ID
- Add custom emoji vision prompt for context-aware moderation
2026-06-01 17:23:46 +07:00
MythEclipseandClaude Opus 4.8 f5507e01f6 refactor(frontend): major rebuild — feature-sliced architecture + bug fixes + glass-morphism UI
Architecture:
- Feature-sliced directory: entities/, shared/, features/, widgets/
- Consolidated API client (shared/api/client.ts) — all endpoints in one file
- Single WebSocket manager (shared/ws/socket.ts) with typed event bus
- Extracted hooks: useAudioPlayback, useAudioTransmit, useLocalStorage, useUIState
- UI primitives moved to shared/ui/ with barrel export
- Added Skeleton, Toast, MobileTabBar components

Bug fixes (8/8):
1. useMemo→useEffect in RecordingsSubPanel (async side-effect anti-pattern)
2. ArrayBuffer.slice() before WebSocket send (shared buffer bug)
3. Proper useEffect dependency arrays throughout
4. Stable React keys (no index fallbacks)
5. onReanalyze properly awaited (Promise<void> return)
6. monitorGuild memoized with useMemo
7. localStorage validation with shape checking
8. Deleted duplicate socket logic (ws/client.ts removed)

UI polish:
- Glass-morphism design tokens (backdrop-blur, translucent cards)
- Gradient mesh background with subtle radial overlays
- Expandable sidebar + mobile bottom tab bar
- Skeleton loading placeholders
- Audio visualizer with CSS pulse animation

Deleted: src/api/, src/components/, src/hooks/, src/types/, src/ws/, src/lib/
Added: 40 new files across feature-sliced structure

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 16:42:36 +07:00
MythEclipseandClaude Opus 4.8 1aab0d1df1 docs: frontend major refactor design document
Design for feature-sliced architecture, 8 bug fixes, and glass-morphism UI redesign.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 15:51:28 +07:00
MythEclipseandClaude Opus 4.6 23840e33a3 fix: install gnused and coreutils-full for native module scripts
The NixOS base image lacks sed and coreutils in PATH. Native Node.js
post-install scripts (node-pre-gyp, prebuild-install) require sed and
other core utilities. Installing gnused and coreutils-full provides the
necessary binaries for native module compilation.

Also switched back to single nix profile install call (instead of
sequential per-RUN) since all packages now reference the same pinned
nixpkgs commit, eliminating version drift conflicts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:52:26 +07:00
MythEclipseandClaude Opus 4.6 47bfbb278a fix: install coreutils for sed in NixOS container
The node-pre-gyp and prebuild-install wrapper scripts require sed, which
is not in PATH in the NixOS base container. Install coreutils first to
provide sed, dirname, basename, and other core utilities needed by
native module post-install scripts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:46:23 +07:00
MythEclipseandClaude Opus 4.6 c78a9618f8 fix: add .npmrc shamefully-hoist for native module compilation
pnpm's isolated store prevents native post-install scripts from finding
their dependency binaries (node-pre-gyp, prebuild-install). This causes
@discordjs/opus and @lng2004/node-datachannel to fail during pnpm install.

Enabling shamefully-hoist flattens node_modules so native scripts can
resolve their dependencies correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:42:33 +07:00
MythEclipseandClaude Opus 4.6 86853bbd4e fix: remove explicit cacert install to resolve version conflict
cacert 3.123 was installed first, but nodejs_22 pulls cacert 3.117 as a
transitive dependency, causing a file conflict on ca-bundle.crt.

Since all packages that need SSL certificates already pull cacert as a
dependency, installing it explicitly is redundant and causes conflicts.
Removing the explicit cacert install lets each package use its resolved
transitive cacert version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:38:55 +07:00
MythEclipseandClaude Opus 4.6 20ff930bb3 fix: install nix packages sequentially with pinned nixpkgs commit
Two issues were causing Docker build failures:
1. Invalid nixpkgs commit hash (404 on GitHub archive)
2. Installing packages simultaneously caused version conflicts
   (cacert 3.123 vs 3.117, git vs git-minimal)

Fix:
- Pin to valid nixos-unstable HEAD commit
- Install each package with sequential 'nix profile add' calls
  so each package resolves dependencies before the next installs
- Remove explicit git (git-minimal pulled by yt-dlp is sufficient)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:36:43 +07:00
MythEclipseandClaude Opus 4.6 8883f2bf3a fix: pin nixpkgs to specific commit for reproducible Docker builds
The nixos-unstable channel changes rapidly and causes file conflicts
between packages (cacert 3.123 vs 3.117, git vs git-minimal) because
different packages are resolved from different nixpkgs snapshots during
the same profile install.

Pinning to a specific commit ensures all packages are resolved from the
same nixpkgs snapshot, eliminating version drift and file conflicts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:34:23 +07:00
MythEclipseandClaude Opus 4.6 65d5306764 fix: remove explicit git from nix profile install to resolve packinfo.pl conflict with git-minimal
yt-dlp already pulls git-minimal as a transitive dependency. Adding git
explicitly causes a file conflict on packinfo.pl. Removing git from the
install list resolves this since git-minimal provides all git functionality
needed for CI builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-01 12:30:49 +07:00
MythEclipse 4e7be14efe migrate Dockerfile from Debian bookworm to NixOS base
Switch from node:22-bookworm-slim to nixos/nix:latest and install dependencies via Nix profile.
2026-06-01 12:12:37 +07:00
MythEclipse 685b97217d feat(docker): update Traefik router rule to remove redundant host entries 2026-06-01 11:28:54 +07:00
MythEclipse 1ab0fdf884 feat(deploy): update ssh-action version and remove container_name from docker-compose 2026-06-01 11:27:51 +07:00
MythEclipse 8310e58239 feat(config): add API route for app configuration and update related logic for monitor guild 2026-06-01 11:16:07 +07:00
MythEclipse 49e9197ce0 feat(deploy): update deployment workflow and remove obsolete Docker publish workflow 2026-06-01 11:07:25 +07:00
MythEclipse 942b446ff5 feat(deploy): add GitHub Actions workflow for deploying GMW to VPS 2026-06-01 10:56:23 +07:00
MythEclipse a7b3692982 feat(docker): update Docker configuration and add build workflow 2026-06-01 10:53:20 +07:00
MythEclipse c2d5bde633 feat(database): update migration command to use migrateCli and separate migration logic 2026-05-31 23:10:28 +07:00
MythEclipse 7607282db2 feat(database): add automatic migration on startup and enhance text analysis cache source 2026-05-31 23:01:38 +07:00
MythEclipse 96cd0cfc62 refactor(moderation): clean up code formatting for improved readability 2026-05-31 22:05:50 +07:00
MythEclipse 331076a540 feat(moderation): enhance media analysis with separate handling for images and text 2026-05-31 22:01:42 +07:00
MythEclipse 47e7e8e549 feat(moderation): implement media analysis caching with deterministic keys and database integration 2026-05-31 20:57:01 +07:00
MythEclipse d63e34d259 feat(moderation): refactor word analysis caching to text analysis caching with improved context handling 2026-05-31 20:33:27 +07:00
MythEclipse 7e58741b5c feat(moderation): implement per-word analysis caching for improved performance 2026-05-31 20:27:19 +07:00
MythEclipse 34c4e3e017 feat(moderation): add support for vision model in moderation analysis 2026-05-31 20:12:16 +07:00
MythEclipse 47bac6ff8f feat: add Groq Llama Prompt Guard moderation integration
- Updated .env.example to include Groq API configuration.
- Enhanced config schema in config.ts to support Groq API keys and settings.
- Implemented Groq moderation API call in indonesianTextNormalizer.ts as a fallback for badword detection.
- Removed the Indonesian slang normalization function and related tests to streamline moderation logic.
- Updated tests to reflect changes in moderation strategy, focusing on emoji normalization and badword detection.
2026-05-31 19:42:39 +07:00
MythEclipse c30785a978 feat(moderation): add additional channel to skip in message capture logic 2026-05-31 19:04:03 +07:00
MythEclipse f386e6deba chore: remove Dockerfile as part of project restructuring 2026-05-31 18:25:33 +07:00
MythEclipse 4bb90153b0 feat(analytics): add support for selected analytics guild and channel in App component
fix(redis): enhance Redis connection handling with fallback to in-memory storage
chore(sql): create missing messages and attachments tables with necessary constraints and indexes
2026-05-31 17:19:24 +07:00
MythEclipse 30ce607d88 style: format code for improved readability and consistency across multiple files 2026-05-31 16:54:15 +07:00
MythEclipse f224be2a66 Refactor test database setup and add migrations
- Updated test files to use a separate test database configuration.
- Introduced a new helper module for managing test database operations.
- Added a setup file to configure the environment for tests.
- Created new database migration scripts to optimize message indexing.
- Added a sample environment file for test database configuration.
2026-05-31 16:32:38 +07:00
MythEclipse 8a712cff9b Refactor database handling to exclusively support PostgreSQL
- Removed SQLite support from the configuration and database initialization logic.
- Updated database migration scripts to focus solely on PostgreSQL migrations.
- Simplified logging messages to reflect PostgreSQL usage.
- Adjusted database schema definitions to remove SQLite-specific types and structures.
- Modified tests to ensure compatibility with PostgreSQL, including changes to table creation and data types.
- Cleaned up unused imports and code related to SQLite.
2026-05-31 15:46:18 +07:00
MythEclipse d1ef036358 feat(redis): integrate Redis for job queue management and persistent storage 2026-05-31 14:21:43 +07:00
MythEclipse ce945c8af0 fix(analytics): simplify GROUP BY and ORDER BY clauses in getDailyTrend function 2026-05-31 01:34:35 +07:00
MythEclipse 48b4123f58 chore: remove recharts dependency and clean up pnpm-lock.yaml
- Removed "recharts" from package.json and its associated entries from pnpm-lock.yaml.
- Cleaned up unnecessary dependencies and peer dependencies related to recharts and other unused packages.
2026-05-31 01:04:26 +07:00
MythEclipse 39e4e0ddc5 feat(analytics): refactor ActivityChart and TrendChart to use custom rendering and improve data visualization 2026-05-31 01:00:08 +07:00
MythEclipse 38ae6b03dd feat(analytics): add error boundary for AnalyticsPanel and improve loading state handling 2026-05-31 00:52:23 +07:00
MythEclipse 71e240c1e7 feat(analytics): add daily trend and activity heatmap endpoints, and implement corresponding frontend components
- Added new API endpoints for daily trend data and activity heatmap in analyticsRoutes.ts.
- Created new frontend components: ActivityChart, ControlBar, Heatmap, SummaryCards, TopicList, TrendChart, UserTable, and ViolatorTable for displaying analytics data.
- Implemented loading and empty states in the new components.
- Enhanced the existing moderation tests with remote fallback handling for Indonesian text normalization.
2026-05-31 00:41:34 +07:00
MythEclipse 4e9e370eb1 feat: enhance getTopViolators query to use conditional counts for improved accuracy in moderation stats 2026-05-30 21:29:16 +07:00
MythEclipse 10f44138bc feat: implement age restriction handling in message analysis and metadata 2026-05-30 21:12:25 +07:00
MythEclipse c9e79c8c7c feat: refactor database access in analyticsStore to use executeAll and executeGet for improved query handling 2026-05-30 20:40:33 +07:00
MythEclipse b19529f135 feat: enhance logging and moderation response handling with improved serialization and error management 2026-05-30 20:13:44 +07:00
MythEclipse b105f9748a refactor: optimize database queries and enhance caching for analytics 2026-05-30 17:28:27 +07:00
MythEclipseandClaude Opus 4.8 9a7b8f569d feat: make analytics real-time via WebSocket-triggered refresh
- Analytics panel now refreshes immediately when messages are created, updated, deleted, or analyzed
- WebSocket events (message_created, message_updated, message_deleted, message_analyzed) trigger custom event 'analytics_refresh'
- Analytics hook listens to 'analytics_refresh' event for instant updates
- Auto-refresh interval lowered from 60s to 5s as fallback
- Two-tier refresh: real-time push + 5s polling safety net

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 16:58:25 +07:00
MythEclipseandClaude Opus 4.8 fed9f39bd9 feat: rebrand to GMW — Discord Moderation Watcher
- New custom SVG logo: shield with eye + GMW text
- Page title: 'GMW — Discord Moderation Watcher'
- Header: shows logo + 'GMW · {tab title}'
- Sidebar: shows logo + 'GMW v1.0' + 'Discord Moderation Watcher'
- Favicon set to logo.svg
- Removed old 'Bete Watcher' branding

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 16:34:18 +07:00
MythEclipseandClaude Opus 4.8 c7abe39728 refactor: remove Review tab, make UI state client-side, fix Jakarta time in analytics
- Remove Review tab completely (was redundant with Messages flagged view)
- UI state now client-side only (localStorage) — no server API calls for tab/channel/guild selection
- Fixes dashboard crash when server is down — now loads fully client-side
- Live panel still uses server API for voice/media operations (only what needs it)
- Analytics hourly chart labels now show Jakarta time (WIB/UTC+7) instead of UTC
- Analytics formatTimeAgo uses Jakarta time reference
- Reduced tabs to 3: Live, Messages, Analytics
- Removed unused uiState API imports and server-side state fetching

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 16:31:27 +07:00
MythEclipseandClaude Opus 4.8 9019e24263 feat: merge Voice, Media, and Recordings into unified Live panel
- New LivePanel component combines voice bridge, media player, screen share, and recordings
- Single page layout: voice controls → audio visualizer + active speakers → now playing → music/screen/recordings tabs
- Reduced tabs from 6 to 4: Live, Messages, Analytics, Review
- Sidebar updated with new tab structure
- Default tab changed from 'voice' to 'live'
- Cleaner compact layout with icon buttons and inline controls
- Recordings sub-panel with user avatars, status badges, and download buttons

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 16:20:41 +07:00
MythEclipseandClaude Opus 4.8 c213300800 feat: redesign dashboard messages UI with better sticker/image display and AI filtering
MessageCard:
- Add sticker image preview (renders actual sticker from URL, not just text name)
- Show attachment thumbnails inline (up to 4 with overflow counter)
- Remove dead columns (ai_policy_version, ai_evidence) from UI
- Add severity color coding (critical=red, high=orange, medium=yellow, low=blue)
- Add relative time display ('2h ago' instead of full datetime)
- Better hover effects and visual hierarchy

MessagesPanel:
- Add stats bar showing total/clean/warn/flagged/error/pending/deleted/edited counts
- Add AI status filter buttons (all, clean, warn, flagged, error, pending)
- Improve search UX with inline search icon and clear button
- Show filtered count in tab labels

ImageGrid:
- Include sticker images (was only attachments + embeds before)
- Add kind badge overlay (sticker/attachment/embed)
- Show user avatar next to image caption
- Better sticker rendering (object-contain with padding)

Header:
- Add shield icon per tab
- Improve tab titles and add descriptive subtitles

API client:
- Remove dead fields from MessageRecord (ai_moderation_raw, ai_policy_version, ai_evidence)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 16:13:09 +07:00
MythEclipseandClaude Opus 4.8 a00a5a508f refactor: remove unused AI columns from messages table
Drop 3 columns that were written but never read:
- ai_moderation_raw: raw LLM JSON response (~KB per message, never consumed)
- ai_policy_version: hardcoded 'default-2026-05-30', never used for decisions
- ai_evidence: JSON evidence array, never read after write

Changes:
- schema.ts: remove columns from both Postgres and SQLite table definitions
- messageStore.ts: remove from AIAnalysisUpdate interface and SET clauses
- aiAnalyzer.ts: remove from individual fallback update calls
- aiAnalysisWorker.ts: remove raw write, add missing fields (categories, severity, etc.)
- types.ts: remove from MessageRecord interface
- analysisRoutes.ts: remove from reset analysis call
- New migration: src/database/migrations/001_drop_unused_ai_columns.sql
- Migration applied to live DB: 27 columns → 24 columns

Kept ai_error (useful for future debugging, currently 0 non-null)
Kept metadata (1.9MB total, used for AI sticker/embed evidence analysis)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 16:06:37 +07:00