Feat: Implement Robust Hybrid Data Loading and Major App-wide Refactor #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR represents a major evolution of the application, touching three critical areas: data fetching architecture, developer operations (CI/CD and testing), and codebase modernization. It introduces a robust hybrid data loading strategy, completely revamps the CI pipeline for better reliability and speed, and executes a significant app-wide refactor to align with updated dependencies and improve code quality.
🚀 Part 1: Architectural Overhaul - Data Loading & Initialization
This is the headline feature, designed to deliver an instant loading experience when possible, while gracefully degrading to a P2P-only model when necessary.
plugins/router.ts): A new globalrouter.beforeEachguard orchestrates all initial data loading. It performs a health check on a fast REST API; if healthy, it pre-fetches and seeds the TanStack Query cache, providing a near-instantaneous UI render.App.vue,composables/lensInitialization.ts): If the API is unavailable, pre-fetching is skipped.App.vuedisplays a smart loading screen that only appears while waiting for the P2P network to initialize and provide data.composables/lensInitialization.ts): ThelensServiceinitialization now runs in the background via theuseLensInitializationcomposable, preventing it from blocking the UI. Dialing logic has also been refined for better logging.plugins/router.ts): NewbeforeEnterguards on/upload,/admin, and/release/:idhandle route protection and pre-fetching for direct navigation.plugins/router.ts): AgetApiUrlfunction now robustly parses theVITE_LENS_NODEmultiaddr to construct the correct API URL for any environment.⚙️ Part 2: Developer Operations & Testing Overhaul
This PR completely modernizes the CI/CD pipeline and testing strategy for improved feedback loops, reliability, and clarity.
.github/workflows/ci.yml):lint.yml,tests.yml,typechecking.yml, etc.) with a single, unifiedci.yml.Lint & Type-Check,Unit Tests) and a final dependent job for comprehensive testing (Build & E2E Tests).tests/*.spec.ts).playwright.config.tsand a basic smoke test intests/e2e/.package.jsonscripts to separatetest:unitandtest:e2ecommands.utils.spec.tsinto a dedicatedtests/unit/directory.eslint.config.js):ignoresto prevent linting of build artifacts and test reports.package.json,pnpm-lock.yaml):@riffcc/lens-sdk(from0.1.25to0.1.32) and@playwright/test.🧹 Part 3: App-wide Refactoring & UI Enhancements
These changes align the codebase with the new architecture, dependency updates, and improve overall quality.
types.ts,plugins/lensService/hooks.ts):ReleaseItem,FeaturedReleaseItem, etc.) have been standardized to align with the latestlens-sdkcontracts.endTime,to).composables/staticData.ts).views/accountPage.vue,components/layout/appBar.vue):canUpload,canAccessAdminPanel) to accurately control the visibility of UI elements like the "Upload" and "Admin" links.HomePage.vue: The logic for creating content sections (activeSections) has been significantly simplified and made more performant.vuetify.ts, fixed category matching inreleasePage.vueandcategoryPage.vue, and removed the unusedRegisterForm.vue.AnyObjecttypes, unused SDK property imports, and updated props/state across numerous components to use the new standardized types.package.json,docs/lens_nginx.conf):package.jsonscripts for clarity, separatingdev,build,test, and Electron-specific commands.