-
Notifications
You must be signed in to change notification settings - Fork 2
[1104] Add Link widget and corresponding tests #1105
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
Conversation
🦋 Changeset detectedLatest commit: d5c6443 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Pull Request Overview
This PR adds a new Link widget component to the runtime package along with comprehensive tests and example usage. It also includes type improvements by making various properties use the Expression type for better binding support.
- Implements a new Link widget component for navigation with internal/external URL support
- Adds comprehensive test coverage for the Link widget functionality
- Updates several widget type definitions to properly use Expression types
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime/src/widgets/index.ts | Exports the new Link widget |
| packages/runtime/src/widgets/Link.tsx | Main Link widget implementation with internal/external navigation |
| packages/runtime/src/widgets/tests/Link.test.tsx | Comprehensive test suite for Link widget |
| packages/runtime/src/widgets/Form/TextInput.tsx | Makes onKeyDown optional |
| packages/runtime/src/widgets/Form/Form.tsx | Makes label style properties optional |
| packages/runtime/src/widgets/DataGrid/DataGrid.tsx | Makes column type and header style properties optional |
| packages/runtime/src/widgets/Button.tsx | Updates loading prop to use Expression type |
| packages/runtime/src/shared/types.ts | Updates visible and flexbox properties to use Expression types |
| packages/runtime/src/shared/coreSchema.ts | Adds Link widget to schema |
| apps/kitchen-sink/src/ensemble/screens/widgets.yaml | Adds Link widget examples |
| .changeset/old-boxes-drive.md | Documents the changes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (!values?.url) { | ||
| return ( | ||
| <span ref={rootRef} style={linkStyles}> | ||
| {EnsembleRuntime.render([unwrappedWidget])} | ||
| </span> | ||
| ); | ||
| } |
Copilot
AI
Sep 11, 2025
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.
This check should also handle empty strings as falsy values. Consider using if (!values?.url || values.url.trim() === '') to properly handle whitespace-only URLs.
| e.currentTarget.style.color = values.styles.color; | ||
| if (values?.styles?.textDecoration) | ||
| e.currentTarget.style.textDecoration = values.styles.textDecoration; |
Copilot
AI
Sep 11, 2025
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.
The mouse event handlers for hover effects are duplicated across external and internal link sections. Consider extracting these into reusable helper functions to reduce code duplication.
|
Visit the preview URL for this PR (updated for commit d5c6443): https://react-kitchen-sink-dev--pr1105-1104-4w5d4i9d.web.app (expires Thu, 18 Sep 2025 14:47:10 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 6267897ade2ba783b6db70a53a60fc3946d625e9 |
Describe your changes
Screenshots [Optional]
Issue ticket number and link
Closes #1104
Checklist before requesting a review
pnpm changeset add