Skip to content

Conversation

@mkh-user
Copy link
Member

@mkh-user mkh-user commented Aug 27, 2025

Type of Change

  • New feature

Description

This will close #9. Provides Text Forge Project Module (TFPM) as handling core for projects.

Testing

In progress

Impact

Nothing yet

Additional Information

Nothing yet

Todos

  • Add created and modified to project file
  • Add more keys in file section (see Feature: Project #68)
  • Add TFPM version information to project file
  • Add TFPM version to about window
  • Provide a connection port for modules that can translate a project file between multiple TFPM versions
  • Add a cache system for project icons
    The selected image will be saved in the program's data folder (with a random name) and the project file will only keep its name.
  • Add fallback for non-existent icons
  • Complete Save file on moving between project files

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

    • Full project workflow: New/Open/Recent/Close projects, Project Settings UI, New Project and Recent Projects windows, direct .tfproj opening, Files panel to browse project files, project-aware window title.
  • Improvements

    • Recent projects list management (trim/validate), project icon caching, dialogs auto-close on selection, safer project load with conversion prompt and restored open file/caret, autosave handling when switching files.
  • Style

    • Theme and UI layout tweaks; caret visible when editing disabled.
  • Bug Fixes

    • Translation text corrections and safer resource loading guards.
  • Documentation

    • Added project creation and updated menu/setup docs.

@mkh-user mkh-user self-assigned this Aug 27, 2025
@mkh-user mkh-user added feature: Project action scripts Official action scripts or action scripts features labels Aug 27, 2025
@mkh-user mkh-user added feature: Panels feature: Navigation Improves movement across UI sections, files, or project structure labels Aug 27, 2025
@mkh-user mkh-user moved this to In progress in Release: Text Forge 1.0 Sep 6, 2025
@mkh-user mkh-user added this to the Text Forge 0.2 milestone Sep 8, 2025
@mkh-user mkh-user marked this pull request as ready for review September 12, 2025 13:44
@text-forge text-forge deleted a comment from coderabbitai bot Sep 12, 2025
coderabbitai[bot]

This comment was marked as resolved.

@text-forge text-forge deleted a comment from coderabbitai bot Sep 12, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 12, 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 7 minutes and 27 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 1a3774f and 2abb77e.

📒 Files selected for processing (1)
  • docs/menus.md (11 hunks)

Walkthrough

Adds a Project system: new Project autoload singleton, .tfproj handling in editor/open flows, project menu and action scripts, UI windows/scenes for New/Open/Recent/Settings, Files panel and project_file_item, factory/threaded loader tweaks, theme/constants updates, icon caching, and documentation updates.

Changes

Cohort / File(s) Summary of Changes
Project Autoload & Integration
core/autoload/project.gd, core/autoload/project.gd.uid, project.godot, core/main.gd, core/main.tscn, core/scripts/editor_api.gd
New ProjectAPI autoload (signals: project_opened/project_closed/load_files), project lifecycle (load/close), recent-projects, version/conversion flow, icon caching, all_files tracking; autoload entry added; main updates to window title and editor short-circuiting for .tfproj files.
Factory, Globals & Threading
core/autoload/factory.gd, core/autoload/global.gd, core/autoload/translation_manager.gd, core/classes/file_database.gd
Added Factory.accept_dialog and file_dialog auto_free_on_select; ThreadedLoader._pending refactored to Dictionary with per-path statuses and error handling; load_resource guards empty paths; translation string fixes; constants updated/added (RECENT_PROJECTS_DATA, FOLDER_CACHED_PROJECT_ICONS, IMAGE_EXTS) and removed explicit type annotations.
Action Scripts & Open Flow
action_scripts/open_project.gd, action_scripts/close_project.gd, action_scripts/new_project.gd, action_scripts/project_settings.gd, action_scripts/recent_projects.gd, action_scripts/open.gd, plus related action_scripts/*.uid
New action scripts and UID metadata for New/Open/Close/Recent/Settings; open.gd gains .tfproj early-load handling and closes current project when opening files outside Project.all_files.
Project Windows & Scenes
action_scripts/scenes/new_project.gd, action_scripts/scenes/new_project.tscn, action_scripts/scenes/project_settings.gd, action_scripts/scenes/project_settings.tscn, action_scripts/scenes/recent_projects.gd, action_scripts/scenes/recent_projects.tscn, action_scripts/scenes/project_file_item.tscn, action_scripts/scenes/*.gd.uid
New UI windows and scene resources for NewProject, ProjectSettings, RecentProjects and project file item; scripts implement include/exclude lists, icon selection (Project.cache_icon), validation, ConfigFile save/load, and wiring to action scripts.
Files Panel & Scene
data/panels/files/panel.gd, data/panels/files/panel.gd.uid, data/panels/files/panel.tscn, data/panels/files/icon.png.import, data/panels/files/panel.cfg
New Files panel script/scene building a file tree from project include/exclude lists, populating Project.all_files, handling selection with autosave or unsaved-change prompts, and integrating open/save flows; plus icon import manifest and panel config.
UI Data, Theme & Misc Scenes
data/main_ui.ini, data/main_theme.tres, core/main.tscn, action_scripts/scenes/setting_option.tscn, data/panels/find/panel.gd.uid, data/panels/find/panel.tscn
Added project_menu (New/Open/Recent/Close/Settings); theme/stylebox and texture additions; caret_draw_when_editable_disabled flag and About text updated; TabContainer min width adjusted; UID reference updates.
Documentation & Setup
docs/menus.md, docs/setup.md
Added Project section to menus.md and a "Create New Project" guide to setup.md describing .tfproj workflow, fields, Files panel usage, and tips.
Misc Scenes & Resources
action_scripts/scenes/*.tscn, action_scripts/scenes/*.gd.uid, data/panels/files/*, other added UID/scene resource files
New scene resources and UID metadata for project-related UI components and shared resources (project_file_item, setting_option tweaks, etc.).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Menu as Project Menu
  participant Factory
  participant Project as ProjectAPI
  participant Editor as Editor
  participant Files as Files Panel

  User->>Menu: Click "Open Project"
  Menu->>Factory: Show FileDialog (*.tfproj)
  Factory-->>User: File dialog shown
  User->>Factory: Select .tfproj
  Factory->>Project: load_project(path)
  Project->>Project: read & validate ConfigFile
  Project-->>Editor: emit project_opened
  Project-->>Files: emit load_files(include, exclude)
  Files->>Files: build tree, set all_files
  Editor->>Editor: update window title
Loading
sequenceDiagram
  autonumber
  participant User
  participant EditorAPI as EditorAPI
  participant Project as ProjectAPI

  User->>EditorAPI: Open file (path)
  alt path ends with .tfproj
    EditorAPI->>Project: load_project(path)
    EditorAPI-->>User: return (project loaded)
  else non-project file
    EditorAPI->>Project: if has_project() and path ∉ all_files then close_project()
    EditorAPI->>EditorAPI: continue normal file load
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant NewWin as NewProject Window
  participant FS as File System
  participant Factory

  User->>NewWin: Fill fields, press Create
  NewWin->>NewWin: validate inputs
  NewWin->>FS: write ConfigFile (.tfproj)
  alt saved
    NewWin->>Factory: accept_dialog("Project created")
    NewWin-->>User: close window
  else fail
    NewWin->>Factory: accept_dialog("Save failed")
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60–90 minutes

Poem

I thump my paws—new burrows bloom,
A warren of files in project’s room.
I dig a .tfproj, tuck paths in tight,
Trees sprout branches, icons gleam at night.
Hop, click, save—my burrow feels just right. 🐇✨

Pre-merge checks and finishing touches and finishing touches and finishing touches and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning Core objectives from linked issue [#9] are largely implemented: .tfproj load/save with created/modified/version fields and a conversion port, a Project autoload API, New/Open/Close/Recent project actions and dialogs, UI windows for New Project and Project Settings, a Files panel that consumes include/exclude lists, and an icon cache. However, several acceptance items remain incomplete or ambiguous: the requested Project menu placement "before File" is not clearly satisfied (data/main_ui.ini places project_menu before edit_menu but does not explicitly reposition File), the explicit preferences toggle "Save files when moving between project files" appears referenced but is not added to the settings UI/code, and template metadata filling / license placement features are not implemented. Because these acceptance criteria are unaddressed or unclear, the PR does not yet fully satisfy the linked issue requirements. Address the gaps before merging by ensuring the Project menu is placed where the UX spec requires or documenting the intentional placement, add and wire the "Save files when moving between project files" preference (persisted and read by panels/load logic), and either implement template/ license metadata filling or explicitly mark those items out-of-scope in the linked issue and update the PR description and tests.
Out of Scope Changes Check ⚠️ Warning This PR includes several changes that appear outside the Project module scope and affect core behavior or public APIs: core/autoload/global.gd refactors ThreadedLoader._pending and _monitor_loading logic (behavioral change), core/autoload/factory.gd alters accept_dialog/file_dialog signatures and behavior, and core/classes/file_database.gd removes explicit constant type annotations and adds unrelated constants; these edits should be justified or split from the feature work. Such core-level refactors increase review surface and risk regressions independent of the Project feature. Split the unrelated refactors/API changes into separate PRs or expand this PR to justify each core change, include focused tests and changelog notes for API/behavioral modifications, and run the full test/regression suite so maintainers can review the feature changes separately from core refactoring.
✅ 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 and accurately summarizes the primary changes in the diff — adding a Project module (TFPM), .tfproj support, a Project menu, the Files panel, and Recent Projects — and is clear and specific for reviewers scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch project

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.

@mkh-user mkh-user changed the title Project feature Add Project module (TFPM): .tfproj support, Project menu, Files panel and Recent Projects Sep 13, 2025
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

mkh-user and others added 3 commits September 13, 2025 13:46
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>
@mkh-user mkh-user merged commit 00bcfa0 into Main Sep 13, 2025
2 checks passed
@mkh-user mkh-user deleted the project branch September 13, 2025 16:14
@github-project-automation github-project-automation bot moved this from In progress to Done in Release: Text Forge 1.0 Sep 13, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 1, 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 feature: Navigation Improves movement across UI sections, files, or project structure

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

Feature: Projects

2 participants