Skip to content

Conversation

@mkh-user
Copy link
Member

@mkh-user mkh-user commented Nov 30, 2025

Summary of Changes

This PR is a very big refactor for all parts, and it is being done as we approach the 0.2 release. Currently, action scripts, assets, and core were reviewed and refactored and next part will be panels and documentation. This changes also includes small bug fixes and some performance improve. Changes include almost all scripts and scenes.

The applied improvements include standardizing whitespace, correcting comments and documentation (including fixing spelling and grammar and adding class_name to scripts), reviewing action scripts (including adding requirements, removing unused variables, and modifying various functions such as Move Lines to New File and Reset Font Size), replacing duplicate code with new helper functions, reducing code line length, improving scene node naming and functions connected to signals, improving file selection filters, fixing bugs related to saving backups and running unit tests, adding the Global.mark_file_as_unsaved function, reviewing code logic and branching, merging settings loading, renaming the Settings.config variable to Settings.data, disabling custom tests during unit tests, removing the obsolete FileDatabase script, sorting functions logically, fixing the issue of installing internal mods on every run, fixing the issue of the BackupStatus color not changing in case of backup failure, and protecting the editor from installing files from outside the folder when installing plugins and mods.

Related Items

Technical Details & Testing

  • Code style improved:
    • Whitespaces have been standardized.
  • Comments and doc-comments were reviewed:
    • Missing BBCode formatting was fixed.
    • Spelling and grammar errors have been corrected.
    • More sections were commented and documented.
    • class_name was added to a large number of scripts.
  • Action Scripts have been reviewed:
    • Missing requirements were added.
    • Unused old variables were removed.
    • The behavior of the ActionScript Move Lines to New File has been corrected: it now moves the entire content of the selected lines.
    • The problem of font size not loading was fixed with the help of the Reset Font Size ActionScript.
    • The problem of infinite repetition of save_request cycles was resolved.
    • The Toggle Bookmark error in marking unsaved changes was fixed.
  • New helper functions have replaced old and repetitive codes.
  • Line lengths of code should be reduced to less than 100 characters wherever possible.
  • Improved naming of scene nodes.
  • Updated naming of functions connected to signals according to the source node name.
  • Removed lambda functions from chained signal calls.
  • Replaced extra parameters of functions connected to signals with the names __ and ___.
  • Improved file selection filters.
  • Corrected a typo in the filename loafing.png.
  • Fixed the issue of not saving restored backups.
  • Fixed errors during the execution of unit tests.
  • Added a new function Global.mark_file_as_unsaved.
  • Reviewed and corrected code logic and branching.
  • Merged the repeated loading of settings into one step.
  • Changed the variable Settings.config to Settings.data.
  • Custom tests are disabled during unit tests.
  • Removed the obsolete script FileDatabase.
  • Sorted functions in the code based on logic.
  • Resolved the issue of installing internal mods every time.
  • Fixed the issue of BackupStatus color not changing when a backup fails.
  • Protected the editor against installing files from outside the folder during plugin and mod installation.

Checklist

  • Linked all relevant issues/PRs/discussions
  • Code follows project style and guidelines
  • Self-reviewed and tested thoroughly
  • Documentation updated (if applicable)
  • No new warnings or errors introduced
  • Relevant changes added to CHANGELOG

Summary by CodeRabbit

  • New Features

    • New windows and tools: Preferences, Backups, Marketplace, Templates, Mode Manager, New Project, Recent Projects, Command Palette, caret-position UI, Command/Extension export & management, Evaluate Selection, plus built-in copy/paste/cut/delete/replace actions.
  • Bug Fixes

    • Safer extension installs, corrected resource path, secure-delete implemented, and more consistent unsaved-change handling across workflows.
  • Improvements

    • Per-mode indentation presets, improved backups/restore UX, richer project/template workflows, settings/data persistence, UI reorganizations and theming refinements.

✏️ Tip: You can customize this high-level summary in your review settings.

Part 1 of 2 - Action Scripts, Assets, Core
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 2025

Warning

Rate limit exceeded

@mkh-user has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a099392 and 068921b.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
📝 Walkthrough

Walkthrough

Removes the FileDatabase constants; splits Settings into settings/presets/data; adds BackupAPI, Project APIs, editor indentation overrides and signals; introduces many new Window/scene classes and action _run_action handlers; adds numerous editor-setting getters/setters and selection-aware line-processing changes.

Changes

Cohort / File(s) Summary
Removed constants file
\core/classes/file_database.gd`, `core/classes/file_database.gd.uid``
Deleted the centralized FileDatabase class and its UID file.
Settings & core autoloads
\core/autoload/settings.gd`, `core/autoload/project.gd`, `core/autoload/backup_core.gd`, `core/autoload/extensions.gd`, `core/autoload/translation_manager.gd`, `core/autoload/signals.gd`, `core/autoload/global.gd`, `core/autoload/tests.gd`, `core/autoload/net_suite.gd`, `core/autoload/factory.gd``
Split settings into three ConfigFiles (settings/presets/data); added Project signals/state/APIs; introduced BackupAPI and backup_failed signal; added extensions_loaded signal and security checks; added translation cache helper and smaller doc/refactor changes.
Editor startup & API
\core/scripts/editor_api.gd`, `core/main.gd``
Added per‑mode indentation overrides, indentation_settings_updated signal and change/reset methods; reorganized initialization, script/template loading, recent-files handling, and menu/script helpers.
Backup / restore & file handling
\action_scripts/create_backup.gd`, `action_scripts/scenes/backups.gd`, `action_scripts/scenes/backups.tscn`, `core/autoload/backup_core.gd``
Added backup UI class, backup list exports, restore flow with error handling; BackupCore renamed/rewired (API class) and restored backup returns Error and emits failure events.
Action scripts — editor-state accessors
\action_scripts/auto_indent_new_lines.gd`, `action_scripts/highlight_all_occurrences.gd`, `action_scripts/highlight_current_line.gd`, `action_scripts/show_bookmarks.gd`, `action_scripts/show_line_numbers.gd`, `action_scripts/show_minimap.gd`, `action_scripts/show_spaces.gd`, `action_scripts/show_tabs.gd`, `action_scripts/show_control_characters.gd`, `action_scripts/show_fold_gutter.gd``
Added paired _set_value(to: bool) / _get_value() methods wired to corresponding Global.get_editor() flags (editor view/behavior toggles).
Action scripts — new run handlers & unsaved-check standardization
\action_scripts/copy.gd`, `action_scripts/copy_path.gd`, `action_scripts/delete.gd`, `action_scripts/paste.gd`, `action_scripts/replace_all.gd`, `action_scripts/find_and_replace.gd`, `action_scripts/find_next.gd`, `action_scripts/find_previous.gd`, `action_scripts/full_screen.gd`, `action_scripts/go_to_line.gd`, `action_scripts/save.gd`, `action_scripts/save_as.gd`, `action_scripts/reload.gd`, `action_scripts/open.gd`, `action_scripts/new.gd`, `action_scripts/new_with_template.gd`, `action_scripts/recent_files.gd`, `action_scripts/exit.gd`, `action_scripts/restart.gd`, `action_scripts/secure_delete.gd``
Added many _run_action entry points (clipboard, find, fullscreen, go-to-line, replace_all, etc.); standardized unsaved-change checks to Global.has_unsaved_change(); adjusted save signaling and restart/secure-delete flows.
Action scripts — selection, indent & transforms
\action_scripts/convert_indentation_to_spaces.gd`, `action_scripts/convert_indentation_to_tabs.gd`, `action_scripts/move_to_new_file.gd`, `action_scripts/join_lines.gd`, `action_scripts/remove_all_indents.gd`, `action_scripts/toggle_comment.gd`, `action_scripts/toggle_bookmark.gd`, `action_scripts/evaluate_selection.gd`, `action_scripts/line_length_guides.gd`, `action_scripts/reset_font_size.gd`, `action_scripts/create_backup.gd``
Made line-processing selection-aware (skip non-selected lines), refactored join/remove/convert behaviors, added evaluate-selection action, replaced filename-star unsaved marking with state API, and updated backup/create flows.
Action scripts — minor formatting
\action_scripts/*.gd`` (many small files)
Whitespace, blank-line, comment and small typo fixes across many action scripts (non-functional).
Scenes & UI — new windows, components, exports
\action_scripts/scenes/.gd`, `action_scripts/scenes/.tscn`, `action_scripts/scenes/marketplace.gd`, `action_scripts/scenes/marketplace.tscn`, `action_scripts/scenes/extensions.gd`, `action_scripts/scenes/extension_item.gd`, `action_scripts/scenes/mode_manager.gd`, `action_scripts/scenes/new_project.gd`, `action_scripts/scenes/project_settings.gd`, `action_scripts/scenes/template_manager.gd`, `action_scripts/scenes/command_palette.gd`, `action_scripts/scenes/color_picker.gd`, `action_scripts/scenes/backups.`, `data/panels/.tscn``
Added numerous class_name window/component scripts and exported UI properties; implemented marketplace, extensions, mode manager, templates, preferences, command palette, color picker, backups UI, and other scene logic plus many scene node/path restructurings.
Scene files — node renames & path updates
\action_scripts/scenes/.tscn`, `data/panels/.tscn`, `core/classes/simple_panel.tscn``
Renamed container nodes (e.g., MarginContainer→Margin, VBoxContainer→VBox, HSplitContainer→HSplit), updated node paths/signal connections and added oversampling_override = 1.0 to many Window scenes.
Classes & utilities
\core/classes/shortcut_map.gd`, `core/classes/simple_panel.gd`, `core/scripts/caret_pos.gd`, `core/classes/file_database.gd` (removed)`
Added ShortcutMap export and get_shortcut(), added class_name SimplePanel, added CaretPos UI script; removed FileDatabase class entirely.
New features — command palette & evaluate action
\action_scripts/command_palette.gd`, `action_scripts/scenes/command_palette.gd`, `action_scripts/scenes/command_palette.tscn`, `action_scripts/evaluate_selection.gd`, `core/scripts/caret_pos.gd``
Introduced a CommandPalette popup (script + scene), evaluate-selection action (parses/executes expressions), and caret-position UI.
Assets & tests
\assets/loading.png.import`, `tests/performance.gd``
Updated image import mapping/parameters for loading.png and added a -> void return annotation in a test callback.

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title comprehensively summarizes the main objectives of this large refactor PR: preparing for the 0.2 release with improvements to code style, action scripts, and bug fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mkh-user mkh-user self-assigned this Nov 30, 2025
@mkh-user mkh-user added this to the Text Forge 0.2 milestone Nov 30, 2025
@mkh-user mkh-user moved this from Needs Review to In Progress in Release: Text Forge 1.0 Nov 30, 2025
@coderabbitai coderabbitai bot added the action scripts Official action scripts or action scripts features label Nov 30, 2025
coderabbitai[bot]

This comment was marked as resolved.

@mkh-user

This comment was marked as outdated.

@coderabbitai

This comment was marked as outdated.

@coderabbitai

This comment was marked as outdated.

mkh-user and others added 2 commits November 30, 2025 15:57
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@mkh-user mkh-user added feature: Backup Introduces or enhances data backup and restore capabilities bug A confirmed issue causing incorrect behavior or unexpected results labels Nov 30, 2025
coderabbitai[bot]

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai

This comment was marked as resolved.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

@mkh-user mkh-user changed the title 0.2 Release Polish Refactor for 0.2 Release: Code Style, Action Scripts, and Bug Fixes Nov 30, 2025
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

mkh-user and others added 2 commits November 30, 2025 21:15
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

Part 1 of 2 - Panels, Docs
@mkh-user

This comment was marked as outdated.

@coderabbitai

This comment was marked as outdated.

@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@mkh-user
Copy link
Member Author

mkh-user commented Dec 1, 2025

@coderabbitai, based on CHANGELOG.md file content, please provide me additional items I have to add to this file about this PR, just notable changes for end users or big API changes for module developers.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read the CHANGELOG.md file to see what's already documented
cat CHANGELOG.md

Length of output: 14147


@mkh-user, based on the current CHANGELOG.md content, here are the notable additions you should add for PR #139 under the [unreleased] section:

Additions for [unreleased] section:

Added

- **Action Script:** Edit > Evaluate Selection - Evaluates mathematical expressions in selected text ([#139](https://github.com/text-forge/text-forge/pull/105))
- **API:** `Global.mark_file_as_unsaved()` - Marks current file as having unsaved changes ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** `Global.has_file()` - Checks if a valid file is currently open ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** `backup_failed(was_auto: bool)` signal in BackupCore for backup failure notifications ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** `extensions_loaded` signal in Extensions autoload ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** `indentation_settings_updated(use_space, indent_size)` signal in EditorAPI ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** Per-mode indentation override support with `EditorAPI.custom_mode_indentations` ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** `EditorAPI.reset_to_mode_indentation_settings()` ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** `EditorAPI.change_indentation_type(use_spaces)` ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** `EditorAPI.change_indent_size(indent_size)` ([#139](https://github.com/text-forge/text-forge/pull/139))
- Class name declarations to ~40+ files for better type safety ([#139](https://github.com/text-forge/text-forge/pull/139))
- Security validation for plugin/mod file extraction (prevents path traversal attacks) ([#139](https://github.com/text-forge/text-forge/pull/139))

Changed

- **Action Script:** ~Command > Command Pallete~ to Command > Command Palette (renamed, improved search) ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** ~`Settings.config`~ to `Settings.data` (merged settings loading) ([#139](https://github.com/text-forge/text-forge/pull/139))
- **API:** Extension config keys corrected: `on_activate`, `on_deactivate`, `uninstall` ([#139](https://github.com/text-forge/text-forge/pull/139))
- Backup system ID generation now timestamp-based with random suffix ([#139](https://github.com/text-forge/text-forge/pull/139))
- Unsaved file detection now uses `Global.has_unsaved_change()` instead of filename checks ([#139](https://github.com/text-forge/text-forge/pull/139))

Removed

- **API:** ~`FileDatabase`~ class - Use direct path references instead ([#139](https://github.com/text-forge/text-forge/pull/112))

Fixed

- **Action Script:** Move Lines to New File incorrect behavior ([#139](https://github.com/text-forge/text-forge/pull/92))
- **Action Script:** Reset Font Size not loading configuration properly ([#139](https://github.com/text-forge/text-forge/pull/93))
- **Action Script:** Toggle Bookmark incorrectly marking files as unsaved ([#139](https://github.com/text-forge/text-forge/pull/102))
- **Action Script:** Toggle Comment delimiter detection and multi-caret handling ([#139](https://github.com/text-forge/text-forge/pull/139))
- **Action Script:** Restart error handling with process creation validation ([#139](https://github.com/text-forge/text-forge/pull/139))
- Backup system: Restored backup saving functionality ([#139](https://github.com/text-forge/text-forge/pull/54), [#139](https://github.com/text-forge/text-forge/pull/59))
- Backup system: BackupStatus color updates on failure ([#139](https://github.com/text-forge/text-forge/pull/70), [#139](https://github.com/text-forge/text-forge/pull/71))
- Backup system: Infinite save_request cycles ([#139](https://github.com/text-forge/text-forge/pull/73))
- Backup system: Fixed `auto_backup_interval_minutes` setting name (was misspelled) ([#139](https://github.com/text-forge/text-forge/pull/139))
- Internal modes no longer reinstall on every application run ([#139](https://github.com/text-forge/text-forge/pull/3))
- Asset filename: ~`loafing.png`~ to `loading.png` ([#139](https://github.com/text-forge/text-forge/pull/26))
- Unit test execution errors and disabled custom tests during test runs ([#139](https://github.com/text-forge/text-forge/pull/107), [#139](https://github.com/text-forge/text-forge/pull/109))
- File selection dialog filters improved across multiple scenes ([#139](https://github.com/text-forge/text-forge/pull/139))

Key points:

  • Breaking changes clearly marked with strikethrough (old) notation
  • All items reference PR/issue numbers
  • API changes grouped together for module developers
  • End-user facing features and fixes clearly separated

@mkh-user

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@mkh-user mkh-user merged commit def12aa into Main Dec 1, 2025
2 checks passed
@mkh-user mkh-user deleted the 0.2-refactor branch December 1, 2025 07:03
@github-project-automation github-project-automation bot moved this from In Progress to Completed in Release: Text Forge 1.0 Dec 1, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 4, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action scripts Official action scripts or action scripts features bug A confirmed issue causing incorrect behavior or unexpected results feature: Backup Introduces or enhances data backup and restore capabilities

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants