Skip to content

Conversation

@Josh-XT
Copy link
Contributor

@Josh-XT Josh-XT commented Jun 8, 2025

Add child mode. Resolves #153

This pull request introduces role-based feature restrictions, enhances audio handling with a new context-based architecture, and makes UI adjustments for child-friendly functionality. The key changes are grouped and summarized below.

Role-Based Feature Restrictions

  • Added getFilteredItems function in app/NavMenuItems.tsx to filter navigation items based on user roles, specifically hiding most items for children (roleId 4).
  • Introduced roleThreshold property to restrict access to specific menu items for children. [1] [2]
  • Updated app/chat/[[...id]]/page.tsx and components/conversation/Message/Message.tsx to hide certain actions and features (e.g., conversation actions and message actions) from children. (app/chat/[[...id]]/page.tsxL292-R296, [1] [2]

Audio Handling Enhancements

  • Replaced the AudioPlayer component with a new context-based AudioContext architecture to manage audio playback and autoplay permissions more effectively. [1] [2]
  • Integrated the new AudioProvider into the app layout to ensure audio context is available globally. [1] [2] [3]

Child-Friendly UI Adjustments

  • Added a ChildFriendlyVoiceRecorder component with a larger, visually appealing microphone button for children in components/conversation/input/chat-input.tsx.
  • Enabled text-to-speech (tts) by default for children in components/conversation/conversation.tsx.

Markdown Media Handling

  • Enhanced MarkdownLink to support audio file playback by embedding the new AudioPlayer for audio links. [1] [2]

These changes improve user experience by tailoring features and interfaces to specific user roles while modernizing audio playback capabilities.

@Josh-XT Josh-XT changed the title add child menu Add child mode Jun 8, 2025
@Josh-XT Josh-XT marked this pull request as ready for review June 9, 2025 02:02
@Josh-XT Josh-XT merged commit 9b7810b into main Jun 9, 2025
6 of 7 checks passed
@Josh-XT Josh-XT deleted the child-menu branch June 9, 2025 02:02
Josh-XT added a commit that referenced this pull request Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add role ID 4 for "Child"

2 participants