Commit Graph

40 Commits

Author SHA1 Message Date
Matthieu B
6ebafbf328 fix: deduplicate wizard steps in multi-server setups and add bundle selection to API
Default wizard steps were duplicated once per server instance of the same
type (e.g., 2 Plex servers → 6 steps instead of 3). Deduplicate the
server type list before loading steps so each type's steps appear only once.

Also add the missing wizard_bundle_id parameter to the invitation creation
API, matching the existing web UI capability.

Closes #1219
2026-04-01 22:33:27 +02:00
Matthieu B
73c29458fe fix: resolve all test failures, linting errors, and type errors
- Fix 55 test failures caused by missing request contexts and incorrect
  session_transaction() usage across 8 test files
- Fix ruff import sorting errors and unused imports
- Fix 122 type errors: rename method override parameters to match base
  classes, add None guards for fetchone()/datetime, widen dict type
  annotations, add type: ignore for SQLAlchemy stub limitations
- Add [tool.ty.rules] config to suppress unsupported-base warnings
- Fix _ variable shadowing gettext in wizard routes
- Add noqa: ARG002 for unused method arguments required by base class
2026-03-29 16:20:23 +02:00
Matthieu B
9d6e0406d0 feat: help lost user find thier way closes #1063
On accepting an invite, we store a cookie. On the login page a little banner will be shown letting a user know this is an admin page
2026-02-25 02:05:08 +01:00
Matthieu B
89762d96dd feat: add bundle preview functionality and improve token generation tests
- Added a preview link for bundles in the wizard settings page. closes #1048
- Enhanced the wizard steps template to handle bundle preview mode.
- Updated JavaScript to generate URLs for bundle preview and runtime modes.
- Improved test coverage for password reset token generation by asserting token creation.
2025-12-09 14:37:39 +01:00
Matthieu B
fca67912fe feat: implement server-specific color theming for invitations and wizards closes #982 2025-11-06 12:59:57 +01:00
Matthieu B
a8fe651c51 fix: update redirects from public.index to public.root for consistency 2025-11-03 14:53:39 +01:00
Matthieu B
5feaf51337 Enhance wizard step management and UI
- Updated the sub-navigation for the wizard to conditionally display step creation options based on the default state and available bundles.
- Improved the bundles page layout by categorizing steps into pre-invite, post-invite, and additional categories, enhancing user experience.
- Added orphaned step handling to allow users to remove steps that no longer have an associated entry.
- Displayed the associated wizard bundle name in the invite card if applicable.
- Adjusted JavaScript routing for bundle steps in the wizard.
- Modified the development script to set the NODE_ENV to development when installing npm dependencies, ensuring proper handling of devDependencies.
- Updated the subproject reference in the plus directory to indicate a dirty state.
2025-10-26 12:26:26 +01:00
Matthieu B
9b5aa0972a refactor: remove slop from media and new linting rules 2025-10-23 18:33:50 +02:00
Matthieu B
6ab5e024db Revert "Merge pull request #925 from wizarrrr/chore/python-3.14-upgrade"
This reverts commit 35dde7c19a, reversing
changes made to c8cf9905ba.
2025-10-19 14:05:59 +02:00
Matthieu B
36227c762b refactor: Update type hints for user details methods and other functions for improved clarity 2025-10-18 17:42:26 +02:00
Matthieu B
d478686ade refactor: use Flask-SQLAlchemy 3.x get_or_404() pattern and fix line lengths
Replace verbose db.session.get() + abort(404) pattern with the modern
Flask-SQLAlchemy 3.x db.get_or_404() helper method in wizard-related files.

Changes:
- Replaced 7 instances in wizard_admin/routes.py with db.get_or_404()
- Fixed 16 E501 line length violations (>88 chars) by breaking long
  strings and comments across multiple lines
- All changes confined to wizard-related files (in scope for this PR)

Benefits:
- Cleaner, more maintainable code (1 line vs 3 lines)
- Follows Flask-SQLAlchemy 3.x best practices
- Improved code readability with proper line wrapping

Reference: https://flask-sqlalchemy.readthedocs.io/en/stable/api/
2025-10-18 14:01:34 +02:00
engels74
caceccab54 refactor(wizard): improve combo invitation flow consistency
This commit implements two improvements to the combo wizard invitation flow:

1. Badge Display Fix: Added the "pre-invite" / "post-invite" category badge
   above wizard steps in combo invites. This badge was already present in
   single-invite pages but was missing from combo invites.

