Skip to content

Conversation

@mkh-user
Copy link
Member

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

Type of Change

  • UI/UX improvement

Description

Action Scripts are divided into two main categories (file menu) and secondary (the rest). The user interface will be fully usable after loading the main items, so there is no need to wait until the end of the loading process. This roughly halves the actual startup time (-60.4%), although the overall startup is slightly slower.

Testing

Works perfectly.

Impact

Environment

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

Before

Param Unit Min Max Avg Repeats
Startup Time msec 253 276 260.4 5
Panels Loading Time (background) msec 278 295 284.4 5
Action Scripts Loading Time (background) msec 1205 1513 1390.0 5
Total Startup Time (with background) msec 1458 1771 1650.0 5

After

Param Unit Min Max Avg Repeats
Startup Time msec 239 308 275.6 5
Panels Loading Time (background) msec 269 348 300.6 5
Main Action Scripts Loading Time (background) msec 349 434 376.8 5
Total Startup Time (with background) msec 603 742 652.6 5
All Action Scripts Loading Time (background) msec 1163 1567 1360.4 5
Total Setup Time (with background) msec 1402 1821 1636.0 5

Overall Comparison

Param Change Percent
Startup Time 260.4 -> 275.6 +5.8%
Panels Loading Time (background) 284.4 -> 300.6 +5.6%
Main Action Scripts Loading Time (background) 376.8 -------
Total Startup Time (with background) 1650.0 -> 652.6 -60.4%
All Action Scripts Loading Time (background) 1390.0 -> 1360.4 -2.0%
Total Setup Time (with background) 1636.0 -------

Additional Information

This update includes test improvements, improvements in the behavior of automatically loading the last file, a separate loader for main Action Scripts, setting the default values of the View menu as the editor default, and removing the search_delay parameter from the performance test.

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

    • Code editor enhancements: minimap, highlight current line and occurrences, line length guides (80/100), and gutters for bookmarks, line numbers, and folding.
    • Faster, smoother startup via staged loading; options become available sooner.
    • Editor now auto-focuses after the last file auto-loads.
  • Documentation

    • Changelog updated with specific spec references and a new Unreleased section.
  • Tests

    • Performance tests expanded to separately measure startup and file-open paths with refined timing outputs.

@mkh-user mkh-user self-assigned this Oct 3, 2025
@mkh-user mkh-user marked this pull request as ready for review October 3, 2025 06:04
@mkh-user mkh-user moved this from Needs Review to In Progress in Release: Text Forge 1.0 Oct 3, 2025
@mkh-user mkh-user added this to the Text Forge 0.2 milestone Oct 3, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 3, 2025

Walkthrough

Introduces two-phase loading of action scripts in core/main.gd with a new _main_scripts_loaded callback and emits a check_options signal between phases. Updates performance testing to use multiple flags and parameterized behavior. Adjusts CodeEdit UI properties in the scene. Adds documentation updates and expands performance metrics and flow in tests/performance.gd.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Reworded references to Keep a Changelog and SemVer with editions; added Unreleased section noting loading main action scripts; documentation-only edits.
Autoload Test Flags
core/autoload/tests.gd
Replaced PERFORMANCE_TEST with PERFORMANCE_ALL, PERFORMANCE_STARTUP, PERFORMANCE_OPEN_FILE; updated _ready to use grouped flag and pass new parameters to performance test.
Main Script Loading Flow
core/main.gd
Split action script loading into main and low-priority phases; added _main_scripts_loaded callback to emit check_options; retained _all_scripts_loaded for completion; set editor focus after auto-opening last file.
Editor UI Tweaks
core/main.tscn
Enabled minimap, current-line and occurrence highlighting, line-length guidelines, and gutters for bookmarks, line numbers, and folds on the CodeEdit node.
Performance Metrics & Control
tests/performance.gd
Added startup and open_file flags with constructor; conditional first-frame timing and open-file monitoring; awaited panel loading when startup only; expanded and reordered timing outputs; removed _monitor_search.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Main as Main (core/main.gd)
  participant Loader as ScriptLoader
  participant Signals
  participant Editor

  User->>Main: Start app
  Main->>Loader: load(main-script paths)
  Loader-->>Main: main scripts loaded
  Main->>Main: _main_scripts_loaded()
  Main->>Signals: emit check_options
  Main->>Loader: load(low-priority scripts)
  Loader-->>Main: all scripts loaded
  Main->>Main: _all_scripts_loaded()
  alt last file auto-opened
    Main->>Editor: grab_focus()
  end
Loading
sequenceDiagram
  autonumber
  participant Tests as Autoload Tests
  participant Perf as tests/performance.gd
  participant Panels as PanelManager
  participant Signals

  Tests->>Perf: new(startup, open_file)
  alt startup == true
    Perf->>Perf: record start_time on first frame
    Perf->>Panels: await load_completed
    Panels-->>Perf: completed
    Perf->>Signals: await check_options
    Signals-->>Perf: received
    Perf->>Perf: print main scripts time, total startup, all scripts time, total setup
  end
  alt open_file == true
    Tests-->>Perf: open_started signal
    Perf->>Perf: measure open-file time
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I nudge two phases, hop-hop through the load,
Main scripts first, then side paths down the road.
Timers tick-tock, my whiskers take note,
Editor blinks—focus found, afloat.
With gutters and highlights, I twitch in delight—
Performance carrots crunched just right. 🥕✨

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 succinctly summarizes the primary change—introducing priority‐based loading for action scripts—without extra noise or vague phrasing, directly reflecting the PR’s objective to load main scripts first.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch priority-based-action-script-loading

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db3e727 and 8df81ad.

📒 Files selected for processing (5)
  • CHANGELOG.md (1 hunks)
  • core/autoload/tests.gd (1 hunks)
  • core/main.gd (3 hunks)
  • core/main.tscn (1 hunks)
  • tests/performance.gd (1 hunks)
🔇 Additional comments (1)
CHANGELOG.md (1)

5-11: Changelog updates look good

Appreciate the edition-specific references and the new unreleased entry; formatting stays consistent with the rest of the document.


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 merged commit d6e8568 into Main Oct 3, 2025
2 checks passed
@mkh-user mkh-user deleted the priority-based-action-script-loading branch October 3, 2025 06:15
@github-project-automation github-project-automation bot moved this from In Progress to Completed in Release: Text Forge 1.0 Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants