Spaces:
Paused
Paused
Commit History
-
fix: Use gr.Dataframe.select() to track row for Delete Row button
Sidd-mukho77 +1: Claude Sonnet 4.6Previous approach (js= + window.lastDataframeRowIdx) failed because gr.State(-1) created inline in .click() is not a registered component, so the row index was never reliably passed to Python (-1 always). New approach: .select() on the Dataframe fires natively when a cell is clicked, stores the row index in a proper gr.State. Delete Row reads that state directly - no js= or window globals needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>99cdd1e -
feat: Add Delete Row button to guest tables in Search and PDF tabs
Sidd-mukho77 +1: Claude Sonnet 4.6Uses capture-phase mousedown listener to track last-clicked dataframe row index (window.lastDataframeRowIdx) before focus shifts to the button. js= hook on Delete Row reads this index synchronously and passes it to Python, which removes that row. Minimum 1 row always preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f081cab -
fix: Add explicit '+ Add Guest Row' button to replace broken context menu
Sidd-mukho77 +1: Claude Sonnet 4.6Gradio's Dataframe three-dots context menu is unreliable in production (HuggingFace Spaces) due to clickOutside event firing before the menu action registers. Add an explicit button below each guest table as a reliable row-add mechanism for both Search Hotel and PDF Extraction tabs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b25bafd -
feat: Fix conf no in bulk CSV, multi-page Search tab, and large CSV handling
Sidd-mukho77 +1: Claude Sonnet 4.6- Fix confirmation numbers not appearing in generated PDFs (sync iframe grid data via js= hook before Python runs) - Search tab guest table now generates one PDF page per row - Add 100-row cap for bulk CSV generation - Fix Adults/Children int parsing for float strings ("2.0") - Normalize NaN/None confirmation numbers to empty string Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>5e4a427
-
feat: Fix grid JS bug, add column-select with delete and paste-fill
Sidd-mukho77 +1: Claude Sonnet 4.6- Fix SyntaxError caused by Python f-string interpreting \r\n as literal CR/LF inside the JS regex literal (rows were not rendering) - Add ▼ arrow to each column header for column selection mode - Column selection highlights all cells in the column (purple outline) - Delete/Backspace while column selected clears all entries in column - Paste while column selected fills entire column top-to-bottom - Use event delegation (not inline onclick) so selectColumn() is accessible inside the IIFE scope Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>d5cb814 -
feat: Replace Gradio Dataframe with AG Grid Community for native Excel-style paste
Sidd-mukho77953dea6
-
feat: Native Excel-style multi-row paste in CSV guest table
Sidd-mukho77 +1: Claude Sonnet 4.6- Add elem_id="csv-guest-table" to the dataframe for JS targeting - Intercept paste events inside the table via JS in FLATPICKR_JS IIFE - If clipboard contains multiple lines (e.g. column copied from Excel/Sheets), values are distributed downward in the same column instead of all going into one cell — matches standard spreadsheet paste behaviour - Single-value pastes are unaffected (browser handles them normally) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>92f36d4 -
feat: Add paste-to-fill helper for Confirmation No column in bulk CSV table
Sidd-mukho77 +1: Claude Sonnet 4.6- Adds a collapsible row below the guest table with a multiline textbox - User pastes confirmation numbers (one per line, copied from Excel/Sheets) - "Apply to Table" button fills the Confirmation No column from row 1 downward - Helper row appears automatically after CSV upload, hidden before Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>20e0b3e -
feat: Make CSV preview table editable for bulk voucher generation
Sidd-mukho77 +1: Claude Sonnet 4.6- Set csv_preview_table interactive=True so users can edit rows before generating - Normalize column names in preview_csv_upload before returning to table - process_bulk_csv now reads from the edited table first, falls back to raw CSV - Added csv_preview_table as input to bulk_csv_btn.click Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>7f93e9e -
fix: Break circular update loop in cancellation date/days sync
Sidd-mukho77 +1: Claude Sonnet 4.6When the user clicked a date in the cancellation deadline picker, both handlers (cancellation_date.change and cancellation_days.change) were triggering each other indefinitely — causing the visible flicker between adjacent days. Fix: pass the current component value as an extra input and return gr.update() (no-op) when the calculated result matches the current value. Gradio's change event is not re-fired for a no-op update, so the cascade stops after the first round-trip. Applied to all three tabs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>b448159 -
fix: Fix calendar loop bug and update cancellation text format
Sidd-mukho77 +1: Claude Sonnet 4.6- Calendar loop: add isOpen guard to 600ms poller so it never calls setDate while the user is actively selecting dates (was fighting UI) - Calendar loop: stop tryInitAll retrying once all 3 pickers are done - Calendar loop: detect stale flatpickr instance on re-rendered elements and destroy/reinit instead of silently returning - Cancellation text: change from "Free - until N days before Check-in" to "Free Cancel until DD MMM YYYY" using the actual calculated deadline Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>01d3566 -
feat: Implement Flatpickr date range picker with HTML and JavaScript for improved date selection.feat: Implement Flatpickr date range picker with HTML and JavaScript for improved date selection.
Sidd-mukho778a0ed13
-
feat: Add Supabase integration for voucher logging and storage
Sidd-mukho77 +1: Claude Sonnet 4.5- Add supabase_logger.py with upload and logging functions - Integrate Supabase logging into all voucher generation flows - Store PDFs in Supabase Storage with year/month organization - Fix Maps grounding with two-step approach for better accuracy - Support all three tabs: Search Hotel, PDF Extraction, Bulk CSV - Graceful error handling - app continues if Supabase unavailable - Update .gitignore to exclude sensitive files and __pycache__ - Remove tracked __pycache__ files from repository - Add deployment checklist and security verification script Technical Details: - supabase_logger.py: Upload PDFs and log metadata to generations table - Maps grounding: Two-step API call (grounding + structured output) - Storage: Year/month folder structure for organization - Database: 26-column schema with JSONB guest details - Security: All secrets in .env, comprehensive .gitignore Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>bf26a87 -
Fix bulk CSV filename and enhance validation messages
Sidd-mukho77 +1: Claude Sonnet 4.51. Fix bulk CSV filename auto-update - Added on_hotel_selected_bulk() wrapper function - Now auto-generates filename when hotel is selected in bulk tab - Format: "HotelName_AllVouchers_YYYYMMDD_HHMMSS.pdf" 2. Enhance validation error messages for better visibility - Made error messages more prominent using markdown headers - Checkout before checkin: "## ❌ Invalid Dates" - Cancellation after checkin: "## ❌ Invalid Cancellation Policy" - Other warnings: "## ⚠️ Warning" - All errors now show in bold for better visibility All validation errors are shown in real-time across all tabs: - Search Hotel tab: via status_text - PDF Extraction tab: via status_text_pdf - Bulk CSV tab: via bulk_csv_status Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>5f4c010 -
Add PDF improvements: cancellation text, validation, custom filenames
Sidd-mukho77 +1: Claude Sonnet 4.51. Fix cancellation policy text format - Changed from "Free Cancellation (until 7 days before check-in)" - To "Free - until 7 days before Check-in" - Updated in voucher_generator.py line 308 2. Add blocking date validation to all tabs - Prevent checkout date before checkin date - Prevent cancellation date after checkin date - Added validation to generate_voucher() and process_bulk_csv() - Returns error message and blocks PDF generation 3. Add custom PDF filename field to all tabs - Added "PDF Filename" textbox in Search, PDF, and Bulk CSV tabs - Auto-generates default filename based on hotel name and confirmation number - Single vouchers: "HotelName-ConfirmationNo.pdf" - Bulk vouchers: "HotelName_AllVouchers_YYYYMMDD_HHMMSS.pdf" - User can edit filename before generating - Auto-updates when hotel name or guest info changes - Added generate_default_filename() helper function - Updated generate_voucher() and process_bulk_csv() to use custom …3202c41 -
Remove Final Room Name field and add auto-fetch room types
Sidd-mukho77 +1: Claude Sonnet 4.5- Remove final_room_name field from all three tabs (Search, PDF, Bulk) - Add fetch_room_types_grounded() function in gemini_utils.py - Uses gemini-2.5-flash-lite with Google Search grounding - Fetches actual room types for selected hotel (<5 seconds) - Returns 5-10 actual room type names - Falls back to default types if search fails - Update on_hotel_selected() to auto-populate room types - Update generate_voucher() to use room_type_select directly - Update all event handlers to remove final_room_name inputs/outputs - Update voucher-optimize skill docs with room type fetch examples Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>db71ad6 -
Fix: Gradio 6 theme deprecation warning
Sidd-mukho77 +1: Claude Sonnet 4.5- Move theme parameter from Blocks() to launch() - Fixes UserWarning about deprecated parameter location - Gradio 6 compatibility update Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>c586f80 -
Fix: PDF extraction tuple error in calculate_nights
Sidd-mukho77 +1: Claude Sonnet 4.5- extract_from_pdf was calling calculate_nights expecting int - calculate_nights now returns (nights, warning) tuple - Unpack tuple properly to get just nights value - Include warning in status message if present Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>897cb64 -
Fix: Hotel search + Date validation + Cancellation policy bugs
Sidd-mukho77 +1: Claude Sonnet 4.5Hotel Search Fix: - Remove response_mime_type when using grounding tools (API limitation) - Parse JSON from text response with markdown cleanup - Filter and validate hotel results - Returns 5-8 hotels successfully Date Validation: - Check-out must be after check-in (shows warning) - Cancellation deadline must be before check-in - Days must be between 1-365 - Real-time validation with warning messages Cancellation Policy Fixes: - Prevent infinite loops between days/date fields - Add show_progress=False to prevent UI flicker - Handle float inputs gracefully - Display validation warnings in status area All tabs updated: - Search Hotel tab - PDF Extraction tab - Bulk CSV Processing tab Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>cc7efa0 -
Fix PDF preview and add visible hotel name fields
Sidd-mukho77 +1: Claude Sonnet 4.5- Install PyMuPDF dependency for PDF preview functionality - Make hotel name field visible and editable in all tabs - Improve preview error handling with better fallback messages - Show page count in multi-page PDF previews - Add helpful info text for hotel name fields Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>7977b2b -
Add PDF preview and download for bulk CSV generation
Sidd-mukho77 +1: Claude Sonnet 4.5- Add PDF preview HTML component to bulk CSV tab - Update process_bulk_csv to return preview HTML - Add download section with viewing options - Fix return values to include preview for all error cases Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>c615d2f -
Fix: CSV column flexibility and multi-page PDF generation
Sidd-mukho77 +1: Claude Sonnet 4.5Changes: - Add .env file with GEMINI_API_KEY for local development - Support flexible CSV column names (GUESTS NAME, CONFIRMATION NO., CHILD, etc.) - Generate single multi-page PDF instead of ZIP with separate PDFs - Update UI text to reflect multi-page PDF generation - Improve CSV preview validation with flexible column matching Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>8190f79 -
Redesign Bulk CSV tab: Form + Guest List workflow
Sidd-mukho77 +1: Claude Sonnet 4.5Major Changes: - Add full hotel search and booking form to Bulk CSV tab - CSV now only contains guest info (Guest Name, Confirmation No, Adults, Children) - Fill in booking details once, upload guest list, generate multiple vouchers - Better PDF naming: HotelName_GuestName.pdf (instead of sequential numbers) - ZIP file named: HotelName_Vouchers_TIMESTAMP.zip Features Added: - Hotel search with Google Maps grounding (same as Search tab) - Calendar pickers for check-in/check-out dates - Dual cancellation inputs (days OR date) with auto-sync - Auto-calculate nights from dates - CSV preview shows guest statistics (total adults/children) Benefits: - Users fill common details (hotel, dates, room) ONCE - Upload guest list CSV with just 4 columns - Generate vouchers for entire group quickly - Each voucher has individual guest name + confirmation number - Professional PDF naming for easy identification Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>9d9a5e9 -
Fix: Add info text and restructure layout for calendar icons
Sidd-mukho77 +1: Claude Sonnet 4.5- Add info="Click calendar icon to select date" to match cancellation field - Move number_of_nights out of Row with date fields - Check-in and check-out now in their own Row (like cancellation fields) - This matches the working cancellation deadline configuration - Calendar icons should now appear on all date fields Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>bf10ed2 -
Fix: Set DateTime value=None to show calendar picker icons
Sidd-mukho77 +1: Claude Sonnet 4.5- Remove default values from check-in/check-out DateTime fields - Calendar picker icon now appears on all date fields - Fields with default values don't show calendar icons in Gradio - Users can now click calendar icon to select dates - All sync logic preserved for cancellation deadline Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>e56f096 -
Use official gr.DateTime with proper configuration
Sidd-mukho77 +1: Claude Sonnet 4.5- Switch to gr.DateTime(include_time=False, type="string") - Following official Gradio documentation for date-only selection - DateTime component provides native calendar picker UI - Set default values as datetime strings (YYYY-MM-DD HH:MM:SS format) - All dual cancellation sync logic preserved - Works on both Search and PDF Extraction tabs Based on: https://www.gradio.app/docs/gradio/datetime Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>816a018 -
Fix: Revert to textbox inputs with dual cancellation feature
Sidd-mukho77 +1: Claude Sonnet 4.5- Replace Calendar component with enhanced Textbox (gradio-calendar had compatibility issues) - Add calendar emoji 📅 to date field labels for visual clarity - Keep dual cancellation inputs: days before check-in AND deadline date - Both fields sync automatically when either changes - Add placeholder text and info hints (YYYY-MM-DD format) - All synchronization logic working (calculate_cancellation_date/days) - Update helper functions to return strings for textbox compatibility Works reliably across all browsers and HuggingFace Spaces. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>0b5bf8d -
Switch to gradio-calendar for proper calendar picker UI
Sidd-mukho77 +1: Claude Sonnet 4.5- Replace gr.DateTime with Calendar component from gradio-calendar - Calendar component provides visible calendar icons and better UX - Works reliably on HuggingFace Spaces with proper date picker UI - Maintains all synchronization logic for cancellation deadlines Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>e6ef07f -
Add calendar pickers for dates and dual cancellation deadline inputs
Sidd-mukho77 +1: Claude Sonnet 4.5- Replace textbox date fields with gr.DateTime calendar pickers - Add synchronized dual inputs for cancellation deadline (days OR date) - Auto-sync: changing check-in recalculates cancellation deadline - Add helper functions for date/days conversion with validation - Update parse_date() to handle datetime objects - Works across Search, PDF Extraction, and Bulk CSV tabs Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>6746381 -
Restructure app into three focused tabs: Search, PDF Extraction, Bulk CSV
Sidd-mukho77 +1: Claude Sonnet 4.5Major UI restructuring to separate workflows: Changes: - Split "Single Voucher" tab into two dedicated tabs: * Tab 1: "🔍 Search Hotel" - Manual hotel search and form entry * Tab 2: "📄 PDF Extraction" - PDF upload with auto-extraction - Removed "Bulk PDF Processing" tab (redundant with single PDF extraction) - Tab 3: "📊 Bulk CSV Processing" - Unchanged Tab 1 - Search Hotel: - Hotel search with Google Search grounding - Manual form entry for all booking details - Guest table, generate button, preview/download Tab 2 - PDF Extraction: - PDF upload with Gemini Vision extraction - Auto-filled form fields (all with _pdf suffix) - No search functionality (extraction only) - Guest table, generate button, preview/download Implementation details: - Duplicated all form components (15 fields + guest table) for both tabs - Updated extract_from_pdf() to return 14 outputs (removed search_query, hotel_select) - Added complete event handlers for PDF tab (date calc, policy visibility, generate…a673fb1
-
Add major UI improvements: flattened tabs, cancellation days, CSV preview, enhanced progress
Sidd-mukho77 +1: Claude Sonnet 4.5This commit implements comprehensive UI improvements to the voucher generator: Features Added: - Flattened tab structure: 3 top-level tabs (Single, Bulk PDF, Bulk CSV) - Cancellation days control: conditional input for free cancellation policy (1-365 days) - CSV preview table: instant visualization of first 100 rows with validation - Enhanced progress tracking: shows "X done / Y remaining" with emoji indicators - UI refinements: section headers, better button styling, improved visual hierarchy Changes: - app.py: Restructured UI, added helper functions, updated event handlers - voucher_generator.py: Enhanced PDF rendering to display cancellation days - sample_template.csv: Added cancellation_days column example Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>79a7473 -
Add bulk processing: PDF and CSV upload
Sidd-mukho77Major Features: - 📦 New 'Bulk Processing' tab with two modes - 📄 Bulk PDF Upload: Process multiple booking PDFs - 📊 Bulk CSV Upload: Generate vouchers from CSV data - 📥 ZIP download with all generated vouchers - 📊 Progress tracking for bulk operations Bulk PDF Upload: - Upload multiple PDF files at once - Auto-extract data from each PDF using Gemini - Generate voucher for each booking - Download all as ZIP file Bulk CSV Upload: - Upload CSV with booking data - Required columns: hotel_name, city, checkin, checkout, guest_name - Optional columns: room_type, meal_plan, address, etc. - Process all rows and generate vouchers - Download all as ZIP file UI Changes: - Organized into tabs: 'Single Voucher' and 'Bulk Processing' - Sub-tabs for PDF vs CSV bulk processing - Inline CSV format documentation - Sample CSV template included - Progress indicators during processing - Detailed status messages with results Technical: - process_bulk_pdfs() function for PDF batch processing - proces…b0c3e9f -
Fix preview: Convert PDF to image for reliable display
Sidd-mukho77- Add PyMuPDF (fitz) dependency for PDF rendering - Convert first PDF page to high-res PNG image - Display image preview instead of PDF object tag - Works on all browsers and HuggingFace Spaces - No security/policy issues with base64 images Benefits: - ✅ Always works (no browser restrictions) - ✅ Fast loading (single image) - ✅ High quality (2x resolution rendering) - ✅ No recursive iframe or URI issues - ✅ Reliable on HF Spaces Technical: - Uses PyMuPDF to render PDF at 2x scale - Converts to PIL Image → PNG → base64 - Displays in img tag (universally supported) - Download button provides full PDF Fixes: #preview-not-available50eacf5 -
Add visible PDF preview using object tag with base64
Sidd-mukho77- Add create_pdf_viewer() function for actual preview - Use object tag with base64 data URL (reliable rendering) - Separate download link and preview area - Preview shows immediately below download button - Styled preview with dark theme header showing filename/size UI Changes: - Download button at top (File component) - Preview area below (HTML with object tag) - Instructions panel on right side - No clicking needed - preview auto-shows Technical: - Object tag more reliable than iframe for PDFs - Base64 data URL for object tag (not in iframe src) - Fallback message for unsupported browsers - Error handling with styled error display48d21e3 -
Fix recursive iframe - use native Gradio File component
Sidd-mukho77- Remove custom iframe preview (caused recursive app display) - Use gr.File for both preview and download - Cleaner, more reliable solution - Works on all browsers and HuggingFace Spaces - Add helpful instructions for high-quality viewing Changes: - Remove create_pdf_preview_html function - Remove base64 import (no longer needed) - Single File component for preview/download - Side panel with viewing tips - Click filename for high-quality tab view Fixes #recursive-iframe #uri-too-longbbac1e7 -
Fix URI Too Long error - use Gradio file serving instead of base64
Sidd-mukho77- Replace base64 PDF embedding with /file= route - Fixes 'URI Too Long' error for PDFs - Uses Gradio's allowed_paths file serving - No URL length limits - Browser's native PDF viewer with full features - Cleaner, more efficient solution Changes: - Remove base64 encoding from preview - Use /file={path} with proper URL formatting - Add #view=FitH for better initial display - Maintain styled preview container - Fallback message for unsupported browsersdea1726 -
Add high-quality PDF preview using PDF.js viewer
Sidd-mukho77- Implement PDF.js-based preview for crystal-clear PDF rendering - Use base64 encoding to embed PDFs (avoids file serving issues) - Add styled preview with file size indicator - Separate preview (HTML iframe) and download (File component) - Full-featured viewer: zoom, page navigation, search, print Features: - High-quality PDF rendering (no blur) - Works reliably on HuggingFace Spaces - Mozilla PDF.js viewer from CDN - Preview before download - Professional UI with gradient placeholder Fixes #blur-issue800d8f6 -
Switch to native Gradio File component for PDF upload and preview
Sidd-mukho77- Remove gradio_pdf dependency (no longer needed) - Use gr.File with file_types=['.pdf'] for modern upload - Use gr.File for preview (Gradio 6.x has built-in PDF viewer) - Simplify event handlers (single output for preview) - Update test scripts to remove gradio_pdf checks Fixes: - PDF preview now shows correctly - Modern, native file upload UI - Cleaner dependency tree2eea0cb -
Fix PDF preview recursive iframe issue for HuggingFace Spaces
Sidd-mukho77- Replace HTML iframe with native PDF component for preview - Fixes recursive screen issue on HuggingFace Spaces deployment - Update README with proper metadata and documentation - Add output directory for generated PDFs Changes: - Use gradio_pdf.PDF component instead of HTML iframe - Return file path directly instead of HTML string - Enhanced README with feature list and setup instructionsf0e42b0 -
Fix: Use absolute path for output dir and allowed_paths to ensure file serving works
Sidd-mukho7776a4c44 -
Fix: Add allowed_paths=['output'] to demo.launch() to enable file serving
Sidd-mukho7788d5822 -
Fix: Save generated PDFs to local output dir to fix preview URL 404s
Sidd-mukho774988c60 -
Fix: Use /file= URL for PDF iframe to avoid Chrome blocking base64
Sidd-mukho777f9d17f -
Revert: Use iframe for PDF preview (gr.HTML)
Sidd-mukho77a670b7e -
Fix: Remove share=True and deprecated params
Sidd-mukho7709e2cdf -
Fix: Switch to gradio_pdf, add debug logs, ensure logo path
Sidd-mukho7773abecb -
Deploy: Add app files and logo
Sidd-mukho7759a2274