2. URL Refactoring: Cleaned up combo wizard URLs to match the pattern used
   by single-invite wizards:
   - Before: /wizard/combo/0?category=pre_invite → /j/<code> → /wizard/combo/0?category=post_invite
   - After: /wizard/combo/pre_invite → /j/<code> → /wizard/combo/post_invite

   This makes combo URLs consistent with single-invite URLs
   (/wizard/pre-wizard → /wizard/post-wizard) by removing the step index
   from the path and using path-based category routing.

Changes include:
- Pass step_phase to template for badge display
- Update routes to use path-based categories instead of query parameters
- Update templates and JavaScript to handle new URL structure
- Fix form method attributes and template formatting
2025-10-16 18:24:58 +02:00
engels74
0fb4767457 fix(migrations): reorder wizard category migration and apply pre-rebase formatting
Migration Changes:
- Renamed migration file from 20251004 to 20251005
- Updated down_revision from fd5a34530162 to 08a6c8fb44db
- Ensures migration runs after upstream notification events migration
- Fixes migration chain branching issue
- Removed incorrect merge migration (1e83c67d9785)

Migration chain is now:
fd5a34530162 (disabled attribute) → 08a6c8fb44db (notification events)
→ 20251005_add_category_to_wizard_step (wizard category)

Wizard Refactoring:
- Enhanced uniqueness constraint for WizardStep from (server_type, position)
  to (server_type, category, position)
- Ensures steps in different categories (pre_invite vs post_invite) can have
  the same position indexing without conflict
- Updated wizard state management documentation to explicitly list and
  describe data-* attributes used in steps.html template

Code Quality:
- Applied djlint formatting to 8 template files to minimize rebase conflicts
- Applied ruff format and ruff check --fix (no changes needed)
- Removed redundant requirement comments from spec-driven development
- Fixed case sensitivity in test assertion (POST vs post)
- Updated test references from 20251004 to 20251005 to match corrected
  migration revision ID
2025-10-16 16:57:14 +02:00
engels74
d0df4c6d5d feat: wizard step refactor into pre/post wizard steps
Changes:
  - Pre/post invitation wizard phases
  - Phase-aware routing (/pre-wizard/*, /post-wizard/*)
  - Phase indicator badges (visual categorization)
  - Dynamic completion button behavior
  - Two-column admin layout with category drag-and-drop
  - Invite code management service
  - Enhanced wizard export/import
  - Comprehensive test coverage (17 new test files)
2025-10-16 15:28:48 +02:00
Matthieu B
9af3222d8e fix: and character rendering issues 2025-10-04 12:06:54 +02:00
Matthieu B
ea6858c42b feat: implement mobile optimization and enhance wizard navigation with swipe gestures 2025-10-02 16:29:53 +02:00
Matthieu B
060d74ba27 refactor: enhance widget rendering with context and improve markdown content for Audiobookshelf 2025-10-02 14:01:16 +02:00
Matthieu B
fc49da65f6 refactor: fix ruff linting and ty type errors
- Fix invalid parameter defaults: library_id: str | None = None
- Replace try-except-pass with contextlib.suppress()
- Remove unnecessary dict.keys() calls
- Remove unnecessary variable assignments before return
- Combine nested if statements
- Add type ignore comments for intentional shadowing
- Add type ignore comments for SQLAlchemy dynamic attributes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 22:06:15 +02:00
Matthieu B
95b72160da fix: remove conflicting allow_downloads and allow_live_tv columns from User model 2025-09-10 15:09:05 +02:00
engels74
0f0dedde0a feat: implement wizard step interaction requirement system
Add comprehensive "require interaction" functionality for wizard steps that prevents users from proceeding until they engage with step content.

## Key Features:
- **Database Integration**: New `require_interaction` boolean field in WizardStep model with migration
- **Frontend Gating**: Robust JavaScript system that disables "Next" button until user clicks links/buttons in step content
- **UI Enhancement**: Improved checkbox forms with clear descriptions and visual indicators
- **Event Handling**: Advanced interaction detection with proper HTMX disabling and event capture
- **Admin Interface**: Full integration with wizard configuration forms (main and simple)
- **Export/Import**: Support for require_interaction field in wizard step data operations

## Technical Implementation:
- Disabled button state management with pointer-events and tabindex control
- HTMX attribute manipulation to prevent premature navigation
- Event listener capture phase handling for reliable interaction blocking
- Comprehensive test coverage for interaction scenarios
- Form validation and user experience improvements

## Files Modified:
- Backend: models, routes, forms, services, migration
- Frontend: JavaScript interaction logic, templates, UI components
- Testing: Complete test suite for interaction requirements

This feature ensures users engage with critical wizard content before proceeding, improving onboarding experience and preventing accidental step skipping.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-07 14:46:50 +02:00
Matthieu B
b6e54adbe0 Enhance invitation flow by marking invitations as used and syncing users in background threads 2025-08-14 18:13:11 +02:00
Matthieu B
d4dd57ee1e feat: Add comprehensive connections and expiry management system
- Add new connections management system with MediaConnection and DiscordWebhook models
- Implement dynamic server configuration with URL field support
- Add expiry management system with automatic user cleanup
- Create wizard preset system for streamlined server setup
- Add dedicated connections interface in settings with CRUD operations
- Integrate expiry functionality with connection management
- Add proper form validation and error handling
- Update templates and routes for new connection workflow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 22:21:10 +02:00
snowfudge
c6fa43db31 fix(ui): fix broke markdown rendering 2025-07-16 14:35:53 +07:00
Matthieu B
02126de7b8 Add ty dependency and pre-push hook for type checking
- Added `ty` version 0.0.1a14 to dependencies in `pyproject.toml`.
- Updated `.pre-commit-config.yaml` to include a pre-push hook for type checking using `ty`.
- Made minor adjustments in various files to ensure compatibility with type checking.
2025-07-15 21:32:43 +02:00
Matthieu B
f08e02386c fix and closes #708 2025-07-15 15:13:40 +02:00
Matthieu B
f176e141c8 Merge branch 'main' into dev 2025-07-15 12:57:56 +01:00
Matthieu B
7b8f64af7d Fix SQLAlchemy model constructors to accept keyword arguments
- Added __init__ constructors to all SQLAlchemy models
- Fixed pyright 'No parameter named' errors across the codebase
- Fixed various ruff linting issues (SIM108, E741, E402, SIM102, B904, SIM105)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 13:52:15 +02:00
snowfudge
5450d4a779 fix(ui): layout and animation cleanup
- Prevent brief "content flash" during wizard step transitions (initial load, after first nav click)
- Ensure consistent layout by fixing overflow-x-hidden not applying correctly
- Split shared layout into steps/frame.html to avoid multiple base.html rendering after every nav click
2025-07-14 23:09:01 +07:00
Matthieu B
dd8da235ee Enhance media server support by adding Kavita integration and updating existing routes. Refactor Audiobookshelf, Emby, Jellyfin, and Romm blueprints to utilize a common media blueprint factory. Implement unified invitation processing and improve wizard migration handling. Update templates and forms to accommodate new server types and ensure backward compatibility. 2025-07-12 21:29:13 +02:00
Matthieu B
3e60d9d7a2 Implement bundle-specific wizard functionality and update sub-navigation
- Added a new route for viewing wizard bundles, allowing users to navigate through steps associated with a selected bundle.
- Enhanced session management to support explicit bundle overrides.
- Updated the sub-navigation template to conditionally display the "Create step" button based on the default status.
2025-07-08 15:54:27 +02:00
Matthieu B
b6b2292db5 fix invite section confusion 2025-06-30 22:30:34 +02:00
Matthieu B
9ac933ac26 Add wizard step management and enhance asset building 2025-06-25 23:17:46 +02:00
Matthieu B
6e7f3b0506 Added Romm support, and simplified Media APIs to reduce code duplication. 2025-06-20 20:22:45 +02:00
Matthieu B
6cc740eba9 Update wizard access protection settings and Settings UI
Close #611
2025-06-16 21:08:59 +01:00
Matthieu B
f32bf21496 fix wizard 2025-06-13 18:52:37 +01:00
Matthieu B
4a7aac66c0 fixed wizard shown 2025-06-13 16:28:07 +01:00
Matthieu B
6ffce56a22 Add external url to media server 2025-06-13 14:57:58 +01:00
Matthieu B
1a93445eb4 Restrict wizard to new signups 2025-06-10 17:41:02 +01:00
Matthieu B
807ea96783 Customisable steps 2025-05-22 11:06:10 +01:00
Matthieu B
4889e25d31 Huge rewrite 2025-05-20 13:01:20 +01:00