summaryrefslogtreecommitdiff
path: root/Biz/PodcastItLater/Web.py
AgeCommit message (Collapse)Author
39 hoursAdd error handling for unconfigured Stripe billing portalBen Sima
- Catch Stripe exceptions when portal not configured - Redirect to account page with user-friendly error message - Display error alert on account page when present - Change portal return URL to /account instead of / Fixes issue when Stripe billing portal settings haven't been configured in test/production dashboard. Amp-Thread-ID: https://ampcode.com/threads/T-8edacbeb-b343-49ca-b524-1c999272acb6 Co-authored-by: Amp <amp@ampcode.com>
40 hoursImplement full account management pageBen Sima
- Display account information (email, creation date) - Show subscription details (plan, status, features) - Display cancellation warning if subscription ending - Add Upgrade button for free users - Add Manage Subscription button for paid users (goes to Stripe portal) - Add logout button in Actions section - Replace Coming Soon placeholder with functional UI Addresses account management epic tasks. Amp-Thread-ID: https://ampcode.com/threads/T-8edacbeb-b343-49ca-b524-1c999272acb6 Co-authored-by: Amp <amp@ampcode.com>
40 hoursAdd remove button to queue status itemsBen Sima
- Add 'Remove' button for non-pending queue items (error, processing, cancelled) - Keep 'Cancel' button for pending items - Update delete_queue_item to check referer and return appropriate response - Use HX-Trigger for queue updates from user page, HX-Redirect for admin - Add confirmation dialog for remove action - Allow admins to delete any job, users can only delete their own Amp-Thread-ID: https://ampcode.com/threads/T-8edacbeb-b343-49ca-b524-1c999272acb6 Co-authored-by: Amp <amp@ampcode.com>
40 hoursSimplify navbar to clean nav linksBen Sima
- Remove 'Logged in as' user email display - Convert button-styled links to standard Bootstrap nav-link style - Left-align navigation links (removed me-auto from wrapper) - Remove logout button from navbar (will be in account page) - Use proper ul/li structure for navbar items The navbar is now cleaner and follows Bootstrap navbar conventions. Amp-Thread-ID: https://ampcode.com/threads/T-8edacbeb-b343-49ca-b524-1c999272acb6 Co-authored-by: Amp <amp@ampcode.com>
40 hoursImprove dev mode login UXBen Sima
- Add mx-1 (horizontal margin) to code element for better text spacing - Pre-fill email input with demo@example.com in dev/test mode - Makes it faster to test login flow in development Amp-Thread-ID: https://ampcode.com/threads/T-8edacbeb-b343-49ca-b524-1c999272acb6 Co-authored-by: Amp <amp@ampcode.com>
40 hoursExtract format_duration utility to UI moduleBen Sima
Moved format_duration function from Web.py to UI.py for better code organization. This is a UI utility function used for displaying episode durations, so it belongs in the shared UI module rather than the web-specific module. Amp-Thread-ID: https://ampcode.com/threads/T-8edacbeb-b343-49ca-b524-1c999272acb6 Co-authored-by: Amp <amp@ampcode.com>
40 hoursReplace bare exception catches with specific exceptionsBen Sima
- Replace Exception with httpx.HTTPError, httpx.TimeoutException, re.error in extract_og_metadata - Replace Exception with ValueError, KeyError in auth verification - Replace Exception with httpx errors and ValueError in submit_article - Replace Exception with ValueError, KeyError, AttributeError in RSS feed generation - Replace Exception with ValueError, KeyError in cancel/retry/delete job handlers Improves error handling specificity and removes BLE001 linter suppressions. Amp-Thread-ID: https://ampcode.com/threads/T-8edacbeb-b343-49ca-b524-1c999272acb6 Co-authored-by: Amp <amp@ampcode.com>
42 hoursSimplify billing to single paid planBen Sima
- Remove /billing page and BillingPage component - Add callout box on home page showing articles remaining for free users - Upgrade Now button goes directly to Stripe checkout - Change tier from 'pro' to 'paid' throughout - Update redirect URLs to go to / instead of /billing - Remove Billing button from navbar, add Manage Account link for all users - Add /account route with coming soon page - Hide payment banner for paid users Amp-Thread-ID: https://ampcode.com/threads/T-7de89e42-947c-4243-be19-0cb75be607e7 Co-authored-by: Amp <amp@ampcode.com>
44 hoursFix tests I thinkBen Sima
amp worked on this overnight, and I cleaned it up a bit this morning. I think its all correct now.
44 hoursMove end to end test to own fileBen Sima
This is a big test, and probably over-dependencied, but it's nice to have an end-to-end test as an overall bug-catcher.
44 hoursCleanup some logging setup codeBen Sima
I think the calls to Log.setup() were accidentally creating multiple loggers, hopefully this fixes the problem.
2 daysPodcastItLater end to end testBen Sima
3 daysMake navbar collapsible on mobile with togglerBen Sima
- Add hamburger toggle button positioned on right side - Navbar collapses on small screens (< lg breakpoint) - Mobile view shows vertically stacked elements: - Logged in as: email - Free: X articles left [Upgrade Now] (free users) - Billing (paid users only) - Admin Queue (admins only) - Logout - Remove 'Plan: Pro' text for paid users (just show Billing button) - Add rounded corners to navbar with 'rounded' class - Remove 1px bottom border in dark mode - Toggle controlled by Bootstrap's collapse component
3 daysConvert user banner to horizontal navbar and make Upgrade btn-successBen Sima
- Change Upgrade Now button from btn-warning to btn-success - Convert user info card to Bootstrap navbar with horizontal layout - Free tier: quota text and Upgrade Now button inline with navbar-text styling - Paid tier: plan name displayed inline as navbar-text - Email, plan info, and action buttons all in single horizontal bar - Uses bg-body-tertiary for automatic light/dark mode compatibility
3 daysMake Upgrade Now an actual button in free tier bannerBen Sima
- Replace '[Upgrade Now]' text link with proper btn-warning button - Add arrow-up-circle icon to Upgrade Now button - Hide Billing button for free tier users (they now have Upgrade Now) - Keep Billing button visible for paid tier users
3 daysRefactor UI components and add dark mode to admin pagesBen Sima
- Create shared UI module (Biz/PodcastItLater/UI.py) with: - create_bootstrap_styles() - create_auto_dark_mode_style() - create_htmx_script() - create_bootstrap_js() - Update Admin.py to use shared UI module and add dark mode support - Update Web.py to use shared UI module - Admin Queue and User Management pages now support automatic dark mode
3 daysMake RSS subscribe link inline with copy-to-clipboardBen Sima
Subscribe link now appears inline next to label. Click copies URL to clipboard and shows 'Copied!' feedback for 2 seconds. Link truncates if too long to fit in bounding box.
3 daysAdd usage banner for free tier users on home pageBen Sima
Free tier users now see 'Free: X articles left [Upgrade Now]' banner. Paid users see plan name with icon as before. Banner replaces the old plan display in user info card.
3 daysRemove personal tier, keep only free and proBen Sima
Simplified pricing to two tiers: - Free: 10 articles total (lifetime) - Pro: $29/month unlimited articles Removed STRIPE_PRICE_ID_PERSONAL from configuration.
3 daysRemove manual approval requirement for new accountsBen Sima
New accounts now default to 'active' status instead of 'pending'. Users can start using the service immediately after signup.
3 daysAdd complete Stripe billing integration to PodcastItLaterBen Sima
- Implement Biz.PodcastItLater.Billing with checkout sessions, billing portal, webhook handling - Add subscription database schema: plan_tier, stripe fields, period dates, stripe_events table - Three-tier pricing: free (10/month), personal (/month, 50 articles), pro (9/month, unlimited) - Usage tracking and enforcement with tier-based limits - Full billing UI with plan display, usage stats, pricing cards, upgrade buttons - Dashboard shows current tier with billing button - Update Web.nix with Stripe environment variables - Fix POST redirects to Stripe with 303 status code for CloudFront compatibility Amp-Thread-ID: https://ampcode.com/threads/T-c139e5b5-1901-4cd6-8030-5623bfe1df35 Co-authored-by: Amp <amp@ampcode.com>
5 daysRemove bg-light from user info card for proper dark modeBen Sima
The bg-light class was forcing the 'Logged in as' card to stay light even in dark mode. Removing it allows Bootstrap's default card background to adapt to dark mode.
5 daysFix dark mode CSS variablesBen Sima
- Set all CSS variables on :root instead of html/body - Added RGB variants needed by Bootstrap - Added secondary, tertiary, and border color variants - Removed unnecessary light mode media query This should now properly apply dark theme when system prefers dark mode.
5 daysPodcastItLater: Fix dark mode - use automatic CSS-only approachBen Sima
- Removed JavaScript theme switcher (not needed) - Removed toggle buttons from all pages - Added automatic dark mode CSS based on prefers-color-scheme media query - Added color-scheme meta tag for native UI hints - Uses inline CSS instead of external file (build system constraint) - Zero JavaScript - pure CSS solution - Automatically follows system/browser dark mode preference Task: t-64tkB5
5 daysPodcastItLater: Add dark mode supportBen Sima
- Added theme switcher script with localStorage persistence - Respects system dark mode preference (prefers-color-scheme) - Added theme toggle button to HomePage and BillingPage - Uses Bootstrap 5.3 data-bs-theme attribute for dark mode - Theme persists across page loads - Icon changes between moon (light) and sun (dark) Task: t-64tkB5
5 daysPodcastItLater: Add Stripe billing and mobile responsivenessBen Sima
- Implemented complete Stripe integration (Billing.py) - Checkout sessions for subscription upgrades - Billing portal for subscription management - Webhook handling for subscription events - Usage tracking with tier-based limits (free: 10, personal: 50, pro: unlimited) - Added billing page UI (BillingPage component) - Current plan display with usage stats - Pricing cards for all tiers with upgrade buttons - Manage subscription button for paid users - Success/error messaging - Database migrations for billing - Added plan_tier, stripe_customer_id, stripe_subscription_id - Added subscription_status, period dates, cancel_at_period_end - Created stripe_events table for webhook idempotency - Added get_usage() method for usage tracking - Made UI mobile-friendly and responsive - Added viewport meta tags to all pages - Replaced pages.HtmlPage with raw html.html for meta tag control - Responsive button layouts with flexbox wrapping - Responsive pricing cards (1 col mobile, 2 col tablet, 3 col desktop) - Touch-friendly forms and buttons (44px minimum) - Responsive padding and containers - Admin tables with horizontal scroll - Added Stripe testing guide (STRIPE_TESTING.md) - Fixed CSS bug in pricing cards (cardh-100 text rendering) - Updated tasks: completed t-144e7lF, t-1pIV0ZF, t-1s8ADC0 Amp-Thread-ID: https://ampcode.com/threads/T-42fd5fb3-3dc5-4cbc-a9a3-78db9e13187e Co-authored-by: Amp <amp@ampcode.com>
6 daysfeat(PodcastItLater): Add usage limit enforcement and billing UIBen Sima
- Enforce tier limits before article submission - Display current plan in user info card (Free/Personal/Pro) - Add Billing button to dashboard navigation - Show friendly upgrade prompt when limit reached - Link to /billing page for plan management Limits enforced: - Free: 10 articles/month - Personal: 50 articles/month - Pro: Unlimited Related to task t-144e7lF
6 daysfeat: Add stripe to Python deps and document dependency processBen Sima
- Add stripe to Omni/Bild/Deps/Python.nix (alphabetically sorted) - Fix all type annotations in Billing.py for mypy - Document how to add Python packages in AGENTS.md - Add billing routes to Web.py (checkout, portal, webhook) This enables Stripe integration in PodcastItLater. Related to task t-144e7lF
6 daysrefactor(PodcastItLater): Clean up RSS configBen Sima
RSS feed already generates personalized titles from user email. Remove unused hardcoded values and change author to PodcastItLater.
6 daysfix(PodcastItLater): Remove audio player, move RSS to episodes sectionBen Sima
- Remove audio player from Recent Episodes (use podcast app instead) - Move RSS feed link from user info card to Recent Episodes section - Fix audio playback interruption on refresh - Simplify user info card to just show email and logout button This fixes the UX issue where dashboard refresh would interrupt playing audio. Completes task t-17Z0069
6 daysfeat(PodcastItLater): Apply Bootstrap 5 UI and fix dev loginBen Sima
- Apply Bootstrap 5 CSS and icons to all pages (Web.py, Admin.py) - Convert all components to use Bootstrap classes instead of inline styles - Add dev mode banner showing demo@example.com for instant login - Implement secure demo account (demo@example.com) with auto-approval - Fix HTMX loading issue when load_styles=False - Update Database.create_user() to accept optional status parameter - Add Bootstrap tables, cards, badges, and button groups throughout - All tests passing Completes task t-144drAE Amp-Thread-ID: https://ampcode.com/threads/T-8feaca83-dcc2-46cb-8f71-d0785960a2f7 Co-authored-by: Amp <amp@ampcode.com>
2025-09-05Add Duration Formatting Function with TestsBen Sima
Implement a new `format_duration` function to convert seconds into a human-readable time format. The function handles various duration scenarios, including minutes, hours, and mixed time representations. Added comprehensive test cases to validate the formatting logic, including edge cases and rounding behavior.
2025-09-05Add HTMX periodic updates for dashboard contentBen Sima
Implement periodic dashboard updates using HTMX to refresh queue status and recent episodes. This improves user experience by automatically updating content without full page reloads. Added a new endpoint `/dashboard-updates` to fetch and render updated dashboard components efficiently.
2025-09-05Refactor Login Flow and Improve User HandlingBen Sima
This fixes a bug where the 'pending' notification didn't show up in the main UI when a new user tried to register.
2025-09-04Refactor Admin and Database path stuffBen Sima
Moved the Admin related stuff to a separate file. Removed the repetitive `db_path` arg everywhere and replaced it with correct assumptions, similar to whats in other apps.
2025-09-04Add Default Titles for Queue ItemsBen Sima
Implement a migration to add default titles to queue items with NULL titles. This ensures that every queue item has a meaningful title, improving user experience and data consistency. The migration updates items with 'Untitled Article' when no title is present.
2025-09-04Add User Status Management to PodcastItLaterBen Sima
Implement user status tracking with pending, active, and disabled states. This allows administrators to control user access and provides a mechanism for approving new users before granting full system access. Added database migration, admin interface, and authentication checks to support this feature.
2025-09-04Add URL auto-select and clear on successful submitBen Sima
Improve user experience by automatically selecting the URL input when focused and clearing the input field after a successful submission. This reduces manual interaction and provides clearer feedback on successful form submission.
2025-09-04Add Episode Metadata: Author and Original URLBen Sima
Enhance episode tracking by adding support for author and original article URL. This allows users to see more context about each podcast episode, improving the overall user experience and providing additional information about the source material.
2025-09-04Add Job Cancellation Feature for Pending Queue ItemsBen Sima
Implement user-initiated job cancellation for pending queue items. This includes adding a cancel button to pending jobs, creating a new endpoint to handle cancellation, updating the queue status view, and adding comprehensive tests to ensure proper functionality and security.
2025-09-04Add Metadata Extraction for Podcast QueueBen Sima
This commit adds support for extracting title and author metadata from URLs when adding articles to the podcast queue. It includes database schema changes, migration logic, and UI updates to display the extracted metadata.
2025-09-03Add Environment-Aware Database Path HandlingBen Sima
2025-09-03Add Admin Whitelist and Access ControlBen Sima
Implement admin access control by introducing an email whitelist and restricting admin-only pages. Added an `is_admin()` function to check user permissions and modified admin queue status view to only allow whitelisted users. Includes error handling for unauthorized access.
2025-09-03Refactor Admin View for HTMX Auto-UpdateBen Sima
2025-09-03Rename "/queue-status" route to "/admin"Ben Sima
2025-08-28Remove email submission featureBen Sima
This requires either setting up my mailserver or signing up with Mailgun, and honestly I don't need either of those things right now. Just use the web submission, I can add the email submission feature later.
2025-08-28Prototype PodcastItLaterBen Sima
This implements a working prototype of PodcastItLater. It basically just works for a single user currently, but the articles are nice to listen to and this is something that we can start to build with.