Skip to content

Polish documents and fix bugs - #3

Merged
Wokrlie merged 3 commits into
mainfrom
dev
Oct 31, 2026
Merged

Wokrlie merged 3 commits into
mainfrom
dev

Conversation

@Wokrlie

@Wokrlie Wokrlie commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Summary

Brings dev to main for the v0.1.3 release. It fixes the crash that made the panel unusable outside a Git repository, points the panel at the folder actually open in the Editor, and replaces the placeholder documentation with a documentation set that matches the code.

Fixes

  • The panel crashed in every project that was not a Git repository. on_render_content called _render_no_repo_ui(), but the method was never defined, so the documented "Create Git Repository" view raised AttributeError instead of rendering. The view is now implemented, and git init runs from it.
  • The panel operated on the wrong folder. repo_path was os.getcwd() — the Editor process working directory — even though the code comment claimed it preferred the Editor's project root. It now resolves project_context.get_project_root(), falling back to the working directory only when no project is loaded, and re-resolves on every read so switching projects does not leave a stale path behind.
  • The Window-menu label rendered a raw translation key. The panel declared title_key="wokrlie.git_panel", which is not declared in translations.json. The Editor resolves panel titles with t(title_key), which returns the key unchanged when it is missing, so the menu showed the literal string wokrlie.git_panel. The key is now wokrlie.git_integration.panel_title.
  • Clicking the manual refresh ran an extra unthrottled git status. The refresh button stored a time.monotonic() timestamp while the throttle compared against time.time(), so the next frame always looked stale. Both now use time.time().
  • Collapsing headers lost their open state. The file count was part of the ImGui widget ID, so staging a file reopened the section. The ID is now fixed with a ### marker.
  • The runtime shipped a placeholder component. runtime/ contained a Null component that announced "This plugin does not include any runtime components." The plugin is editor-only, so the component and its export are gone.

Changes

  • The panel UI is localized in English and Simplified Chinese through package/editor/translations.json — 13 keys with identical key sets in both locales. Every visible string was previously hardcoded English, while the Chinese usage page implied a Chinese UI.
  • The commit button reads Commit, and the menu path is documented as Extensions/Git Integration.
  • files_status_list, left over from the 0.1.3 status refactor, is removed.

Documentation

  • README.md / README.zh-CN.md rewritten: feature list, engine and Git requirement tables, installation from a release archive and from source, a troubleshooting section, and the local development commands. The Chinese README no longer carries the "plugin template" title, and the English grammar error in the opening line is gone.
  • package/plugin_pages/usage.md / usage.zh-CN.md rewritten to match the panel: the real menu path, the real button labels, a restored heading structure, the one-second refresh throttle, and a troubleshooting section.
  • CHANGELOG.md / CHANGELOG.zh-CN.md: the "Planned" section moved to the roadmap, the 0.1.2 entry no longer disagrees between the two languages, and the 0.1.3 entries describe what the code actually does.
  • New: ROADMAP.md, CONTRIBUTING.md, RELEASING.md.
  • LICENSE: copyright holder updated from the template placeholder.

Verification

python .infernux-dev/validate.py          # Package layout and Python sources are valid.
python -m unittest discover -s tests      # Ran 22 tests — OK
python package.py build dist/plugin.inxpkg
python package.py verify dist/plugin.inxpkg
  • The build is deterministic: two builds over the same source produce byte-identical archives, matching the reproducibility check in CI.
  • The packaged manifest lists both usage pages with the correct titles and locale (Git Panel / Git 面板), and no longer contains the placeholder runtime component.
  • New tests/test_translation_contracts.py parses the panel with ast, collects every t() key it requests, and asserts each one is declared in both locales — including the panel title key. The missing-title-key bug above cannot merge again.

Notes for reviewers

  • The panel still shells out to git synchronously during rendering, throttled to once per second. Moving that off the render thread is on the roadmap, and it is what makes the remaining per-file features cheap to add.
  • The samples/ placeholders and plugin_pages/media/package_layout.svg are still template placeholders and are not part of this change.
  • After this merges, main is the release branch: tag the merge commit as v0.1.4 and push the tag. The release job then publishes wokrlie.git_integration.inxpkg and infernux-plugin-release.json. The tag must match the manifest version exactly, and published releases are immutable — see RELEASING.md.

The panel called _render_no_repo_ui() without defining it, so opening a project that was not a Git repository raised AttributeError instead of showing the documented Create Git Repository view. init_git_repo() was never reachable from the UI either.

repo_path now resolves the project root the Editor has open through project_context.get_project_root(), instead of falling back to the Editor process working directory.

Also fixes: the panel title resolved an undeclared translation key and rendered the raw key; the manual refresh button used a different clock than the automatic refresh; the collapsing headers lost their open state when the file counts changed.

The plugin is editor-only, so runtime/ no longer ships the placeholder Null component. The panel UI is now localized in English and Simplified Chinese, and tests/test_translation_contracts.py keeps the catalog and the panel in sync.
README.md and README.zh-CN.md gained a feature list, an engine and Git requirement table, installation steps for both the release archive and a local build, a troubleshooting section, and the local development commands.

The in-editor usage pages now match the panel: the correct menu path (Extensions/Git Integration), the real button labels, a restored heading structure, the one-second refresh throttle, and a troubleshooting section.

Added ROADMAP.md, CONTRIBUTING.md and RELEASING.md. The Planned section moved out of the changelog into the roadmap, and the 0.1.2 entry no longer disagrees between the two languages.
The manifest version moves to 0.1.4, so the release tag must be v0.1.4.

The package summary now describes the feature set instead of calling the plugin 'a simple git integration', and a localized Chinese variant is declared in intros. The Editor resolves it with localized_intro(), which normalizes both zh and zh-CN to the same locale.

The changelog gains a 0.1.4 section for the work since 0.1.3, and the 0.1.3 section now notes that the Create Git Repository view it announced was only wired up in 0.1.4. RELEASING.md examples follow the new version.
@Wokrlie
Wokrlie merged commit 9667a29 into main Oct 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant