Skip to content

Conversation

@mkh-user
Copy link
Member

@mkh-user mkh-user commented Sep 25, 2025

Type of Change

  • New feature

Description

Closes #104

Adds a marketplace section that allows users to browse modes, extensions, and themes, and download and install them. It uses the text-forge/mp repository as a server. Each package is defined in a central packages.json file and has a separate folder in the packages/ folder on the server, which contains additional package information, images, and the installation file.
Workflow:

  • The user opens the marketplace window via Settings > Marketplace
  • This window retrieves the information file from the server and uses it to build a list of available packages and their information
  • The user can find the desired package by setting a filter or searching for text. It is also possible to access specific versions of the server by changing the server path from heads/main to other values
  • The user clicks on the desired package
  • The marketplace window reads the selected package's information file from the server and, based on its content, displays a pop-up containing the package name, category, tags, package provider, version, minimum compatible version, details, and other information. The downloaded package images are also displayed. At the same time, a version check is performed based on the package information (see the Package Versioning section for more details) to determine the package's version status relative to the editor, which can be compatible, incompatible, or unverified.
  • If the package is incompatible, the install button is disabled and a warning is displayed. If the package compatibility is unverified, a warning is displayed, but the user can still install the package.
  • The user can click the install button, in which case a download and installation start message is displayed and a request is sent to the server to download the installation file.
  • After the installation file download is complete, the installation is performed automatically and an installation complete message is displayed.

Package Versioning

This system uses a string to process compatibility, similar to this:

>=1.3.0 <1.6.1 || ?2.0.0

It consists of three parts:

1- Minimum version: The lowest supported version, prefixed with <. If it includes =, that version is also compatible; if the editor version is lower, it is incompatible.
2- Maximum version: Optional and can be omitted, the highest supported version, prefixed with >. If it includes =, that version is also compatible; if the editor version is higher, it is incompatible.
3- Unverified version: The first version that is unverified, prefixed with ?. If the editor version is equal to or higher, it is marked as unverified.

Note that the unverified version is checked first. That is, a package labeled >=1.0.0 <2.0.0 || ?3.0.0 is unverified for an editor with version 3.0.0 or 5.2.1 and incompatible for an editor with version 2.0.0 or 2.9.0.

Testing

Tested with themes and modes, there is currently no extension to test.

Impact

No major changes in performance, adds a new action script and a Static class that do not have a significant impact on performance.

Additional Information

A similar system is planned to work on text-forge.github.io/marketplace so that users can browse packages outside the editor as well.

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

    • Introduced a Marketplace window to browse and install themes, extensions, and modes with details, images, search, and category filters.
    • Added Settings entries for Marketplace and Mode Manager.
    • New keyboard shortcut to open the Marketplace.
  • Improvements

    • Better network error handling and clearer user notifications during downloads/install.
    • Minor UI layout and reload icon updates.
  • Style

    • New dark theme styles for package badges, descriptions, dates, and panels.
  • Documentation

    • Setup and modes guides rewritten to emphasize Marketplace installation.

@mkh-user mkh-user added this to the Text Forge 0.2 milestone Sep 25, 2025
@mkh-user mkh-user self-assigned this Sep 25, 2025
@mkh-user mkh-user added the feature: Templates Provides reusable templates for faster setup or content generation label Sep 25, 2025
@coderabbitai coderabbitai bot added the action scripts Official action scripts or action scripts features label Sep 25, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 25, 2025

Walkthrough

Adds a new Marketplace feature: a window action, UI scene and package item component, package fetching/install logic, UI styles, menu entry and shortcut, documentation updates, a reload icon import, minor core scene layout tweak, and some networking/util utilities changes.

Changes

Cohort / File(s) Summary
Marketplace Action
action_scripts/marketplace.gd, action_scripts/marketplace.gd.uid
New WindowActionScript that sets window_scene to the marketplace scene and a UID file.
Marketplace Scene & Controller
action_scripts/scenes/marketplace.tscn, action_scripts/scenes/marketplace.gd, action_scripts/scenes/marketplace.gd.uid
New Marketplace window scene, detailed controller: fetch package list/details, render items, search/filter, compatibility checks, image loading, install/download/unpack flows, notifications; adds UID.
Package Item Component
action_scripts/scenes/package_item.tscn, action_scripts/scenes/package_item.gd, action_scripts/scenes/package_item.gd.uid
New reusable package card scene and script with exported node refs and setup(...) method; UID added.
Networking changes
core/autoload/net_suite.gd
HTTP request error handling added: capture request errors, notify on failure, cleanup request nodes.
Utilities
core/classes/static.gd, core/classes/static.gd.uid
New Static class with EDITOR_VERSION constant and map_array_to_int utility; UID added.
UI assets & theme
assets/reload.png.import, data/themes/dark.tres
New reload icon import descriptor; new StyleBoxFlat resources and theme entries (PackageBadgeLabel, PackageDatesLabel, PackageDescriptionLabel, PackagePanel, PackageVersionLabel) and popup padding.
Menu & Shortcuts
data/main_ui.ini, data/shortcuts.tres
Adds Marketplace and Mode Manager menu items (reindexed codes) and a new "marketplace" shortcut (Alt+Shift+M).
Docs & Changelog
CHANGELOG.md, docs/modes.md, docs/setup.md
Adds Marketplace to changelog; rewrites modes/setup docs to describe Marketplace-centric installation flows.
Core scene tweak
core/main.tscn
Adjusts PopupPanel MarginContainer offsets (layout change).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant Editor
    participant Marketplace as Marketplace Window
    participant Net as NetSuite
    participant Host as Marketplace Host

    User->>Editor: Open Marketplace (menu / shortcut)
    Editor->>Marketplace: Instantiate window scene
    Marketplace->>Net: GET /packages?version=...
    Net-->>Marketplace: packages list / error
    alt packages received
        Marketplace->>Marketplace: render list
        User->>Marketplace: select package
        Marketplace->>Net: GET /package/:id
        Net-->>Marketplace: package details + images
        Marketplace->>Marketplace: populate details, enable Install
        User->>Marketplace: Click Install
        Marketplace->>Host: download package asset
        Host-->>Marketplace: file data
        Marketplace->>Editor: write files / apply (theme/extension/mode)
        Editor-->>User: notify installed / error
    else error
        Marketplace-->>User: notify error
    end
Loading
sequenceDiagram
    autonumber
    participant MW as Marketplace Window
    participant FS as File System
    participant Editor as Editor

    MW->>MW: determine package category
    alt Theme
        MW->>FS: write theme files -> themes path
        MW->>Editor: reload themes
    else Extension
        MW->>FS: write extension files -> extensions path
        MW->>Editor: refresh extensions
    else Mode
        MW->>FS: write mode files -> modes path
        MW->>Editor: register/refresh modes
    end
    Editor-->>MW: success / failure
    MW-->>User: show notification
Loading

Estimated code review effort

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

Possibly related PRs

Poem

I hop through code and find a mart,
New packages gleam like tiny art.
Click, download, unpack with glee,
Themes and modes come home to me.
A twitch, a nibble — installed, hooray! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The pull request includes changes that fall outside the scope of the linked issue, notably the addition of a Mode Manager menu entry in data/main_ui.ini without any corresponding implementation and layout adjustments in core/main.tscn that are unrelated to the marketplace feature. Consider removing or deferring the Mode Manager menu entry until its feature is implemented and revert the core/main.tscn layout adjustments to keep the pull request focused solely on the marketplace enhancement.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely summarizes the primary change by indicating the addition of a marketplace browsing and installation feature, matching the central content of the pull request without unnecessary detail or ambiguity.
Linked Issues Check ✅ Passed The pull request fulfills the primary coding requirements of issue #104 by introducing a dedicated marketplace UI panel with filtering, search, and version source capabilities, displaying full metadata for each package, implementing direct installation workflows, and handling version compatibility statuses consistent with the linked issue’s acceptance criteria.
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 marketplace

📜 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 660f25f and d28d95d.

📒 Files selected for processing (1)
  • action_scripts/scenes/marketplace.gd (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • action_scripts/scenes/marketplace.gd

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.

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 Sep 25, 2025
@mkh-user mkh-user removed the feature: Templates Provides reusable templates for faster setup or content generation label Sep 25, 2025
@mkh-user mkh-user changed the title Marketplace Add Marketplace browsing and installation feature Sep 25, 2025
@mkh-user mkh-user merged commit 935939f into Main Sep 25, 2025
2 checks passed
@mkh-user mkh-user deleted the marketplace branch September 25, 2025 15:06
@github-project-automation github-project-automation bot moved this from In Progress to Completed in Release: Text Forge 1.0 Sep 25, 2025
@coderabbitai coderabbitai bot mentioned this pull request Oct 1, 2025
6 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 9, 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.

Marketplace

2 participants