Skip to content

Conversation

@eliandoran
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @eliandoran, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a comprehensive cleanup and reorganization of the project's codebase. It primarily involves consolidating and relocating various configuration and utility scripts from a temporary _regroup directory to more permanent and logical locations. This effort also includes updating the ESLint setup to a centralized, modern configuration and preparing for future testing framework migrations by removing deprecated test files. The changes aim to streamline the project structure and improve its overall maintainability.

Highlights

  • Codebase Cleanup: A significant number of files, including scripts, configuration files, and test files, have been removed from the temporary _regroup directory, streamlining the project structure.
  • ESLint Configuration Refactor: The project's ESLint configurations have been centralized and updated. Old .js configurations from _regroup were removed, and new .mjs configurations were introduced at the root, along with corresponding package.json updates.
  • Script Relocation and Enhancement: Various utility scripts, such as those for generating certificates, icons, and translations, have been moved from _regroup/bin/ to more organized and permanent locations under apps/server/scripts/ and scripts/ subdirectories. The generate_document.ts script also received enhancements for database initialization and translation setup.
  • Test Infrastructure Update: Several ETAPI test files were removed, with comments indicating a planned migration to Vitest, suggesting an ongoing effort to modernize the testing framework.
  • Repository Migration Scripts Organization: Existing repository migration scripts have been consolidated into a new scripts/repo-migration/ directory, accompanied by a README.md to document their purpose and status.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@eliandoran
Copy link
Contributor Author

/gemini review

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

📚 Documentation preview is ready!

🔗 Preview URL: https://pr-7970.trilium-docs.pages.dev
📖 Production URL: https://docs.triliumnotes.org

✅ All checks passed

This preview will be updated automatically with new commits.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant cleanup and refactoring effort. It successfully moves numerous files from the temporary _regroup directory into more logical and permanent locations within the project structure. A major improvement is the centralization of the ESLint configuration, which enhances maintainability. The changes also include bug fixes and improvements to scripts, such as the schema export and document generation scripts. Overall, this is a very positive change for the project's health and organization. I have a couple of minor suggestions to improve the new ESLint configurations for consistency and robustness.

Comment on lines +52 to +61
const playwrightConfig = {
files: [
"apps/server-e2e/src/**/*.spec.ts",
"apps/desktop/e2e/**/*.spec.ts"
],
plugins: { playwright },
// Override or add rules here
rules: { ...playwright.configs["flat/recommended"].rules, },
languageOptions: { parser: tsParser },
};
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better maintainability and to align with the recommended usage of eslint-plugin-playwright, it's better to spread the flat/recommended configuration object directly and then override specific properties. This approach is cleaner and more robust against future updates to the recommended configuration.

const playwrightConfig = {
  ...playwright.configs["flat/recommended"],
  files: [
    "apps/server-e2e/src/**/*.spec.ts",
    "apps/desktop/e2e/**/*.spec.ts"
  ],
  // The recommended config does not set a parser, so we need to set it.
  languageOptions: { parser: tsParser },
};

Comment on lines +27 to +33
".cache",
"tmp",
"**/dist",
"**/out-tsc",
"apps/edit-docs/demo/*",
"docs/*",
"apps/web-clipper/lib/*"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with the main ESLint configuration (eslint.config.mjs) and the previous configuration file, it would be good to also ignore the packages/* directory here. This ensures that both linting and formatting configurations have the same scope.

        ".cache",
        "tmp",
        "**/dist",
        "**/out-tsc",
        "apps/edit-docs/demo/*",
        "docs/*",
        "apps/web-clipper/lib/*",
        // TODO: check if we want to format packages here as well - for now skipping it
        "packages/*"

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a significant cleanup and refactoring effort, moving many files into a more logical structure under apps/ and scripts/, and centralizing the ESLint configuration. The changes greatly improve the project's organization and maintainability.

