generated from JetBrains/intellij-platform-plugin-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(harmonyos): update AutoArkUiFlow and related classes
- Updated `AutoArkUiFlow` class to use `AutoArkUiContext` instead of `ArkUiContext` for better type safety. - Renamed `ArkUiContext` to `AutoArkUiContext` for consistency and clarity. - Updated references to `LayoutType` and `ComponentType` to `ArkUiComponentType`. - Renamed `AutoPageTask` class to `AutoArkUiTask` for consistency. - Added new template file `arkui-clarify.vm` for displaying user code/requirements. - Updated `AutoArkUiAction` to use `AutoArkUiContext` and `AutoArkUiTask`. - Renamed `ComponentType` enum to `ArkUiComponentType` for clarity. This commit improves the AutoArkUiFlow functionality by making use of the newly introduced `AutoArkUiContext` class. The class now accepts an instance of this context instead of `ArkUiContext`, providing better type safety and clarity. Additionally, the `generateStepOnePrompt` and `generateStepTwoPrompt` functions have been updated to use `AutoArkUiContext` and `ArkUiComponentType` as well. To accompany these changes, the `ArkUiContext` class has been renamed to `AutoArkUiContext` for consistency and clarity. The class now includes additional properties (`requirement`, `layoutOverride`, `componentOverride`, `layouts`, and `components`) for better handling of user requirements and layout/component overrides. Furthermore, the `LayoutType` enum has been renamed to `FlexLayout` to align with the conventions of the ArkUi framework. Similarly, the `ComponentType` enum has been renamed to `ArkUiComponentType` to clarify its purpose and relationship to ArkUi. To enhance the user experience, a new template file `arkui-clarify.vm` has been added. This file provides a formatted display of the user's code and requirements, prompting the user to choose the best layout and components based on given information. The `AutoArkUiTask` class (previously `AutoPageTask`) has been renamed to maintain consistency throughout the codebase. Finally, the `AutoArkUiAction` class has been updated to use `AutoArkUiContext` and `AutoArkUiTask` instead of the previous classes, ensuring compatibility with the latest changes. These updates result in a more robust and user-friendly AutoArkUiFlow functionality, making it easier for users to select the appropriate layouts and components for their needs in the HarmonyOS project.
- Loading branch information
Showing
9 changed files
with
41 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...h/harmonyos/actions/auto/ComponentType.kt → ...monyos/actions/auto/ArkUiComponentType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
exts/ext-harmonyos/src/main/kotlin/cc/unitmesh/harmonyos/actions/auto/ArkUiContext.kt
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
exts/ext-harmonyos/src/main/kotlin/cc/unitmesh/harmonyos/actions/auto/AutoArkUiContext.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package cc.unitmesh.harmonyos.actions.auto | ||
|
||
data class AutoArkUiContext( | ||
val requirement: String, | ||
val layoutOverride: String, | ||
val componentOverride: String, | ||
val layouts: List<String> = emptyList(), | ||
val components: List<String> = emptyList(), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
exts/ext-harmonyos/src/main/kotlin/cc/unitmesh/harmonyos/actions/auto/LayoutType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
exts/ext-harmonyos/src/main/resources/genius/harmonyos/arkui-clarify.vm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
You are a professional Legacy System migration expert, specif in frontend. | ||
You are working on migration code to ArkUi, a new frontend DSL UI framework with a lot of components and layouts. | ||
According to the user's code/requirements, you should choose the best Layout and components for the user. | ||
|
||
— ArkUi layout: ${context.layoutOverride} | ||
- ArkUi component: ${context.componentOverride} | ||
|
||
For example: | ||
|
||
User: // maybe send Android Layout code, maybe some requirements | ||
Your Answer: [FlexLayout, Button, CheckBox, Checkbox, Button] | ||
|
||
---- | ||
|
||
Here are the User code/requirements: | ||
|
||
```markdown | ||
${context.requirement} | ||
``` | ||
|
||
Please choose the best Layout and components for the user, just return the components and layouts names in a list, no explaining. |
Empty file.