Skip to content

🎨 UX: Improved Post Editor User Feedback & Live Users Endpoint Display#15

Merged
inventory69 merged 1 commit intomainfrom
test_new_stuff
Dec 16, 2025
Merged

🎨 UX: Improved Post Editor User Feedback & Live Users Endpoint Display#15
inventory69 merged 1 commit intomainfrom
test_new_stuff

Conversation

@inventory69
Copy link
Owner

📋 Description

This PR improves user experience in the Admin Panel with better feedback mechanisms and cleaner endpoint visualization.

New Features

📬 Post Editor Result Model

  • New file: lib/models/post_editor_result.dart
  • Structured result object for post create/edit operations
  • Includes success status, message, and error handling
  • Factory constructors for success/error states

🎯 Enhanced Post Creation Feedback

  • Success notifications:
    • "✨ Post created! +15 XP" for regular posts
    • "📢 Announcement posted! ✨ +15 XP" for announcements
    • "✏️ Post updated!" for edits
  • Green snackbar with checkmark icon for success
  • Red snackbar for errors with detailed messages
  • 5-second duration for error messages

🔍 Live Users Screen Improvements

  • User-friendly endpoint descriptions with emojis:
    • POST /api/posts → "✨ Created new post"
    • GET /api/user/me → "👤 Viewed profile"
    • POST /api/auth/logout → "👋 Logged out"
  • 40+ endpoint mappings for better activity tracking
  • Pattern matching for dynamic IDs (posts, memes, users)
  • Removed IP address display (privacy improvement)

🔧 Technical Changes

Modified Files (5 + 1 new)

  1. lib/models/post_editor_result.dart (NEW)

    • Simple result model with success/error states
    • Clean API for post editor operations
  2. lib/widgets/create_edit_post_sheet.dart

    • Returns PostEditorResult instead of bool
    • Removed inline SnackBar (moved to parent screens)
    • Cleaner separation of concerns
  3. lib/utils/post_editor_helper.dart

    • Updated return type to PostEditorResult?
    • Updated for both mobile (bottom sheet) and desktop (dialog)
  4. lib/screens/create_post_screen.dart

    • Added result handling with SnackBar display
    • Green success notification with icon
    • Red error notification
  5. lib/screens/home_screen.dart

    • Enhanced post edit feedback
    • Auto-refresh feed on successful edit
    • Consistent error handling
  6. lib/screens/admin/live_users_screen.dart

    • Comprehensive endpoint description mapping
    • Removed IP address display
    • Better activity readability for admins

🎯 User Impact

Before:

  • ❌ No feedback after creating posts
  • ❌ Generic endpoint names in Live Users screen
  • ❌ Users unsure if post was created successfully
  • ❌ IP addresses visible (privacy concern)

After:

  • ✅ Clear success/error messages with XP indication
  • ✅ User-friendly activity descriptions ("✨ Created new post")
  • ✅ Immediate visual confirmation
  • ✅ Privacy-friendly (no IP display)
  • ✅ Better admin UX with readable endpoint names

📊 Statistics

5 files changed, 166 insertions(+), 46 deletions(-)
+ 1 new model file
+ 40+ endpoint descriptions
+ Consistent feedback across all post operations

🧪 Testing Checklist

  • Create new community post → Shows success SnackBar
  • Edit existing post → Shows update confirmation
  • Post creation error → Shows red error message
  • Mobile post editor → Bottom sheet works correctly
  • Desktop post editor → Dialog works correctly
  • Live Users screen → Endpoints show friendly names
  • Feed auto-refresh after edit → Works correctly

🔗 Related Issues

  • Improves post creation UX
  • Addresses admin feedback about unclear endpoint names
  • Privacy improvement (IP address removal)

📸 Preview

Success Message:

✅ ✨ Post created! +15 XP

Live Users Endpoint Display:

Before: POST /api/community/posts/create
After:  ✨ Created new post

@inventory69 inventory69 merged commit ef7e2ff into main Dec 16, 2025
@inventory69 inventory69 deleted the test_new_stuff branch December 16, 2025 22:41
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