feat: Image Creator selection + ZIP downloads, unified configs, Playwright E2E, /healthcheck, and config alignment - #525
Merged
Merged
Conversation
## 🎯 AAI-574: CSV Chatflow Detection & Marketplace Template Prompt
### 📋 Overview
This PR implements automatic detection of CSV-tagged chatflows in the
CSV Transformer app and displays a user-friendly prompt to install the
marketplace template when none are found.
### 🚀 Features Implemented
#### ✅ Automatic CSV Chatflow Detection
- System checks for chatflows tagged with `csv` every time user accesses
CSV Transformer
- Real-time filtering and detection logic integrated into main component
#### ✅ Smart Marketplace Integration
- When no CSV chatflows exist, displays an informative prompt card
- Direct navigation to marketplace with `usecase=CSV` filter
- Fallback navigation options for robust user experience
#### ✅ Auto-Refresh Mechanism
- Intelligent localStorage tracking when user navigates to marketplace
- Automatic chatflow list refresh when user returns from installation
- Seamless experience without manual refresh requirements
#### ✅ Responsive UI Components
- New `CsvNoticeCard` component with Material-UI best practices
- Consistent styling matching existing interface design
- Mobile-first responsive design with proper breakpoints
### 📁 Files Changed
#### New Files
- `packages-answers/ui/src/CsvTransfomer/CsvNoticeCard.tsx` - Main
prompt component
- `packages/server/marketplaces/chatflows/Default Answer CSV Processor
Chatflow.json` - CSV template
#### Modified Files
- `packages-answers/ui/src/CsvTransfomer/CsvTransformer.Client.tsx` -
Detection logic & auto-refresh
- `packages-answers/ui/src/CsvTransfomer/ProcessCsv.tsx` - CsvNoticeCard
integration
- `packages/ui/src/views/marketplaces/index.jsx` - CSV usecase filtering
support
### 🎨 UI/UX Improvements
#### Strategic Placement
- Prompt appears below the "AI Processor" selector (not intrusive)
- Only shows when no CSV chatflows are available
- Maintains normal interface functionality
#### Clear Messaging
CSV Processor Setup Required
To use the CSV Transformer, you need at least one chatflow tagged with
'csv'.
Click below to install our ready-to-use CSV processor template from the
marketplace.
After installation: return to this page and the chatflow list will
refresh automatically.
### ⚡ Technical Implementation
#### Detection Logic
```typescript
// Filters chatflows by CSV category
const csvChatflows = (data ?? []).filter((chatflow: any) =>
chatflow.category?.toLowerCase()?.split(';')?.includes('csv')
)
// Shows prompt only when no CSV chatflows exist
{chatflows.length === 0 && onRefreshChatflows && (
<CsvNoticeCard onRefresh={onRefreshChatflows} />
)}
```
#### Auto-Refresh System
```typescript
// Tracks marketplace installation intent
localStorage.setItem('csv-processor-install-intent', 'true')
// Auto-refreshes on window focus when user returns
useEffect(() => {
const checkMarketplaceReturn = () => {
const installedCsv = localStorage.getItem('csv-processor-installed')
if (installedCsv && onRefresh) {
localStorage.removeItem('csv-processor-installed')
setTimeout(() => handleRefresh(), 1000)
}
}
window.addEventListener('focus', checkMarketplaceReturn)
return () => window.removeEventListener('focus', checkMarketplaceReturn)
}, [onRefresh, handleRefresh])
```
### ✅ Acceptance Criteria Validation
| Criteria | Status | Implementation |
|----------|--------|----------------|
| Check performed every access | ✅ | `useEffect` in
`CsvTransformer.Client.tsx` |
| Visually prominent prompt | ✅ | `CsvNoticeCard` with consistent
Material-UI styling |
| Direct install link | ✅ | Navigation to
`/sidekick-studio/marketplaces?usecase=CSV` |
| Clear guidance | ✅ | Step-by-step instructions with return guidance |
| Auto-refresh functionality | ✅ | localStorage tracking + window focus
detection |
| Conditional display | ✅ | `{chatflows.length === 0 && <CsvNoticeCard
/>}` |
### 🧪 Testing Scenarios
#### Scenario 1: New User (No CSV Chatflows)
1. User opens CSV Transformer
2. System detects `chatflows.length === 0`
3. CsvNoticeCard displays below AI Processor selector
4. User clicks "Install CSV Processor"
5. Navigates to marketplace with CSV filter
6. User installs template and returns
7. Chatflow list auto-refreshes, prompt disappears
#### Scenario 2: Existing User (Has CSV Chatflows)
1. User opens CSV Transformer
2. System detects `chatflows.length > 0`
3. CsvNoticeCard does not display
4. Normal CSV processing workflow continues
#### Scenario 3: Error Handling
1. If primary navigation fails, fallbacks to general marketplace
2. If localStorage fails, manual refresh still works
3. Loading states prevent multiple simultaneous navigations
### 🔄 Future Enhancements
- Add analytics tracking for marketplace conversion rates
- Implement template installation status polling
- Add support for multiple CSV template recommendations
- Enhanced error messaging for failed installations
---
### 📊 Impact Summary
This implementation ensures that **new and non-technical users** can
seamlessly set up CSV processing capabilities without confusion or
roadblocks, directly addressing the ticket's core objective of improving
user onboarding experience.
**Ready for review and testing!** 🚀
---------
Co-authored-by: Brad Taylor <bradtaylorsf@gmail.com>
Co-authored-by: Cameron Taylor <cameron@lastrev.com>
Co-authored-by: Cameron Taylor <50385537+ct3685@users.noreply.github.com>
Co-authored-by: Jaime Morales <jaime@lastrev.com>
Co-authored-by: Jaime Morales <jaime.raul.morales@gmail.com>
Co-authored-by: Max Techera <maxi.techerag@gmail.com>
Co-authored-by: Adam Harris <adam@lastrev.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit introduces a new script to export Auth0 users, enhancing the utility of the project. Additionally, it updates the `axios` and `dotenv` dependencies in the `scripts/package.json` to their latest versions, ensuring improved functionality and security. ## Changes - Added `export-auth0-users` script in both `package.json` and `scripts/package.json`. - Updated `axios` to version `^1.8.2` and `dotenv` to version `^16.6.1` in `scripts/package.json`.
# Fix: Disable export button until messages are fully loaded ## �� Problem Fixes [AAI-225](https://lastrev.atlassian.net/browse/AAI-225) When a user presses the export button before all chatflow messages are fully loaded, the system exports an empty JSON file. If the user waits for messages to fully load, the export works as expected and contains all messages. **Issue**: Export button was always enabled, allowing users to export incomplete data resulting in empty JSON files. ## ✅ Solution Disable the export button until all chat messages are completely loaded. This ensures that exports only occur when the message data is fully available, preventing empty JSON downloads and improving the user experience. ### Changes Made #### 1. **Export Button State Management** - Button is now disabled during message loading states - Disabled when `getChatmessageApi.loading` is true (initial message loading) - Disabled when `getChatmessageFromPKApi.loading` is true (detailed message loading) - Disabled when `allChatlogs.length` is 0 (no messages available) #### 2. **Visual Feedback & User Experience** - **Loading State**: Shows spinner icon and "Loading..." text during data fetch - **Ready State**: Shows export icon and "Export" text when ready - **Dynamic Tooltips**: Context-aware help text based on current state - **Visual Styling**: Button opacity and cursor changes when disabled #### 3. **Safety Mechanisms** - **Function-Level Validation**: Added early return in `exportMessages()` function - **Multiple Validation Layers**: Button state + function validation for robustness - **Prevents Race Conditions**: Multiple API calls are properly handled ### Technical Implementation ```jsx // Enhanced export button with loading states <Button variant='outlined' onClick={() => exportMessages()} startIcon={ getChatmessageApi.loading || getChatmessageFromPKApi.loading ? <CircularProgress size={16} color="inherit" /> : <IconFileExport /> } disabled={getChatmessageApi.loading || getChatmessageFromPKApi.loading || !allChatlogs.length} title={getChatmessageApi.loading || getChatmessageFromPKApi.loading ? 'Loading messages...' : allChatlogs.length ? 'Export messages' : 'No messages to export'} > {getChatmessageApi.loading || getChatmessageFromPKApi.loading ? 'Loading...' : 'Export'} </Button> ``` ```jsx // Safety check in export function const exportMessages = async () => { // Prevent export if messages are still loading if (getChatmessageApi.loading || getChatmessageFromPKApi.loading || !allChatlogs.length) { return } // ... rest of export logic } [AAI-225]: https://lastrev.atlassian.net/browse/AAI-225?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
# 🧪 Add Comprehensive E2E Testing with Playwright Integration ## Overview This PR introduces a complete end-to-end testing solution for TheAnswer.ai platform using Playwright, focusing on critical user journeys and role-based access control. This foundational testing infrastructure will help ensure reliability as we scale the platform. ## New Env File add a .env.test file to the apps/web folder. Test User keys have been added to LastPass BASE_URL=http://localhost:3000 AUTH0_SECRET= AUTH0_ISSUER_BASE_URL= AUTH0_BASE_URL= AUTH0_CLIENT_ID= AUTH0_CLIENT_SECRET= TEST_USER_PASSWORD= TEST_ENTERPRISE_AUTH0_ORG_ID= TEST_ENTERPRISE_ORG_NAME= TEST_USER_FRESH_EMAIL= TEST_USER_LOW_CREDITS_EMAIL= TEST_USER_NO_CREDITS_EMAIL= TEST_USER_FREE_TIER_EMAIL= TEST_USER_PRO_EMAIL= TEST_USER_ENTERPRISE_ADMIN_EMAIL= TEST_USER_ENTERPRISE_BUILDER_EMAIL= TEST_USER_ENTERPRISE_MEMBER_EMAIL= ## 🎯 What's Added ### 📋 Comprehensive Testing Strategy - **New File**: `TESTING_STRATEGY.md` - 2,500+ line comprehensive testing strategy document - Layered testing approach (Unit → API → E2E) - Critical user journey identification - Auth0 testing patterns - Billing & permissions testing guidelines ### 🎭 Playwright E2E Testing Framework - **New Directory**: `apps/web/e2e/` - Complete Playwright test suite - Multi-browser testing (Chromium, Firefox, WebKit) - Automatic browser installation checks - Comprehensive environment configuration ### 🔐 Role-Based Authentication Testing - **New File**: `apps/web/e2e/tests/auth.spec.ts` - 597 lines of auth testing - Tests for Admin, Builder, and Member roles - Menu permission validation - Organization switching functionality - Auth0 integration testing with proper error handling ### 🛠 Developer Experience Improvements - **New File**: `apps/web/e2e/README.md` - Detailed setup and usage guide - **New File**: `apps/web/scripts/check-playwright.js` - Automatic browser validation - **New File**: `apps/web/e2e/auth.setup.ts` - Reusable auth setup utilities - **New File**: `.cursor/rules/playwright-e2e-testing.mdc` - AI assistant rules for testing ## 📊 Changes Summary ``` 15 files changed, 5212 insertions(+), 163 deletions(-) ``` ### Key Files Added: - `TESTING_STRATEGY.md` - Master testing strategy document - `apps/web/playwright.config.ts` - Playwright configuration - `apps/web/e2e/tests/auth.spec.ts` - Role-based authentication tests - `apps/web/e2e/auth.setup.ts` - Authentication setup utilities - `apps/web/e2e/README.md` - Testing documentation ### Dependencies Added: - `@playwright/test` - E2E testing framework - `dotenv` - Environment variable management for tests ## 🚀 Features Implemented ### 1. **Multi-Role Authentication Testing** - ✅ Admin role with full permissions - ✅ Builder role with limited access - ✅ Member role with minimal permissions - ✅ Menu visibility validation per role - ✅ Organization switching functionality ### 2. **Robust Test Infrastructure** - ✅ Parallel test execution - ✅ Cross-browser compatibility - ✅ Automatic retry on failure - ✅ Screenshot capture on test failure - ✅ Trace collection for debugging ### 3. **Developer Experience** - ✅ Simple setup commands (`pnpm test:e2e:setup`) - ✅ Multiple run modes (headed, debug, dev) - ✅ Automatic browser installation checks - ✅ Clear error messages and troubleshooting ### 4. **CI/CD Ready** - ✅ Environment-specific configurations - ✅ Configurable retry strategies - ✅ HTML reporting - ✅ Parallel execution control ### Key Test Categories: 1. **Authentication Flow** - Auth0 login, role assignment, session management 2. **Menu Permissions** - Role-based UI visibility and access control 3. **Organization Management** - Multi-org switching and context 4. **Billing Integration** - Credit limits and upgrade flows (planned) ## 🔧 Usage ### Quick Start: ```bash # First time setup pnpm test:e2e:setup # Run tests in development pnpm test:e2e:dev # Run with visible browser pnpm test:e2e:headed # Debug mode pnpm test:e2e:debug ``` ### Test Commands: - `test:e2e:setup` - Install Playwright browsers (one-time) - `test:e2e:dev` - Run tests against development server - `test:e2e:headed` - Run with visible browser windows - `test:e2e:debug` - Interactive debugging mode ## 🔒 Security & Best Practices - ✅ No credentials stored in code - ✅ Environment-based configuration - ✅ Secure auth state management - ✅ Proper cleanup and teardown - ✅ Role-based test isolation ## 📈 Impact ### Quality Assurance: - Automated validation of critical user flows - Early detection of permission regressions - Multi-browser compatibility verification - Consistent authentication behavior ### Developer Productivity: - Faster feedback on UI changes - Automated testing of complex scenarios - Reduced manual testing overhead - Clear testing guidelines and patterns ## 🎯 Future Enhancements (Not in this PR) - API contract testing suite - Billing flow automation - Performance testing integration - Visual regression testing - Mobile device testing ## ✅ Testing Status - [x] Authentication flows work across all browsers - [x] Role-based menu permissions validated - [x] Organization switching functionality tested - [x] Setup scripts and documentation verified - [x] CI/CD configuration prepared ## 📚 Documentation - Complete setup guide in `apps/web/e2e/README.md` - Comprehensive strategy in `TESTING_STRATEGY.md` - Inline code documentation throughout test files - Environment configuration examples --- **Ready for Review**: This PR establishes the foundation for reliable E2E testing across TheAnswer.ai platform. All tests pass and the framework is ready for immediate use and future expansion.
…hancements ( AAI-554 ) (#518) ## Title feat: unify Render and Copilot configs with server, web, and infra enhancements ## Description This pull request delivers a broad set of updates aimed at unifying deployment and runtime behavior across Render, AWS Copilot, and the application codebase. The changes improve consistency, simplify configuration, and add minor enhancements to server functionality and developer tooling. ### Infrastructure & Deployment - **Render services**: Standardized naming (`aai-unified-*`), switched default port from 4000 → 3000, added Redis/Postgres service configs, and updated env vars (e.g., `LOG_LEVEL`, `AUTH0_DEBUG`, `VERBOSE`). - **Security**: Guidance added to restrict Render DB/Redis external access; internal-only access configured by default. - **Copilot configs**: Updated parameter references to use `${App}/${Env}`, revised healthcheck paths, added domain alias handling, and refined access policies. - **Docker**: Added new Dockerfiles for server and web apps with multi-stage builds, updated `.dockerignore` to reduce build context, and switched base image for web from `node:20-alpine` to `node:20-slim`. ### Server Updates - **Authentication**: Migrated from HS256 to RS256 for Auth0 middleware, removing the `secret` field and ensuring issuer-based validation. - **S3 Configuration**: Introduced default region (`us-east-1`) and improved error messages for missing bucket or config. - **Health & Diagnostics**: Added `HEAD /ping` endpoint and updated logging to indicate region and credential usage. ### Web Application - **Render Web Service**: Updated service definitions to match new port and env vars. - **Build & Runtime Flags**: Enabled `NEXT_TELEMETRY_DISABLED`, `NEXT_SHARP_PATH`, and other Next.js-related envs to improve runtime behavior. ### Database & ORM - **Prisma Client**: Logging configuration updated to use `LOG_LEVEL` instead of `DEBUG_LEVEL`, with conditional debug logging when set to `debug`. ### Tooling & Observability - **Sentry**: Removed obsolete Sentry configuration files from the web app.
This commit refines the logging mechanism in the requiredRuntimeVars.js file by introducing distinct environment variables for debug and detailed scan logging. The changes allow for more granular control over logging levels, enabling basic debug information with DEBUG=true and extensive logging with SCANNER_DEEP_LOG=true. Additionally, the progress updates during file processing are now conditionally displayed based on the selected logging level, improving the overall user experience and debugging capabilities.
…ation, and security improvements (#521) ## Title feat: Image Creator selection mode with ZIP downloads, lightbox navigation, and security improvements ## Description ### Motivation Improve user experience with smoother generation progress, keyboard navigation, and effortless switching between images—both within generated sets and across the archive—plus convenient bulk downloads. ### Summary of Changes - **Apps List (packages-answers/ui/src/Apps/Apps.Client.tsx)** - Reordered the “CSV Transformer” entry to appear after “Image Creator” in the “Available Apps” list (no content changes). - **Image Creator Client (packages-answers/ui/src/ImageCreator/ImageCreator.Client.tsx)** - **Imports & Dependencies** - Added `useEffect` and `Modal` (replacing `Dialog`) for a proper lightbox. - Added Tabler icons: `IconChevronLeft`, `IconChevronRight`, `IconCheck`. - Introduced **JSZip** for bulk ZIP downloads. - **Sequential Generation & UX** - Generates images sequentially (`n` requests of `n: 1`) with progressive UI updates and placeholders. - Inputs disabled while generating; primary action reads “Generating & Saving…”. - Messages now support `saved?: boolean` to indicate archival; triggers an **auto-refresh** of the archive when set. - **Lightbox & Keyboard Navigation** - Fullscreen lightbox using `Modal` with **Left/Right** arrows and **Escape** to close. - On-screen chevrons, image counter, and navigation work for both **Generated** and **Archive** sources. - **Archive Enhancements** - Added **selection mode** with checkboxes for archived images. - Selection controls: **Select Images / Exit Select**, **Select All**, **Clear**, and **Download as ZIP** (uses JSZip and client-side fetch). - Card/grid presentation with hover overlays, action buttons (download image / metadata), and improved chips/labels. - **Security & Backend Access** - Consolidated network calls to an authenticated, organization-scoped domain derived from user context. - Requires bearer token from session storage; operations bail out early if the token is missing. - Metadata downloads use the same authenticated domain. - **Misc** - Reads organization label from `(user as any).org_name`. - Minor type casts for user fields. - **Dependencies** - **packages-answers/ui/package.json**: added `"jszip": "^3.10.1"`. - **pnpm-lock.yaml**: synced lockfile for `jszip` and related updates (some packages marked deprecated by upstream; no code changes here). ### Expected Impact - **UX:** Faster perceived performance and fewer clicks via progressive generation, easy keyboard navigation, and a fullscreen viewing experience. - **Convenience:** Bulk-select archived images and **download as a single ZIP**. - **Reliability:** Sequential requests reduce all-or-nothing failures; per-image errors no longer cancel the run. - **Security/Consistency:** Requests are authenticated and scoped to the organization domain. ### Breaking Changes / Operational Considerations - **Security improvements:** Requests now rely on the authenticated, org-scoped domain from user context; prior public/local fallbacks were removed. Local/dev setups must provide user-scoped domain and token. ### Build/CI - New runtime dependency: **jszip** (`^3.10.1`). No other build changes apparent.
…OST and update client options (#524) ## Title fix: align Langfuse configuration — standardize env var to `LANGFUSE_HOST` and update client options ## Description ### Motivation Standardize Langfuse host configuration across the codebase and align option names passed to the Langfuse client. This removes inconsistent env var names and ensures a single source of truth for the Langfuse host. ### What Changed - **.env.template** - Removed `LANGFUSE_BASEURL` entry. (`.env.template`) - **packages/components/src/handler.ts** - In `additionalCallbacks`, replaced `baseUrl` with **`endpoint`** and continued to read from `process.env.LANGFUSE_HOST ?? 'https://cloud.langfuse.com'`. (`handler.ts`) - **packages/components/src/speechToText.ts** - Langfuse client now reads host from **`process.env.LANGFUSE_HOST`** instead of `LANGFUSE_BASE_URL` while still using the `baseUrl` option. (`speechToText.ts`) - **packages/server/src/aai-utils/billing/langfuse/config.ts** - Langfuse client `baseUrl` now sourced from **`process.env.LANGFUSE_HOST`** instead of `LANGFUSE_BASE_URL`. (`config.ts`) - **render.yaml** - `LANGFUSE_HOST` changed from a hardcoded value to `sync: false` (no default value provisioned via Render). (`render.yaml`) ### Expected Impact - **Config consistency:** All runtime code now expects **`LANGFUSE_HOST`** for overriding the Langfuse host. Default continues to fall back to `https://cloud.langfuse.com` when the env var is unset. - **Option alignment:** Components handler now uses the **`endpoint`** option, while other modules still use **`baseUrl`**. This may reflect differing client construction paths; functionally, behavior should remain unchanged if both keys are supported by the Langfuse client in their respective contexts. ### Breaking/Operational Notes - **Env var rename:** Deployments that previously set `LANGFUSE_BASE_URL` or `LANGFUSE_BASEURL` must migrate to **`LANGFUSE_HOST`** to customize the host. - **Render deployment:** `LANGFUSE_HOST` is no longer hardcoded in `render.yaml`. For non-default hosts, set `LANGFUSE_HOST` in the environment. Defaults still resolve to `https://cloud.langfuse.com`. ### Tests - **No test updates apparent from the diff.** - Suggested validation during review: - Verify traces/metrics are emitted when `LANGFUSE_HOST` is unset (default host path). - Verify behavior with a custom `LANGFUSE_HOST`. - Sanity-check that both the `endpoint` (components handler) and `baseUrl` (speech/server) options successfully initialize the Langfuse client. ### Files/Functions Touched - `.env.template`: removed `LANGFUSE_BASEURL` line. - `packages/components/src/handler.ts`: `additionalCallbacks` config object — `baseUrl` → `endpoint`. - `packages/components/src/speechToText.ts`: Langfuse client init — `process.env.LANGFUSE_BASE_URL` → `process.env.LANGFUSE_HOST`. - `packages/server/src/aai-utils/billing/langfuse/config.ts`: Langfuse client init — `process.env.LANGFUSE_BASE_URL` → `process.env.LANGFUSE_HOST`. - `render.yaml`: `LANGFUSE_HOST` now `sync: false`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This commit introduces a new `sonar-project.properties` file to configure SonarCloud analysis for TheAnswer project. The configuration includes project identification, source code settings, test configurations, language-specific settings, rule exclusions, and quality gate settings. This addition aims to enhance code quality monitoring and ensure adherence to best practices across the codebase.
|
maxtechera
temporarily deployed
to
staging - theanswer-iek0
September 8, 2025 20:55 — with
Render
Inactive
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Title
feat: Image Creator selection + ZIP downloads, unified configs, Playwright E2E, /healthcheck, and config alignment
Description
Highlights
.dockerignore/.gitignore; reduce default debug/verbose output; remove stray branch reference in YAML.Contributors
Commits Referenced
Breaking/Config Notes