-
Notifications
You must be signed in to change notification settings - Fork 0
♻️ Refactor | flatten brick props — data fields spread directly onto component #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| --- | ||
| description: Create a pull request to develop following the project PR template. Use when you want to open a PR for the current branch. | ||
| argument-hint: '[additional context or notes for the PR description]' | ||
| --- | ||
|
|
||
| Create a pull request from the current branch following the project template. | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Detect the parent branch by running: | ||
| `git log --oneline --decorate --all --simplify-by-decoration HEAD | grep -v "HEAD" | head -3` | ||
| Pick the closest ancestor branch from the output (e.g. `develop`, `main`, `release/x.y`). | ||
| 2. Run `git diff <base>...HEAD` and `git log <base>..HEAD --oneline` to understand all changes | ||
| 3. Read `.github/PULL_REQUEST_TEMPLATE.md` for the exact template structure | ||
| 4. Determine: | ||
| - PR title using the emoji/type mapping below | ||
| - Which **Type of Change** checkbox to tick (Bugfix / Improvement / New feature / Breaking change) | ||
| - What changed at the component/module level | ||
| 5. Run `gh pr create --base <base>` filling each section: | ||
| - **Why?** — the problem this solves | ||
| - **Type of Change** — tick the correct checkbox | ||
| - **What Changed?** — layers, classes, entities affected | ||
| - **Screenshots** — remove the table if there are no UI changes | ||
| - **Testing** — tick platforms and verification items based on the diff; describe test scenarios | ||
| - **Reference Links / Dependencies** — include `$ARGUMENTS` if provided; omit if empty | ||
| - **Checklist** — tick Self-review and Tests/Docs items based on the diff | ||
| - **Merge Rules** — keep the table exactly as-is, do not modify it | ||
| 6. Return the PR URL | ||
|
|
||
| ## PR title format | ||
|
|
||
| `<emoji> <Type> | <short description>` | ||
|
|
||
| | Emoji | Type | When to use | | ||
| |-------|----------|--------------------------------------------------| | ||
| | ✨ | Feat | New functionality (including analytics/tracking) | | ||
| | 🐛 | Fix | Bug fixes | | ||
| | ♻️ | Refactor | Restructuring without behavior change | | ||
| | 🚀 | Deploy | Merge to main (branch: `release/*`) | | ||
| | 🚑️ | Hotfix | Critical production fixes (branch: `hotfix/*`) | | ||
| | 🔒️ | Sec | Security fixes or improvements | | ||
| | 📝 | Docs | Documentation-only changes | | ||
| | ⬆️ | Deps | Dependency upgrades or additions | | ||
| | ✅ | Test | Adding/updating tests, no production code change | | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| ## Why? | ||
|
|
||
| > Describe the problem or motivation behind this change. | ||
|
|
||
| ## Type of change | ||
|
|
||
| - [ ] Bug fix (non-breaking) | ||
| - [ ] New feature (non-breaking) | ||
| - [ ] Breaking change (affects public API or wire format) | ||
| - [ ] Internal / refactor (no public API impact) | ||
|
|
||
| ## What changed? | ||
|
|
||
| > Summarize what was modified — types, components, renderer behavior, etc. | ||
| > For breaking changes, describe what consumers need to update. | ||
|
|
||
| ## Checklist | ||
|
|
||
| - [ ] `bun test` passes | ||
| - [ ] `bun run typecheck` passes | ||
| - [ ] Public API changes are reflected in the README | ||
| - [ ] Breaking changes are noted above |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,7 +31,8 @@ export const BrickNode = memo(function BrickNode({ brick }: { brick: Brick }) { | |||||||||
| </Fragment> | ||||||||||
| ) : undefined; | ||||||||||
|
|
||||||||||
| return <Component brick={brick}>{children}</Component>; | ||||||||||
| const props = { id: brick.id, ...(brick.data as object | undefined), children }; | ||||||||||
| return <Component {...(props as any)} />; | ||||||||||
|
Comment on lines
+34
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preserve canonical brick identity when flattening props. Line 34 currently lets 🔧 Proposed fix- const props = { id: brick.id, ...(brick.data as object | undefined), children };
+ const props = { ...(brick.data as object | undefined), id: brick.id, children };
return <Component {...(props as any)} />;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| }); | ||||||||||
|
|
||||||||||
| /** | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: squillteam/bricks-web-client
Length of output: 1855
🏁 Script executed:
# Then check the PR template file cat -n .github/PULL_REQUEST_TEMPLATE.mdRepository: squillteam/bricks-web-client
Length of output: 803
Mismatch between command instructions and actual PR template structure.
Step 5 instructs users to fill sections—Screenshots, Testing, Reference Links / Dependencies, and Merge Rules—that do not exist in
.github/PULL_REQUEST_TEMPLATE.md. The template contains only: Why?, Type of change, What changed?, and Checklist.Additionally, line 14 instructs users to read the template to understand its structure, but Step 5 then contradicts this by listing non-existent fields. This creates confusion when users follow the command and discover the template lacks these sections.
Either expand the template to include the missing sections or update Step 5 to match the actual template structure.
🤖 Prompt for AI Agents