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 -
merge: fix/guest-table-add-row β reliable row-add button for guest tablesβ
Sidd-mukho77 +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0c13aee -
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 -
merge: feat/csv β main β bulk CSV fixes, multi-page Search tab, conf no fixβ
Sidd-mukho77 +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>18797ab -
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: Merge feat/csv β AG Grid table with column-select, paste-fill, deleteβ
Sidd-mukho77 +1: Claude Sonnet 4.6Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>ad66f08 -
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 -
feat: Fix cancellation loop bug and update cancellation text formatβ
Sidd-mukho77 +1: Claude Sonnet 4.6- Break circular update loop between cancellation date/days pickers - Update cancellation text in PDF from 'N days before check-in' to 'Free Cancel until DD MMM YYYY' using the actual deadline date Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>ea5ea7f -
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: Add Flatpickr date range picker across all tabsβ
Sidd-mukho77- Replace separate check-in/check-out gr.DateTime pickers with a single dual-month Flatpickr range picker (calendar icon, auto-closes on selection) - JS initialized via demo.launch(js=...) as IIFE to work with Gradio 6 - Textboxes with elem_id serve as Gradio-visible state for both dates - Bidirectional sync: Python-set dates update the visual picker display - Works across Search Hotel, PDF Extraction, and Bulk CSV tabs598e1cb -
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 -
Remove .env from git and add .gitignore
Sidd-mukho7773b3a18 -
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: PDF extraction + Enhanced skill with PDF processing docsβ
Sidd-mukho77 +1: Claude Sonnet 4.5PDF Extraction fixes: - Switch back to gemini-2.5-flash (more accurate than Flash-Lite) - Add thinking_budget=512 for better extraction accuracy - Improved prompt with clear field requirements - Better error logging for debugging Skill enhancements: - Added comprehensive PDF processing documentation - Inline PDF extraction examples with Pydantic - Files API examples for large PDFs (>5MB) - PDF best practices (size limits, accuracy tips) - Updated model comparison table - Troubleshooting for PDF extraction issues Technical details: - PDFs up to 1000 pages or 50MB supported - Each page = 258 tokens - Native text extraction included - Pages scaled to 3072x3072 max resolution Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>a8bbec7 -
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: Hotel search dropdown + Add voucher optimization skillβ
Sidd-mukho77 +1: Claude Sonnet 4.5Hotel search fixes: - Switch to Google Search grounding (more reliable for broad queries) - Add comprehensive debug logging - Handle multiple response formats (array/dict) - Better error messages for troubleshooting Skill created: - .claude/skills/voucher-optimize.md - Quick commands for testing API calls - Performance settings and model info - Common issues & debugging guide - Environment variables reference Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>4e2f819 -
Major Performance: Upgrade to Gemini 2.5 Flash-Lite + Maps Groundingβ
Sidd-mukho77 +1: Claude Sonnet 4.5ULTRA FAST optimizations: - Switch all operations to gemini-2.5-flash-lite (fastest model) - Use Google Maps grounding for hotel search (70%+ faster) - Remove thinking configs for instant responses - Add structured JSON outputs for reliability Hotel Search improvements: - Maps grounding returns 5-8 accurate hotels with verified data - Fallback to Search grounding if Maps unavailable - Return place IDs, URIs, and grounding metadata PDF Extraction improvements: - 60%+ faster extraction with Flash-Lite - No thinking budget for maximum speed - Maintain accuracy with Pydantic schemas Address Fetching improvements: - 70%+ faster with Maps grounding - Verified addresses from Google Maps database - Accurate phone numbers and check-in/out times Performance gains: - Hotel search: 3-5s β 0.8-1.5s (70% faster) - PDF extraction: 5-8s β 2-3s (60% faster) - Address fetch: 2-3s β 0.5-1s (70% faster) Added GEMINI_OPTIMIZATION.md with complete documentation Co-Authored-By: Claude Sonnet 4.5 <norepβ¦f22dcca -
Performance: Optimize hotel search and PDF extraction speedβ
Sidd-mukho77 +1: Claude Sonnet 4.5Hotel Search improvements: - Use gemini-2.0-flash-exp (faster experimental model) - Remove thinking config for immediate response - Reduce results from 8 to 5 hotels - Simplify prompt for faster processing PDF Extraction improvements: - Reduce thinking budget from 1024 to 256 tokens - Simplify extraction prompt - Maintain accuracy with structured Pydantic output Maps Grounding improvements: - Simplify address lookup prompt - Faster response times Expected speed improvement: 40-60% faster for both operations Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>ee28a02 -
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 -
Add compiled Python bytecode files for `app`, `gemini_utils`, and `voucher_generator`.
Sidd-mukho7710e9c51 -
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 dependency conflicts and add deployment testsβ
Sidd-mukho77- Update Gradio to 6.5.1 (compatible with gradio-pdf) - Pin exact versions in requirements.txt - Add test_deployment.py for comprehensive pre-deployment testing - Add test_quick.sh for rapid validation Fixes: - gradio-pdf requires gradio>=6.0 - google-genai websockets compatibility - HfFolder import error with newer huggingface-hub3f3fffc