Skip to content

Update: Components and pages#2929

Open
yueman920 wants to merge 5 commits intogoplus:uifrom
yueman920:update-document
Open

Update: Components and pages#2929
yueman920 wants to merge 5 commits intogoplus:uifrom
yueman920:update-document

Conversation

@yueman920
Copy link

-Delete the "system" folder and rename it to "component" folder.
-Add editor-related components.
-Update some editor pages by referencing these components.

{
"type": "frame",
"id": "XkWUp",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in variant name: Secondat should be Secondary

"Button/Medium/Secondat/Flat/Square/Loading" — the color segment is misspelled. This will break any tooling or references that look up this variant by name.

Suggested change
"name": "Button/Medium/Secondary/Flat/Square/Loading",

{
"type": "frame",
"id": "XkWUp",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent capitalisation in variant name: FLat should be Flat

"Button/Large/Secondary/FLat/Square/Click" — capital L in FLat is inconsistent with every other variant in this file, effectively creating a separate style token.

Suggested change
"name": "Button/Large/Secondary/Flat/Square/Click",

{
"type": "frame",
"id": "XkWUp",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray space in icon name: icon/stop- filled should be icon/stop-filled

The space before filled appears in 12 button variants. This will cause lookup failures or mismatches in any tooling that resolves icons by name.

Suggested change
"name": "icon/stop-filled",

"id": "o3zCS",
"x": 2.1828083992004395,
"y": 5.349999904632568,
"geometry": "M94.05119 8.558l0 9.492c0 0.55228-0.44772 1-1 1l-1.572 0c-0.55228 0-1-0.44772-1-1l0-11.42c0-0.55228 0.44772-1 1-1l1.43 0c0.52493-0.00027 0.96072 0.40539 0.998 0.929l0.144 1.999z m3.77101-3.089c0.166 0.033 0.27 0.188 0.26699 0.358l-0.04799 2.576c-0.00391 0.11569-0.05538 0.22463-0.14227 0.30111-0.08689 0.07648-0.20149 0.1137-0.31674 0.10289l-0.182-0.014c-0.21816-0.02434-0.43748-0.03669-0.657-0.037q-0.757 0-1.315 0.199-0.546 0.186-0.918 0.558-0.36 0.372-0.546 0.905c-0.12135 0.39402-0.18797 0.80284-0.198 1.215l-0.72-0.223q0-1.302 0.261-2.393 0.26-1.104 0.757-1.923 0.508-0.818 1.24-1.265 0.73199-0.447 1.674-0.446 0.298 0 0.60801 0.05 0.128 0.015 0.236 0.036m-14.37501 13.829q-1.563 0-2.803-0.496c-0.79188-0.31696-1.50985-0.7939-2.109-1.401-0.57166-0.59624-1.0184-1.3007-1.314-2.072-0.30825-0.80769-0.46421-1.6655-0.46-2.53l0-0.496q0-1.526 0.435-2.79c0.26846-0.80454 0.68947-1.54981 1.24-2.195 0.54507-0.61985 1.22381-1.10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icon asset committed as a top-level page frame

"settings-filled" follows the naming pattern of icon components (run-outlined, rerun-outlined) but is listed as the last top-level frame in editor.pen. It contains only a single unnamed path — this looks like an icon asset accidentally included as a page, or an unfinished stub. It should either be removed or moved to a proper icon library component.

"fill": {
"type": "image",
"enabled": true,
"url": "../images/navbar bg.png",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image filenames with spaces and non-ASCII characters

"navbar bg.png" (space) and "用户头像.png" (Chinese characters) appear as image references across multiple component files. These filenames:

  • Require URL-encoding (%20, percent-encoded UTF-8) in any web context
  • Are fragile in CI pipelines and filesystems with non-UTF-8 locales
  • Make the .pen JSON brittle — any rename requires coordinated edits across both the filesystem and every .pen file that references them

Consider renaming to ASCII kebab-case equivalents (e.g. navbar-bg.png, user-avatar.png).

@xgopilot
Copy link
Contributor

xgopilot bot commented Mar 10, 2026

Good structural cleanup moving from systems/ + templates/ to components/ + pages/. A few things worth addressing:

Naming issues in button.lib.pen — 47 duplicate variant names (e.g. Button/Medium/Boring/Shadow/Square/Default ×2), Flat-Stroke vs Flat-stroke casing inconsistency, and ~94 inner container frames named Frame 162689 instead of container. These will break name-based lookups.

Color token fragmentation — Three systems coexist across the new files: short-scale tokens ($turquoise500), CSS-custom-property style ($--ui-color-primary-main), and $W:-prefixed tokens, plus hardcoded hex values (e.g. #0bc0cf and #0BC0CF in the same codebase). A single source of truth is needed.

Duplicated binary assetsui/components/spx/images/ duplicates ~849 KB of images already present in ui/pages/spx/images/ (same filenames, same content). Consider a shared ui/images/ directory.

ui/README.md not updated — Still documents system/ and templates/ which no longer exist; components/ and pages/ are not listed. The PR description also omits the templates/pages/ rename. ui/docs/design-review-checklist.md line 10 still references the deleted system directory.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the editor's user interface by introducing a new, reusable navigation component and reorganizing the project's UI file structure. The changes aim to improve modularity and maintainability of the editor's components and pages, laying groundwork for future development and consistency.

Highlights

  • New Editor Component: Introduced a new editor navigation bar component (nav.lib.pen) to standardize the top navigation across editor pages.
  • UI Directory Refactoring: Refactored the project's UI directory structure by renaming the ui/templates folder to ui/pages.
  • Page Migration: Migrated several existing UI files, including ai canvas.pen, ai-structure.json, bg.svg, pencil design draft reproduction workflow.md, and shadcn.pen, to the newly established ui/pages directory.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • ui/components/spx/editor/nav.lib.pen
    • Added a new editor navigation bar component definition.
  • ui/pages/ai-canvas/ai canvas.pen
    • Renamed from ui/templates/ai-canvas/ai canvas.pen.
  • ui/pages/ai-canvas/ai-structure.json
    • Renamed from ui/templates/ai-canvas/ai-structure.json.
  • ui/pages/spx/images/bg.svg
    • Renamed from ui/templates/spx/images/bg.svg.
  • ui/pages/spx/pencil design draft reproduction workflow.md
    • Renamed from ui/templates/spx/pencil design draft reproduction workflow.md.
  • ui/pages/spx/shadcn.pen
    • Renamed from ui/templates/spx/shadcn.pen.
Activity
  • No specific pull request activity (comments, reviews, or progress updates) was provided in the context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the UI directory structure by renaming the 'system' folder to 'component' and moving pages. It also introduces a new navigation bar component for the editor. My review focuses on the new nav.lib.pen file. I've found several opportunities to improve the maintainability of this component definition by using design tokens (variables) consistently for colors and other values, and by ensuring consistent naming conventions. These changes will make the component easier to theme and update in the future.

Note: Security Review did not run due to the size of the PR.

"height": 50,
"stroke": {
"align": "inside",
"thickness": 0.1190476194024086

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The thickness value 0.1190476194024086 has excessive precision, which is likely an artifact from a design tool. For better readability and maintainability, it's best to round this to a more conventional value (e.g., 0.12) or define it as a variable if it's a standard stroke width in your design system.

                "thickness": 0.12

"x": 1.2997803688049316,
"y": 5.4393696784973145,
"geometry": "M5.08422 6.98763l11.322 11.341c0.3284 0.32976 0.77462 0.51513 1.24 0.51513 0.46539 0 0.91161-0.18537 1.24-0.51513 0.68398-0.68674 0.68398-1.79725 0-2.484l-11.32-11.34-2.482 2.483z m3.079-6.963c-0.87413 0.77448-2.09171 1.03099-3.204 0.675-0.03351-0.00939-0.06949-0.00067-0.095 0.023l-4.729 4.736c-0.18029 0.18072-0.18029 0.47328 0 0.654l2.09 2.092c0.18 0.18 0.472 0.18 0.652 0l4.193-4.197-0.001-0.002 2.27-2.275c0.18029-0.18072 0.18029-0.47328 0-0.654l-1.046-1.049c-0.03554-0.03565-0.09285-0.03697-0.13-0.003",
"fill": "#fff",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of a hardcoded color "#fff", it's better to use an existing design token like $grey100 or $--ui-color-grey-100. Using variables for colors improves maintainability and ensures consistency across the UI.

                      "fill": "$grey100",

"clip": true,
"width": 1,
"height": 24,
"fill": "#ffffff4d",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This hardcoded color with transparency ("#ffffff4d") should be defined as a variable in the variables section for better maintainability and reusability. For example, you could create a new variable like "--ui-color-white-a30" and reference it here.

"name": "text",
"fill": {
"type": "color",
"color": "#0aa5beff",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The hardcoded color "#0aa5beff" is equivalent to the existing $turquoise600 variable. Please use the variable to maintain consistency and make future theme changes easier.

                "color": "$turquoise600",

{
"type": "text",
"id": "9wufA",
"name": "输入文本",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The name property "输入文本" contains non-ASCII characters. It's a best practice to use English for identifiers in configuration and code files for better compatibility with tooling and easier collaboration with international developers. Consider changing this to an English equivalent like "input-text".

                  "name": "input-text",

Comment on lines +640 to +665
"variables": {
"grey100": {
"type": "color",
"value": "#ffffff"
},
"--ui-color-primary-main": {
"type": "color",
"value": "#0bc0cf"
},
"grey200": {
"type": "color",
"value": "#FBFCFD"
},
"turquoise600": {
"type": "color",
"value": "#0AA5BE"
},
"--ui-color-grey-100": {
"type": "color",
"value": "#ffffff"
},
"--ui-shadow-custom-2": {
"type": "color",
"value": "#00000000"
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The variables block has some inconsistencies that could be improved for better maintainability:

  1. Redundant variables: grey100 and --ui-color-grey-100 both define the color white (#ffffff). It's best to use only one to avoid confusion. I'd recommend removing grey100.
  2. Inconsistent naming: Variable names are inconsistent. Some are simple like grey200, while others are prefixed like --ui-color-primary-main. Adopting a consistent convention, such as the --ui-color-* pattern for all colors, would improve readability.

Consider refactoring this block to address these points. After refactoring, please ensure all references to the old variable names (e.g., $grey100, $grey200) are updated throughout the file.

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.

2 participants