Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add smart item Admin toolkit #136

Draft
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

cyaiox
Copy link
Collaborator

@cyaiox cyaiox commented Jan 31, 2025

Description

This PR introduces a new Admin Toolkit UI system for managing video players, smart items, and other administrative controls in Decentraland scenes.

Key Features

Core UI Components

  • Created new Button component with state management and variant support (primary/secondary/text)
  • Added VideoControl component for managing video players
  • Created SmartItemsControl for managing smart item actions

Video Control Features

  • Video player selection with support for multiple players
  • Play, pause, and restart controls
  • Volume control with visual feedback
  • URL input for video source management
  • "Link All" functionality to control multiple players simultaneously

Smart Items Control Features

  • Smart item selection dropdown
  • Action selection for each smart item
  • Show/Hide entity controls
  • Action restart functionality
  • Default action reset capability

State Management

  • Implemented Map-based state management for UI components
  • Created efficient state handling for video players
  • Added smart item state tracking
  • Proper state synchronization between components

Technical Details

  • Built using @dcl/react-ecs for UI components
  • Typescript-based implementation with proper type safety
  • Efficient state management using Maps
  • Consistent styling using predefined constants
  • Component-based architecture for better maintainability

Testing Instructions

  1. Test video player controls:

    • Select different video players
    • Try play/pause/restart
    • Adjust volume
    • Test URL input and sharing
    • Verify "Link All" functionality
  2. Test smart item controls:

    • Select different smart items
    • Try different actions
    • Test visibility toggling
    • Verify action restart
    • Check default action reset
  3. Test text announcement controls:

    • Write a message
    • Close the message
    • Write a few messages
    • Clear all messages
  4. Test rewards control:

    • Release a new Airdrop item
    • Test interaction with the rewards server

TODO (Future PRs)

High Priority

  1. Moderation Control Panel

    • Implement user moderation features
    • Add ban/unban functionality
    • Add user list management
    • Include moderation logs
  2. UI Style Improvements

    • Enhance panels background with better contrast and transparency
    • Add proper padding and spacing
    • Improve overall visual hierarchy
    • Add better error handling
    • Enhance user feedback
  3. Button Component Enhancement

    • Refine button states visual feedback
    • Add hover animations
    • Improve disabled state visibility
    • Add loading state support
  4. Text announcements Enhancement

    • Improve input writing delay
    • Improve input length limitation

Nice to Have

  • New Dropdown Component
    • Create custom dropdown implementation
    • Add multi-select support
    • Improve scrolling behavior
    • Add search/filter functionality
    • Support keyboard navigation

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows Decentraland's coding standards
  • I have added proper TypeScript types
  • Components are properly documented
  • All UI states are properly handled
  • The code is ready for review

Models and composers for AdminTools and CollectibleDispenser added in: #143

Copy link

github-actions bot commented Feb 6, 2025

Test this pull request

  • The package can be tested by running
    npm i "https://sdk-team-cdn.decentraland.org/@dcl/asset-packs/branch/feat/add-admin-toolkit-smart-item/dcl-asset-packs-2.1.3-13467275373.commit-b93ce86.tgz"

Remember, if new assets are added in the PR, they won't be avaliable on the CDN until it gets merged. So this can be used to test changes on the package's JS or the catalog.json, but won't work to test newly added items.

@cyaiox cyaiox force-pushed the feat/add-admin-toolkit-smart-item branch 4 times, most recently from a831f0c to 169b334 Compare February 14, 2025 04:46
@cyaiox cyaiox force-pushed the feat/add-admin-toolkit-smart-item branch from 169b334 to b0f04d0 Compare February 19, 2025 12:28
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.

1 participant