My review focuses on a few areas for further improvement:

  • In the generate_document.ts script, the database initialization could be cleaner to avoid side effects, and an import could be made more readable.
  • The new root ESLint configuration could be improved by scoping framework-specific rules to avoid applying them to test files.

Overall, this is a great step forward for the project's structure.

import preact from "eslint-config-preact";

const mainConfig = [
...preact,

This comment was marked as off-topic.

Copy link
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 PR performs cleanup and reorganization of the codebase by moving scripts and configuration files into a more structured layout. The main changes include consolidating scripts into a top-level scripts/ directory, updating ESLint configurations to use a monorepo-friendly setup, and removing deprecated/moved files from the _regroup/ directory.

Key changes:

  • Reorganizes utility scripts (translation, repo migration, icon generation) into a centralized scripts/ directory
  • Modernizes ESLint configuration with separate formatting and linting configs at the root level
  • Removes per-app ESLint configs in favor of a single root configuration
  • Updates test infrastructure with proper timeouts and new E2E tests
  • Fixes the generate_document.ts script to properly initialize the database

Reviewed changes

Copilot reviewed 36 out of 58 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/translation/import-translations-from-weblate-csv.ts New script for importing translations from Weblate CSV format
scripts/translation/create-po-file.sh Shell script for creating/managing PO translation files
scripts/repo-migration/* Scripts used for migrating issues, discussions, and releases between repos
scripts/icons/tray/* SVG icons and build script for generating tray icons at multiple DPI scales
scripts/icons/create-icons.sh Master script for generating application icons for all platforms
eslint.config.mjs New root ESLint configuration using flat config format with TypeScript and import sorting
eslint.format.config.mjs Separate formatting-only ESLint config for code style enforcement
package.json Adds new dev scripts for formatting and linting, updates dependencies
pnpm-lock.yaml Dependency updates including adding lorem-ipsum, eslint-config-preact, removing eslint-plugin-react-hooks
apps/server/scripts/generate_document.ts Fixed database initialization logic and corrected import statements
apps/server/package.json Adds coverage script and generate-document command
apps/client/package.json Adds coverage script, removes unused @eslint/js dependency
apps/server/src/services/import/*.spec.ts Increases test timeout to 60 seconds for import tests
apps/server-e2e/src/*.spec.ts New E2E tests for tree rendering, settings display, and note duplication
apps/*/eslint.config.mjs Removes individual app ESLint configs (consolidated to root)
_regroup/* Removes old/moved files including integration tests, config files, and scripts
.gitignore Adds coverage directories to ignore list
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

apps/server/scripts/generate_document.ts:39

  • Both sqlInit.initializeDb() at line 38 and await sqlInit.dbReady at line 39 are called, but there's already a check for isDbInitialized() at line 31 that exits if the database is not initialized. This seems contradictory - if the database isn't initialized, the script exits, but then you're calling initializeDb(). Consider clarifying the initialization logic or removing the redundant call.

* Issues, using the "Transfer" function for each issue (via `gh cli`).
* The migration logs are available in `migrated-issues.txt`.
* Discussions, which transferred each discussion from the original repo. This one is a bit more complicated (and potentially flaky) since it works via playwright, by manually selecting the "Transfer" function (no API available at the time).
* The migration logs are available in`migrated-discussions.txt`.
Copy link

Copilot AI Dec 6, 2025

Choose a reason for hiding this comment

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

Missing space after "in" - should be "in migrated-discussions.txt" with a space before the backtick.

Copilot uses AI. Check for mistakes.
@eliandoran eliandoran changed the title Chore/cleanup regroup Clean up _regroup Dec 6, 2025
@eliandoran eliandoran added this to the v1.0.0 milestone Dec 6, 2025
@eliandoran eliandoran marked this pull request as ready for review December 6, 2025 17:25
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 6, 2025
@eliandoran eliandoran merged commit 2e915ec into main Dec 6, 2025
18 checks passed
@eliandoran eliandoran deleted the chore/cleanup_regroup branch December 6, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants