Skip to content

Conversation

@mkh-user
Copy link
Member

@mkh-user mkh-user commented Oct 1, 2025

Type of Change

  • Refactoring

Description

Summary of Changes for Refactoring and Performance Improvements

  • Removed the SLib plugin as an additional autoload; introduced a new U autoload for utility functions and an S class for static globals.
  • Replaced all usages of SLib with lower-level APIs or relocated functions accordingly.
  • Moved load_resource and load_resource_threaded from Global to U.
  • Removed the FileDatabase class and transferred its constants to the S class.
  • Eliminated invalid downloadfile entries from package information.
  • Removed redundant checks in the theme loading logic.
  • Changed the Scripts node in the Core (Main scene) from Control to Node to reduce complexity.
  • Replaced About tabs with RichTextLabels instead of complex margin containers.
  • Added a helper callable refresh_module_profiler to eliminate duplicated lambda functions.
  • Replaced legacy auto-free handling of HTTPRequest instances with signal-based usage and improved error handling.
  • Added Network Connections section to the Module Profiler.
  • Implemented timeout support for HTTPRequests in NetSuite.
  • Refactored ThreadedResourceLoaded to operate outside the scene tree and use Object as the base class instead of Node.
  • Moved validation for ThreadedResourceLoader to initialization time.
  • Moved ChangeLog conversion to occur before the About popup is shown, instead of during startup.
  • Added Total Startup Time (in milliseconds) to performance test metrics and removed the incomplete Type Delay metric.
  • Added performance metrics for panel loading and made panel loading threaded.
  • Removed the old menu_button constructor.
  • Replaced the custom Selection class with the internal Rect2i structure.
  • Fixed issues related to test loading.

Testing

Unit and manual tests passed.

Impact

Environment

Hardware Information Software information
CPU Intel Core i5-102101J CPU @ 1.60GHz OS Windows 11 24H2
RAM DDR4 32GB 2667 MT/s Power Mode Best Performance
Disk SSD (NVMe) Godot v4.4.1.stable.official [49a5bc7b6]
GPU NVIDIA GeForce MX350 2GB Build editor

Before

Param Unit Min Max Avg Repeats
Startup Time msec 434 453 441.6 5
Action Scripts Loading Time (background) msec 1220 1259 1238.4 5
Total Startup Time (with background) msec 1654 1712 1680 5
Time to Open File* (First: 100) msec 24 100 44 10
Time to Open File (cached html mode) msec 8 10 9.1 10
Type Delay msec ----- ----- ------ 0
Param Unit Min Max Avg
CPU Usage (Stand by) % 3.1 9.2 5.2
CPU Usage (Heavy load) % 9.2 18.9 13.5
RAM Usage (Stand by) MB 387.1 387.1 387.1
RAM Usage (Heavy load) MB 390.5 399.8 397.2
Memory leak MB ----- ----- 0

After

Param Unit Min Max Avg Repeats
Startup Time msec 246 266 257.4 5
Panels Loading Time (background) msec 243 274 261.2 5
Action Scripts Loading Time (background) msec 1123 1206 1168.6 5
Total Startup Time (with background) msec 1384 1460 1426 5
Time to Open File* (First: 64) msec 27 64 41.7 10
Time to Open File (cached html mode) msec 8 10 8.9 10
Type Delay (Removed) ---- ----- ----- ------ -------
Param Unit Min Max Avg
CPU Usage (Stand by) % 2.7 4.3 3.8
CPU Usage (Heavy load) % 9.1 16.5 14.1
RAM Usage (Stand by) MB 398.1 398.1 398.1
RAM Usage (Heavy load) MB 423.6 477.7 442.6
Memory leak MB ----- ----- 0
  • Switch between .ini & .md files.

Additional Information

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings
  • Changes were added to CHANGELOG

Summary by CodeRabbit

  • New Features

    • "Network Connections" added to the Module Profiler.
    • Background (threaded) resource loading for panels and other assets.
  • Performance

    • Panels load asynchronously; startup now reports improved timing diagnostics.
  • UI

    • About dialog redesigned into tabbed rich-text sections with integrated Change Log.
    • Dark theme: added consistent content margins.
  • Improvements

    • External links and folders open via the system shell for smoother OS integration.
    • More reliable loading and handling of themes, backups, extensions, and project data.
  • Refactor

    • Legacy utility plugin removed; core utilities consolidated into built-in autoloads.

@coderabbitai coderabbitai bot added the action scripts Official action scripts or action scripts features label Oct 1, 2025
@mkh-user mkh-user self-assigned this Oct 1, 2025
@mkh-user mkh-user added this to the Text Forge 0.2 milestone Oct 1, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 1, 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 14 minutes and 48 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 73764cf and 6d794aa.

📒 Files selected for processing (1)
  • core/autoload/translation_manager.gd (3 hunks)

Walkthrough

Replaces and removes the SLib plugin, migrates callers to new S constants and U utilities, adds core/utils threaded resource loader, converts many resource/path APIs, makes panel loading asynchronous, updates HTTP API, and reorganizes several UI and autoload entries.

Changes

Cohort / File(s) Summary
Remove SLib plugin
addons/SLib/*, project.godot
Deletes SLib code, configs, import metadata and UID files; removes SLib autoload and editor plugin entries from project.godot.
New utilities autoload
core/autoload/utils.gd, core/autoload/utils.gd.uid, project.godot
Adds autoload U providing wait, load_resource, load_resources_threaded and ThreadedLoader; registers U in project.godot.
Static → S and constants
core/classes/static.gd
Renames StaticS, adds many path/constants (S.*) and helpers (globalize_path, free_all_children, merge_unique, fade_out).
Namespace / helper migration
action_scripts/*, action_scripts/scenes/*, core/autoload/*, core/scripts/*, data/panels/*, tests/*
Replaces usages of SLib/FileDatabase/Global with S constants and U utilities (e.g., SLib.globalize_pathS.globalize_path, Global.load_resourceU.load_resource, SLib.os_openOS.shell_open, SLib.free_all_childrenS.free_all_children, SLib.waitU.wait). Updates many paths to S.*.
Remove/alter classes & constants
core/classes/selection.gd, core/classes/file_database.gd
Removes Selection class, removes class_name FileDatabase export and MENU_BUTTON_SCENE constant.
Global/loader refactor
core/autoload/global.gd, core/autoload/utils.gd
Moves threaded/resource-loading from Global to U; removes Global.ThreadedLoader APIs; changes caret model to Rect2i and updates get_scripts_node() return type.
Networking API change
core/autoload/net_suite.gd
Changes http_request signature and behavior: replaces auto-free tracking with request-owned lifecycle, new params timeout and download_file, returns HTTPRequest.
Panel loading asynchronous
core/scripts/panel_manager.gd, data/panels/*
Replaces synchronous panel instantiation with threaded resource loading via U.load_resources_threaded; adds _panels map, _complete_loading, and signal load_completed.
Project / recent handling & converters
core/autoload/project.gd, core/main.gd, core/main.tscn
Migrates recent files/projects to S.*, uses U for resource loading, caps recent list, awaits converter script completion, and converts Scripts node type Control→Node; reorganizes About/Change Log UI.
Marketplace & related scenes
action_scripts/scenes/marketplace.gd, action_scripts/scenes/extension_item.gd, action_scripts/scenes/package_item.gd
Replace SLib/FileDatabase references with S and use U.load_resource; update version/compatibility handling and template/path constants.
About / Change Log & theme
core/scripts/change_log.gd, core/main.tscn, data/themes/dark.tres
ChangeLog now extends RichTextLabel and populates on popup; main.tscn tabs converted to RichTextLabel nodes; dark theme adds content margins.
Small action script fixes
action_scripts/exit.gd, restart.gd, forum.gd, github_repository.gd, open_data_folder.gd, submit_issue.gd, share_feedback.gd, recent_files.gd, load_from_backup.gd, line_length_guides.gd
API swaps and namespace updates: SLib.exitget_tree().quit(), SLib.os_openOS.shell_open, use S.* constants, Global.load_resourceU.load_resource, SLib.waitU.wait.
Tests & performance adjustments
tests/*, tests/performance.gd, tests/core/autoload/factory_test.gd
Tests updated to S.*/U.*; removed test_menu_button; performance test awaits panel loading and logs startup timings; process_frame connection style updated.
Assets / plugin metadata removals
addons/SLib/SLib.png.import, addons/SLib/*.uid, addons/SLib/plugin.cfg
Removes SLib import metadata, UID files, and plugin cfg.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor App
  participant PanelManager as PanelManager
  participant U as Utils (U)
  participant Loader as ThreadedLoader
  participant ResourceLoader as ResourceLoader

  App->>PanelManager: _load_panels()
  PanelManager->>PanelManager: collect panel scene paths into _panels
  PanelManager->>U: load_resources_threaded(paths, for_each, after_all)
  U->>Loader: create ThreadedLoader(paths, callbacks)
  Loader->>ResourceLoader: start threaded loads (per path)
  ResourceLoader-->>Loader: resource ready / error (per path)
  Loader-->>PanelManager: for_each(path, resource) per item
  Loader-->>PanelManager: after_all() when done
  PanelManager->>PanelManager: _complete_loading() → instantiate panels, set icons
  PanelManager-->>App: load_completed (signal)
Loading
sequenceDiagram
  autonumber
  actor Caller
  participant Net as NetSuite
  participant Tree as SceneTree
  participant HTTP as HTTPRequest

  Caller->>Net: http_request(callback, request, timeout, download_file)
  Net->>HTTP: new HTTPRequest()
  Net->>Tree: add_child(HTTP)
  Net->>HTTP: configure(timeout, download_file)
  Net->>HTTP: request(url,...)
  HTTP-->>Net: request_completed(result)
  Net->>Caller: callback.call(result)
  Net->>HTTP: queue_free()
Loading
sequenceDiagram
  autonumber
  actor User
  participant Project as Project
  participant U as Utils (U)
  participant Conv as ConverterScript

  User->>Project: convert_project(project_file)
  Project->>U: load_resource(converter_path)
  U-->>Project: Resource (script)
  Project->>Conv: call convert_project(file)
  Conv-->>Project: emit convert_completed()
  Project->>Conv: free()
  Project-->>User: conversion result/notification
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

I nibble at code with whiskers bright,
S hops in place and threads take flight.
Panels load while links now spring,
Paths globalize — I dance and sing.
Thump-thump, a rabbit refactor night 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Refactor singletons" succinctly captures the core refactoring work of removing the SLib autoload and introducing the new S and U singletons to replace legacy global utilities, making it clear and focused on the main change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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.

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[bot]

This comment was marked as resolved.

@mkh-user mkh-user moved this from Needs Review to In Progress in Release: Text Forge 1.0 Oct 1, 2025
@mkh-user mkh-user merged commit 297f5d0 into Main Oct 1, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Completed in Release: Text Forge 1.0 Oct 1, 2025
@mkh-user mkh-user deleted the refactor-singletons branch October 1, 2025 14:50
@coderabbitai coderabbitai bot mentioned this pull request Oct 10, 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

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants