Commit Graph

85 Commits

Author SHA1 Message Date
Sean O'Connor
a5762ec935 feat: implement WebSocket for real-time trial updates
- Create standalone WebSocket server (ws-server.ts) on port 3001 using Bun
- Add ws_connections table to track active connections in database
- Create global WebSocket manager that persists across component unmounts
- Fix useWebSocket hook to prevent infinite re-renders and use refs
- Fix TrialForm Select components with proper default values
- Add trialId to WebSocket URL for server-side tracking
- Update package.json with dev:ws script for separate WS server
2026-03-22 00:48:43 -04:00
Sean O'Connor
20d6d3de1a migrate: replace NextAuth.js with Better Auth
- Install better-auth and @better-auth/drizzle-adapter
- Create src/lib/auth.ts with Better Auth configuration using bcrypt
- Update database schema: change auth table IDs from uuid to text
- Update route handler from /api/auth/[...nextauth] to /api/auth/[...all]
- Update tRPC context and middleware for Better Auth session handling
- Update client components to use Better Auth APIs (signIn, signOut)
- Update seed script with text-based IDs and correct account schema
- Fix type errors in wizard components (robotId, optional chaining)
- Fix API paths: api.robots.initialize -> api.robots.plugins.initialize
- Update auth router to use text IDs for Better Auth compatibility

Note: Auth tables were reset - users will need to re-register.
2026-03-21 23:03:55 -04:00
4bed537943 Update docs: add March 2026 session summary, NAO6 Docker integration docs, and quick reference updates
- Add MARCH-2026-SESSION.md with complete summary of work done
- Update nao6-quick-reference.md for Docker-based deployment
- Update quick-reference.md with NAO6 Docker integration section
2026-03-21 20:51:08 -04:00
73f70f6550 Add nextStepId conditions to Branch A and B to jump to Story Continues 2026-03-21 20:44:47 -04:00
3fafd61553 Fix onClick handlers passing event object to handleNextStep
The issue was that onClick={onNextStep} passes the click event as the first argument,
making targetIndex an object instead of undefined. This caused handleNextStep to fall
through to linear progression instead of properly checking branching logic.

Fixed by wrapping with arrow function: onClick={() => onNextStep()}
2026-03-21 20:35:54 -04:00
3491bf4463 Add debug logging for branching flow 2026-03-21 20:26:55 -04:00
cc58593891 Update robot-plugins submodule 2026-03-21 20:21:38 -04:00
bbbe397ba8 Various improvements: study forms, participant management, PDF generator, robot integration 2026-03-21 20:21:18 -04:00
bbc34921b5 Fix branching logic and robot action timing
- Remove onCompleted() call after branch selection to prevent count increment
- Add proper duration estimation for speech actions (word count + emotion overhead)
- Add say_with_emotion and wave_goodbye to built-in actions
- Add identifier field to admin.ts plugin creation
2026-03-21 20:15:39 -04:00
8e647c958e Fix seed script to include identifier for system plugins 2026-03-21 20:04:46 -04:00
4e86546311 Add identifier column to plugins table for cleaner plugin lookup
- Added 'identifier' column (unique) for machine-readable plugin ID
- 'name' now used for display name only
- Updated trial-execution to look up by identifier first, then name
- Added migration script for existing databases
2026-03-21 20:03:33 -04:00
e84c794962 Load plugin from local file first (not remote) 2026-03-21 19:32:13 -04:00
70064f487e Fix say_with_emotion with proper NAOqi markup, add transform functions, update seed script for linear branching 2026-03-21 19:29:28 -04:00
91d03a789d Redesign experiment structure and add pending trial
- Both branch choices now jump to Story Continues (convergence point)
- Add Story Continues step with expressive actions
- Add pre-seeded pending trial for immediate testing
- Fix duplicate comments in seed script
- Update step ordering (Conclusion now step6)
2026-03-21 19:15:41 -04:00
31d2173703 Fix branching and add move_arm builtin
- Branching: mark source step as completed when jumping to prevent revisiting
- Add move_arm as builtin for arm control
2026-03-21 19:09:26 -04:00
4a9abf4ff1 Restore builtins for standard ROS actions
- Re-add say_text, walk_forward, walk_backward, turn_left, turn_right, move_head, turn_head as builtins
- These use standard ROS topics (/speech, /cmd_vel, /joint_angles) that work with most robots
- Plugin-specific actions should still be defined in plugin config
2026-03-21 19:04:51 -04:00
487f97c5c2 Update robot-plugins submodule 2026-03-21 18:58:29 -04:00
db147f2294 Update robot-plugins submodule 2026-03-21 18:57:00 -04:00
a705c720fb Make wizard-ros-service robot-agnostic
- Remove NAO-specific hardcoded action handlers
- Remove helper methods (executeMovementAction, executeTurnHead, executeMoveArm)
- Keep only generic emergency_stop as builtin
- All robot-specific actions should be defined in plugin config
2026-03-21 18:55:52 -04:00
e460c1b029 Update robot-plugins submodule 2026-03-21 18:54:18 -04:00
eb0d86f570 Clean up debug logs 2026-03-21 18:52:16 -04:00
e40c37cfd0 Fix branching logic and add combo robot actions
- Fix handleNextStep to handle both string and object options in conditions
- Add say_with_emotion, bow, wave, nod, shake_head, point combo actions
- Update seed data with nextStepId in wizard_wait_for_response options
2026-03-21 18:51:27 -04:00
f8e6fccae3 Update robot-plugins submodule 2026-03-21 18:28:07 -04:00
3f87588fea fix: Update ROS topics and robot configuration
ROS Topic Fixes:
- wizard-ros-service.ts: Use correct ROS topics (/cmd_vel, /joint_angles, /speech)
- ros-bridge.ts: Update subscriptions to match naoqi_driver topics
- Fixes action execution (movement, speech, head control)

Robot Configuration:
- robots.ts: Use NAO_IP/NAO_ROBOT_IP env vars instead of hardcoded 'nao.local'
- robots.ts: Use NAO_PASSWORD env var for SSH authentication
- Improves Docker integration with NAO6

Wizard Interface:
- useWizardRos.ts: Enhanced wizard interface for robot control
- WizardInterface.tsx: Updated wizard controls
- Add comprehensive event listeners for robot actions
2026-03-21 17:58:29 -04:00
18e5aab4a5 feat: Convert robot-plugins to proper git submodule
- Removes nested .git directory from robot-plugins
- Adds robot-plugins as a proper submodule of hristudio
- Points to main branch of soconnor0919/robot-plugins repository
- This enables proper version tracking and updates of robot plugins
2026-03-21 17:57:54 -04:00
c16d0d2565 feat: Add uuid package and its types to dependencies. 2026-03-19 17:40:39 -04:00
c37acad3d2 feat: Enforce study membership access for file uploads and integrate live system statistics. 2026-03-06 00:22:22 -05:00
0051946bde feat: Implement digital signatures for participant consent and introduce study forms management. 2026-03-02 10:51:20 -05:00
61af467cc8 feat: enhance experiment designer action definitions, refactor trial analysis UI, and update video playback controls 2026-03-01 19:00:23 -05:00
60d4fae72c feat: Enhance trial event display with improved formatting and icons, refine trial wizard panels, and update dashboard page layouts. 2026-02-20 00:37:33 -05:00
72971a4b49 feat(analytics): refine timeline visualization and add print support 2026-02-17 21:17:11 -05:00
568d408587 feat: Add guided tour functionality for analytics and wizard components, including new tour steps and triggers. 2026-02-12 00:53:28 -05:00
93de577939 feat: Add a new onboarding tour for participant creation and refactor consent form uploads to use sonner for toasts and XMLHttpRequest for progress tracking. 2026-02-11 23:49:51 -05:00
85b951f742 refactor: restructure study and participant forms into logical sections with separators and enhance EntityForm's layout flexibility for sidebar presence. 2026-02-10 16:31:43 -05:00
a8c868ad3f feat: Implement trial event logging, archiving, experiment soft deletion, and new analytics/event data tables. 2026-02-10 16:14:31 -05:00
0f535f6887 feat: introduce conditional steps and branching logic to the experiment wizard and designer, along with new core and WoZ plugins. 2026-02-10 10:24:09 -05:00
388897c70e feat: Implement collapsible left and right panels with dynamic column spanning, updated styling, and integrated a bottom status bar in the DesignerRoot. 2026-02-03 13:58:47 -05:00
0ec63b3c97 feat: Redesign the designer layout using a grid system, adding explicit left, center, and right panels with collapse functionality. 2026-02-02 15:48:17 -05:00
89c44efcf7 feat: Implement responsive design for the experiment designer and enhance general UI components with hover effects and shadows. 2026-02-02 12:51:53 -05:00
7fd0d97a67 feat: Implement dynamic plugin definition loading from remote/local sources and standardize action IDs using plugin metadata. 2026-02-02 12:05:52 -05:00
54c34b6f7d add help mode 2026-02-01 23:27:00 -05:00
5b7d4e79fe Merge master into nao_ros2 (Redesign & Fixes) 2026-02-01 22:33:20 -05:00
dbfdd91dea feat: Redesign Landing, Auth, and Dashboard Pages
Also fixed schema type exports and seed script errors.
2026-02-01 22:28:19 -05:00
4fbd3be324 Break work 2026-01-20 09:38:07 -05:00
d83c02759a feat: Introduce dedicated participant, experiment, and trial detail/edit pages, enable MinIO, and refactor dashboard navigation. 2025-12-11 20:04:52 -05:00
5be4ff0372 refactor: simplify wizard UI by removing trial monitoring and robot control tabs, and streamlining monitoring panel props. 2025-11-20 14:52:08 -05:00
1108f4d25d fix: prevent auto-connect from getting stuck in connecting state
Added comment to clarify that connection state updates happen via
event handlers. Auto-connect now properly handles failures without
retrying automatically, allowing users to manually connect if needed.
2025-11-19 22:56:24 -05:00
5631c69a76 fix: remove invalid battery subscription causing ROS Bridge error
The naoqi_bridge_msgs/BatteryState message type doesn't exist in the
NAO6 ROS2 package, causing subscription errors. Removed the battery
topic subscription for now. Battery info can be obtained through
diagnostics or other means if needed in the future.
2025-11-19 22:52:21 -05:00
18fa6bff5f fix: migrate wizard from polling to WebSocket and fix duplicate ROS connections
- Removed non-functional trial WebSocket (no server exists)
- Kept ROS WebSocket for robot control via useWizardRos
- Fixed duplicate ROS connections by passing connection as props
- WizardMonitoringPanel now receives ROS connection from parent
- Trial status uses reliable tRPC polling (5-15s intervals)
- Updated connection badges to show 'ROS Connected/Offline'
- Added loading overlay with fade-in to designer
- Fixed hash computation to include parameter values
- Fixed incremental hash caching for parameter changes

Fixes:
- WebSocket connection errors eliminated
- Connect button now works properly
- No more conflicting duplicate connections
- Accurate connection status display
2025-11-19 22:51:38 -05:00
b21ed8e805 feat: Relocate experiment designer routes under studies, update ROS2 topic paths, and enhance designer hashing and performance. 2025-11-19 18:05:19 -05:00