Skip to content

Feature/93 online features#104

Merged
felix-schultz merged 83 commits intodevfrom
feature/93-online-features
Jul 15, 2025
Merged

Feature/93 online features#104
felix-schultz merged 83 commits intodevfrom
feature/93-online-features

Conversation

@felix-schultz
Copy link
Copy Markdown
Member

This pull request introduces online functionality in the desktop app and the corresponding api changes as well as several important changes across multiple areas of the project, including performance optimizations, coding standards documentation, dependency updates, and the addition of a new AWS Lambda function (file-tracker) for handling S3 and DynamoDB events. Below is a categorized summary of the most significant changes:

Performance Optimizations

Documentation Updates

Dependency Updates

  • Cargo.toml: Updated lambda_http to version 0.15.1 and added new dependencies such as aws-sdk-dynamodb, aws-sdk-s3, and tokio to support AWS integrations. [1] [2]
  • apps/backend/aws/media-transformer/Cargo.toml: Enhanced dependencies for image processing and AWS integrations, including imageproc, webp, and aws-sdk-s3.

New Feature: file-tracker Lambda Function

Miscellaneous Updates

  • .taurignore: Added folders to ignore during the Tauri build process.
  • README.md: Added a call-to-action encouraging users to star the project.

These changes collectively enhance the project's performance, maintainability, and functionality, while introducing new capabilities for handling file-related events in AWS.

- Introduced a new module `file-tracker` in the backend for handling S3 and SQS events.
- Implemented event handler to process S3 events triggered by SQS messages.
- Added necessary dependencies in `Cargo.toml` for AWS SDK and Lambda runtime.
- Created README.md with build, test, and deployment instructions for the new module.
- Updated media-transformer to use the latest version of AWS Lambda events and runtime.
- Enhanced error handling and logging in the event processing logic.
- Modified user and app models in the database schema to include total size tracking.
- Refactored cache directory handling to support user-specific contexts.
…space in addition to percent-encoded characters
…ger logging

- Added an optional `id` parameter to the `create_app` function for better app identification.
- Improved logging in the `init_downloads` function to indicate the number of items resumed in the download manager.
- Updated Sentry tracing initialization to only occur in non-debug builds.
- Added new dependencies `dexie` and `dexie-react-hooks` to the project.
- Modified the `upsert_app` function to include membership creation upon app updates.
- Adjusted connection pool settings in the state management to improve performance.
- Refactored the `AppCard` component for better UI/UX, including improved layout and visibility indicators.
- Introduced new hooks for data injection and invalidation in the React Query client.
- Updated backend state interface to include an `online` status for apps.
- Set incremental compilation to false in backend AWS and local API configurations for optimized builds.
- Adjusted development profile settings in local and desktop API Cargo.toml files for improved debugging and performance.
- Cleaned up dependencies in the API and catalog Cargo.toml files by removing unused workspace references.
- Removed unnecessary dependencies in core Cargo.toml and updated relevant configurations.
- Fixed formatting issues in state.rs by removing trailing whitespace.
refactor: change return type of create_app function to App

fix: update bun.lock to use compatible versions for plugin-log and bun-types

refactor: change app route nesting from /app to /apps for consistency

feat: add new routes for app metadata management and roles

fix: update board routes to use /apps/{app_id}/board path

feat: implement get_app and get_meta routes for fetching application details

feat: add role management routes including get_roles and upsert_role

chore: add team management routes for user invitations and role assignments

fix: update template routes to use /apps/{app_id}/template path

refactor: update upsert_app route to use /apps/{app_id} for consistency

feat: add cache invalidation method to state management

fix: enhance useInvoke hook to bind backend context for function calls
…tting

- Changed the "Edit profile" dropdown item to a link that navigates to the profile settings page.
- Cleaned up constructor formatting in OIDCTokenProvider and TauriBackend classes.
- Improved conditional rendering in DesktopAuthProvider for loading state.
- Enhanced code readability by adding missing semicolons and consistent formatting in various components.
- Introduced ThemeLoader component to manage theme loading based on user profile.
- Removed unused tauriUseAuth function.
- Updated apps-db to use type imports for better clarity.
- Cleaned up useApi hook by removing unnecessary line breaks.
- Enhanced dev-with-config script for better readability.
- Updated get_current_profile function to set execution settings from the profile.
- Adjusted GPU layer setting in LocalModel based on execution settings.
- Modified FlowBoard to use the correct profile fetching method and updated connection mode handling.
- Refactored AppCard component for improved readability and structure.
- Updated Card component to use a shadow-md class for better visual consistency.
- Added new CSS variables for theme management in globals.css.
- Improved use-invoke hook by ensuring consistent backend usage.
- Added theme management functionality with a new theme loader and JSON theme definitions.
- Updated tailwind configuration to include new font and shadow utilities.
- Cleaned up types by removing unused interfaces and adding a new IThemes enum for theme management.
… and enhance remove_user function with permission checks
- Implemented `GET /apps/nodes` to retrieve nodes associated with the application.
- Added `GET /apps/search` for searching applications with various filters and sorting options.
- Created `PUT /apps/{app_id}` for upserting application details, including metadata and roles.
- Introduced `GET /apps/{app_id}/team` to fetch team members and their roles.
- Added functionality for inviting users to the team with `PUT /apps/{app_id}/team/invite`.
- Implemented join request management with `POST /apps/{app_id}/team/queue/{request_id}` for accepting and declining requests.
- Updated error handling to use `InternalError` for specific cases instead of `ApiError::App`.
- Refactored role management to prevent unauthorized role assignments.
- Enhanced caching mechanisms for search results and node retrieval.
- Improved logging for better traceability of actions and errors.
- Introduced a new `storage` module in `utils.rs` to handle storage operations.
- Implemented `construct_storage` function to create storage paths based on app ID and prefix.
- Updated JSON schemas to include new properties such as `execution_mode` in app schema and `multimodal` in preferences schema.
- Added `UserTier` definition in hub schema for user tier management.
- Enhanced LLM response schema to include `annotations` and `audio` fields.
- Created a new `storage-item.json` schema to define storage item structure.
- Updated storage file handling in the UI components to support file uploads and sharing.
- Improved upload progress tracking in the storage system UI.
- Refactored backend state to include storage-related operations for better management of storage items.
- Added HelperState class for managing file metadata and file operations.
- Introduced RoleState class for handling role-related operations in the application.
- Created StorageState class for managing storage items, including upload and download functionalities.
- Developed TeamState class for managing team-related operations, including invite links and join requests.
- Implemented TemplateState class for handling templates and their metadata.
- Added UserState class for user-related operations, including user lookup and notifications.
- Defined interfaces for app, bit, board, event, helper, role, storage, team, template, and user states in the backend state module.
- Removed unnecessary imports and cleaned up entity usage in various route files.
- Replaced `.iter().next()` with `.first()` for better readability and performance in multiple instances.
- Simplified metadata retrieval logic in `get_meta` and `search_bits` routes.
- Consolidated error handling and improved clarity in user invitation and team management routes.
- Enhanced code consistency by standardizing the use of `Option` methods across different modules.
- Streamlined the `make_data_url` and `data_url_to_bytes` functions for better performance and readability.
- Updated event handling in the core flow to reduce redundancy and improve maintainability.
- Implement InviteManagement component for sending direct invites and managing invite links.
- Create TeamJoinManagement component to handle join requests and their approval/rejection.
- Develop TeamManagementPage to integrate team management functionalities including members, invites, and join requests.
- Add UserManagement component for managing team members and their roles.
…ports

- Introduced a new TextEditor component that supports Markdown and Plate.js for rich text editing.
- Updated the UI component exports to include the new TextEditor and restructured existing exports for clarity.
- Enhanced the setQueryParams function to handle undefined values gracefully.
- Added height to the scrollbar in globals.css for better UI consistency.
- Updated package.json to include new dependencies for the TextEditor and related functionalities.
- Updated CommentNode component to include relative positioning for better layout control.
- Introduced useProcessedAttachments hook to streamline attachment processing logic in chat interface.
- Refactored MessageComponent to utilize the new useProcessedAttachments hook for improved attachment handling.
- Added FullscreenEditDialog and FeedbackDialog components for editing messages and submitting feedback.
- Improved backend state management by ensuring proper type imports and interface definitions for AI state.
- Implemented CreationProgress component to display the app creation steps.
- Added ModelCard component for displaying individual model details.
- Created ModelModal for selecting models with search and filter options.
- Introduced ModelSection to manage model selection and skipping functionality.
- Developed AppTemplateFolder and TemplateCard for template selection UI.
- Added TemplateModal for browsing and selecting templates with search and filter capabilities.
- Implemented TemplateSection to manage template selection and skipping.
- Created useTemplateFolders hook to organize templates by application.
- Updated app-state and board-state to support optional template parameter.
- Implemented `push_template_data` function in the template module to allow pushing template data with optional versioning.
- Updated the Tauri command registration to include the new `push_template_data` function.
- Enhanced error handling in the API error module by renaming `Internal` to `InternalError` and adding a `BadRequest` variant.
- Introduced new role permissions for reading and writing courses.
- Updated API routes to reflect changes in template handling, including renaming routes from `/template` to `/templates`.
- Refactored various API endpoints to utilize the new error handling structure and ensure consistency in error responses.
- Added a new user route for fetching templates associated with the user.
- Enhanced the core application logic to support pushing template data and overwriting template versions.
- Updated UI hooks to improve data fetching and handling.
@felix-schultz felix-schultz requested a review from Copilot July 15, 2025 20:11
@felix-schultz felix-schultz self-assigned this Jul 15, 2025
@felix-schultz felix-schultz added the enhancement New feature or request label Jul 15, 2025
@deepsource-io
Copy link
Copy Markdown

deepsource-io bot commented Jul 15, 2025

Here's the code health analysis summary for commits ab78238..2096c07. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Docker LogoDocker✅ SuccessView Check ↗
DeepSource Rust LogoRust❌ Failure
❗ 252 occurences introduced
🎯 96 occurences resolved
View Check ↗
DeepSource JavaScript LogoJavaScript❌ Failure
❗ 1871 occurences introduced
🎯 410 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces significant online functionality to the desktop app along with comprehensive API changes, performance optimizations, and new AWS Lambda functions. The main purpose is to add online capabilities while maintaining backward compatibility and enhancing the overall platform architecture.

Key changes include:

  • Addition of online functionality with team management, user invitations, and project collaboration features
  • Introduction of new AWS Lambda function (file-tracker) for S3 and DynamoDB event handling
  • Performance optimizations for Rust compilation and dependency management
  • Comprehensive API restructuring with new endpoints for user management, templates, and notifications

Reviewed Changes

Copilot reviewed 213 out of 532 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/core/Cargo.toml Removed unused dependencies and updated tempfile version for dependency cleanup
packages/catalog/src/utils/string/template.rs Fixed spelling error and improved error handling with proper Result propagation
packages/catalog/src/storage/path/dirs/cache_dir.rs Added user_scope parameter to cache directory functionality
packages/api/src/state.rs Added caching layers, tracing instrumentation, and new master app/board methods
packages/api/src/routes/user/*.rs New user management endpoints for templates, notifications, invitations, and user lookup
packages/api/src/routes/app/*.rs Comprehensive API restructuring with new team, roles, events, and data management endpoints

let placeholders = template.undeclared_variables(false);
context.log_message(
&format!("extracted placholders: {:?}", placeholders),
&format!("extracted placeholders: {:?}", placeholders),
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed spelling error: changed 'placholders' to 'placeholders'

Copilot uses AI. Check for mistakes.
.iter()
.find(|meta| meta.lang == language)
.or_else(|| meta_models.iter().next())
.or_else(|| meta_models.first())
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement: using .first() instead of .iter().next() is more idiomatic and clearer

Copilot uses AI. Check for mistakes.
Comment on lines 51 to 52
let bit = match bit.into_iter().next() {
Some((bit, _)) => bit,
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement: using .first().map() instead of .iter().next().and_then() is more idiomatic

Suggested change
let bit = match bit.into_iter().next() {
Some((bit, _)) => bit,
let bit = match bit.first() {
Some((bit, _)) => bit.clone(),

Copilot uses AI. Check for mistakes.
.await?;

if let Some(role) = role {
println!("Updating role: {:?}", role);
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use proper logging instead of println! for production code. Replace with tracing::debug! or similar

Suggested change
println!("Updating role: {:?}", role);
tracing::debug!("Updating role: {:?}", role);

Copilot uses AI. Check for mistakes.
Comment on lines 64 to 65
.add_template("template", &template_string)
.unwrap();
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement: using ? operator instead of .unwrap() provides better error handling

Suggested change
.add_template("template", &template_string)
.unwrap();
.add_template("template", &template_string)?;

Copilot uses AI. Check for mistakes.
@@ -77,7 +77,7 @@ impl NodeLogic for TemplateStringNode {
}

// render template
let rendered = template.render(template_context).unwrap();
let rendered = template.render(template_context)?;
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good improvement: using ? operator instead of .unwrap() provides better error handling

Copilot uses AI. Check for mistakes.
@felix-schultz felix-schultz merged commit 752a6ef into dev Jul 15, 2025
0 of 4 checks passed
@felix-schultz felix-schultz deleted the feature/93-online-features branch July 15, 2025 20:16
@felix-schultz felix-schultz mentioned this pull request Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants