rename .model-id-cell to .id-cell, add copy failure state, unify copy handling #500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors and improves the logic and UI for copying provider and model IDs in the web interface. The changes consolidate duplicate code, introduce a reusable component for ID table cells, and enhance the user experience with better feedback and more robust event handling.
Refactoring and code consolidation:
renderIdCellfunction inrender.tsxto render both provider and model ID table cells, replacing duplicated markup and logic for copy buttons. [1] [2]renderIdCellfunction for both provider and model IDs, simplifying the JSX and reducing repetition.Copy button behavior and user feedback:
copyModelIdfunction with a genericcopyTexthelper inindex.ts, and switched to event delegation for handling all copy button clicks, making the code more robust and maintainable. [1] [2].failedvisual state to the.copy-buttoninindex.cssto indicate when copying fails, improving user feedback.Styling and class name consistency:
.model-id-cellto.id-cellthroughoutindex.cssfor consistency with the new component. [1] [2]