Skip to content

Conversation

@InduwaraSMPN
Copy link
Contributor

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:

  • Introduced a reusable renderIdCell function in render.tsx to render both provider and model ID table cells, replacing duplicated markup and logic for copy buttons. [1] [2]
  • Updated the table rendering to use the new renderIdCell function for both provider and model IDs, simplifying the JSX and reducing repetition.

Copy button behavior and user feedback:

  • Replaced the old copyModelId function with a generic copyText helper in index.ts, and switched to event delegation for handling all copy button clicks, making the code more robust and maintainable. [1] [2]
  • Added a .failed visual state to the .copy-button in index.css to indicate when copying fails, improving user feedback.

Styling and class name consistency:

  • Renamed CSS classes from .model-id-cell to .id-cell throughout index.css for consistency with the new component. [1] [2]

@InduwaraSMPN InduwaraSMPN changed the title ate, unify copy handling rename .model-id-cell to .id-cell, add copy failure state, unify copy handling Dec 11, 2025
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.

1 participant