Convert Renamer to React#357
Conversation
5962354 to
2c19d5b
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR converts the Renamer plugin from Svelte to React to improve maintainability and remove Svelte as a dependency. The conversion includes several functional improvements such as text node support, component layer renaming, and better replica filtering.
Key changes:
- Complete framework migration from Svelte to React
- Added text node support and component layer renaming capabilities
- Enhanced replica filtering and UI improvements with success/error notifications
Reviewed Changes
Copilot reviewed 35 out of 56 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Removed Svelte configuration |
| svelte.config.js | Removed Svelte configuration file |
| src/search/indexer.ts | Added text node support and component indexing |
| src/search/batch_process_results.ts | Added notification support and improved tracking |
| src/main.tsx | New React entry point |
| src/main.ts | Removed Svelte entry point |
| src/components/*.svelte | Removed all Svelte components |
| src/components/*.tsx | Added React component implementations |
| src/App.tsx | Main React application component |
| src/App.css | Consolidated styles for React components |
| package.json | Updated dependencies for React migration |
| index.html | Updated entry point and root element |
Comments suppressed due to low confidence (3)
plugins/renamer/src/search/indexer.ts:62
- The parameter name 'pages' is misleading since it now includes both WebPageNode and ComponentNode types. Consider renaming to 'canvasRoots' or 'rootNodes' to better reflect the actual content.
private async *crawl(pages: CanvasRootNode[]): AsyncGenerator<IndexEntry[]> {
plugins/renamer/src/search/indexer.ts:105
- The method name 'getPages' is misleading since it now returns both pages and components. Consider renaming to 'getCanvasRoots' or 'getRootNodes' to accurately describe what it returns.
private async getPages(): Promise<CanvasRootNode[]> {
plugins/renamer/src/components/Results.tsx:56
- [nitpick] The outer div has className 'results' but the component is also named 'Results'. This creates confusion between the component and the CSS class. Consider renaming the CSS class to 'results-container' or similar.
<div className="results">
| @@ -0,0 +1,10 @@ | |||
| export default function SearchIcon() { | |||
| return ( | |||
| <svg xmlns="http://www.w3.org/2000/svg" width="11.384" height="11.134"> | |||
elmarburke
left a comment
There was a problem hiding this comment.
Great work on this migration, looks like moving from Svelte to React went pretty smoothly!
I focused my review mostly on the new and changed code, rather than the existing implementation, and left some comments around patterns, naming, and separation of concerns that might help with future maintainability.
Overall, nice job 🚀
There was a problem hiding this comment.
I didn't saw a virtual list anywhere anymore. Do large sets of results not cause issues now?
There was a problem hiding this comment.
Good catch, I missed that part.
In most cases it will show a lot less results because replica layers are filtered out now. For example on a page with 3 breakpoints, it will show about 1/3 as many results as before.
Yesterday I tried converting the virtual list to React with Cursor. It failed spectacularly (so many bugs), so I'm going to try again later without AI.
There was a problem hiding this comment.
@elmarburke I added a virtual list. It's in Results.tsx now instead of a separate component.
I'm undecided. But, from a user flow perspective, why would you open the Renamer plugin when you're not allowed to edit (and know that through banners). On a second thought, this is fine 👍 |
elmarburke
left a comment
There was a problem hiding this comment.
Looks good to me, great work 👍
QA passed ✅
|
Changes since approval:
|
708facd to
afed450
Compare



Description
This pull request converts the Renamer plugin from Svelte to React.
It's the only plugin made with Svelte, and no one on the plugins team knows Svelte, so this helps make it easier to maintain and removes Svelte as a dependency.
Closes #303
Updates
Before & after for a component with 3 variants:
UI changes
Testing
None yet
Testing