Refactor InputSystem#3173
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 211c215351
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
/clang-format |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2aff1905b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
/clang-format |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa51937953
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
/clang-format |
|
@codex review |
|
/clang-format |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca81b1bcfa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f219568f06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
@codex About this PR, do you have any suggestion to improve ui::InputField implementation? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00d565bf4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
/clang-format |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac07dc212c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
/clang-format |
|
@codex review |
|
@codex provide merge title and change detail list about this PR via https://patch-diff.githubusercontent.com/raw/axmolengine/axmol/pull/3173.diff |
|
/clang-format |
|
Proposed merge metadata based on the PR diff and review context: Merge titleRefactor legacy text input stack to Change detail list (for squash/merge message)
If you want, I can also draft a “merge title + detailed changelog” in Conventional Commits style (e.g., Source used: |
There was a problem hiding this comment.
Code Review
This pull request refactors the UI and text input systems, replacing legacy TextField components with a new InputField widget and introducing a cross-platform clipboard API. It also updates the layout system by replacing ignoreContentAdaptWithSize with setAutoSize and renames various UI headers for consistency. Feedback highlights critical logic inversions in the setAutoSize implementation for several widgets (Button, ImageView, Slider, and LoadingBar) when Scale9 is enabled, which hinders manual sizing. Further improvements are suggested for Android clipboard robustness, touch position tracking in InputField, and optimizing the O(N^2) performance of the text layout measurement logic.
|
Hello halx99, thank you for reaching out. Regarding your question about the Key improvements include:
If you are looking to migrate from |
|
@gemini review |
There was a problem hiding this comment.
Code Review
This pull request performs a major refactoring of the UI and input systems, replacing the deprecated TextFieldTTF and TextFieldEx widgets with a new InputField component that supports multiline text, cursors, and selections. The refactor includes a widespread renaming of UI classes and core methods (e.g., setAutoSize, getRenderNode) to improve API consistency, renames the IME system to a more general Input system, and introduces a cross-platform clipboard API. Review feedback identifies a high-severity risk of null pointer exceptions in the Android clipboard implementation and suggests adopting safer string access patterns in the InputField logic.
|
/clang-format |
1 similar comment
|
/clang-format |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request overhauls the text input and UI widget systems by introducing a modern InputField component to replace the deprecated TextFieldTTF and TextFieldEx. The new InputField supports multiline text, cursor control, selection, and native clipboard integration. Additionally, the Widget base class and its derivatives have been refactored to use a standardized setAutoSize and initRenderNode API, and the IME system has been renamed to InputDelegate. Reviewer feedback highlights significant efficiency and correctness concerns regarding character-by-character text measurement and the lack of word-level wrapping in multiline mode. Other actionable suggestions include syncing measurement labels with rendering effects, adjusting long-press trigger timing on mobile platforms, and correcting a typo in Label.cpp.
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| ErrorProne | 1 high |
🟢 Metrics 4329 complexity · 98 duplication
Metric Results Complexity 4329 Duplication 98
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
d163ad8 to
4e27179
Compare
|
/clang-format |
Describe your changes
TextFieldTTFusage/removal and shift text input flows towardui::InputField/IME-based behavior.Label::create(text, fontName, fontSize)API with automatic font-type detection (BMFont/TTF/system font).Label::setFontInfo(fontName, fontSize)to centralize runtime font switching.Labelinternals by removing cached_lengthOfStringstate and deriving count from UTF-32 text (getCharCount()), reducing stale-length risks.getLineCount(),getCharCount()) while keeping backward-compatible deprecated wrappers.#pragma once, include path corrections, minor code hygiene).Issue ticket number and link
Checklist before requesting a review
For each PR
Add Copyright if it missed:
-
"Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."I have performed a self-review of my code.
Optional:
For core/new feature PR
Axmol 3.x ------------------------------------------------------------
For each 3.x PR