Files
pawctioneer-bot/src/commands/new_listing/mod.rs
Dylan Knutson 5d7a5b26c1 feat: enhance UX with listing type selection and main menu improvements
- Add listing type selection to new listing wizard
  - Create SelectingListingType state for choosing between 4 listing types
  - Add ListingTypeKeyboardButtons with clear descriptions
  - Support BasicAuction, MultiSlotAuction, FixedPriceListing, BlindAuction
  - Update handlers to start with type selection before title input

- Improve main menu navigation
  - Add main menu with action buttons for /start command
  - Create MainMenuButtons with New Listing, My Listings, My Bids, Settings, Help
  - Add back button to My Listings screen for better navigation
  - Implement proper dialogue state management between screens

- Refactor callback handling for type safety
  - Convert string literal matching to enum-based callback handling
  - Use try_from() pattern for all keyboard button callbacks
  - Ensure compile-time safety and exhaustive matching
  - Apply pattern to listing type, slots, duration, and start time callbacks

- Eliminate code duplication
  - Extract reusable main menu functions (enter_main_menu, get_main_menu_message)
  - Centralize main menu logic and message content
  - Update all main menu transitions to use shared functions

- Technical improvements
  - Add proper error handling for invalid callback data
  - Maintain backward compatibility with existing flows
  - Follow established patterns for keyboard button definitions
  - Ensure all changes compile without errors
2025-08-30 05:45:49 +00:00

32 lines
969 B
Rust

//! New listing creation wizard module
//!
//! This module provides a complete wizard interface for creating new listings.
//! It's organized into logical submodules with clear responsibilities:
//!
//! - `handlers`: Main handler functions for teloxide
//! - `callbacks`: Callback query processing
//! - `field_processing`: Core field validation and update logic
//! - `messages`: Centralized message constants and generation
//! - `ui`: Display and summary functions
//! - `keyboard`: Button and keyboard definitions
//! - `types`: Type definitions and state management
//! - `validations`: Input validation functions
mod callbacks;
mod field_processing;
mod handler_factory;
mod handlers;
mod keyboard;
pub mod messages;
#[cfg(test)]
mod tests;
mod types;
mod ui;
mod validations;
// Re-export the main handler for external use
pub use handler_factory::new_listing_handler;
pub use handlers::{enter_edit_listing_draft, enter_handle_new_listing};
pub use types::*;