Skip to content

Conversation

@dgiannico19
Copy link
Contributor

@dgiannico19 dgiannico19 commented Dec 9, 2025

Link al ticket

  • No hay, refiere a un pedido en el canal

Descripción del requerimiento

  • Se necesita permitir el uso del componente copyToclipboardButton en los edit y browse

Descripción de la solución

  • Se agrego el componente en ambas pages y deje ejemplos de schemas

Cómo se puede probar?

  • Ingresando en la rama y corriendo npm run test
    Resultado esperado
    Todos los test corren perfectamente

Changelog

### Added
- CopyToClipboardButton at Browse and edit pages

Note

Adds CopyToClipboardButton to browse and edit schemas and updates tests to cover it.

  • Schemas:
    • Browse:
      • Register CopyToClipboardButton in lib/schemas/browse/modules/componentNames.js and include in components/index.js.
      • New component schema components/copyToClipboardButton.js.
    • Edit:
      • Register CopyToClipboardButton in lib/schemas/edit-new/modules/componentNames.js and include in components/index.js.
      • New component schema components/copyToClipboardButton.js.
    • Common Actions:
      • Remove redundant CopyToClipboardButton entry from lib/schemas/common/actions/field.js; rely on shared browse component names.
  • Tests:
    • Update tests/mocks/schemas/browse.json and edit.yml to use CopyToClipboardButton.
    • Update expected outputs in tests/mocks/schemas/expected/browse.json and expected/edit.json.

Written by Cursor Bugbot for commit fe86a27. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • New Features

    • Copy to Clipboard button added and available in browse and edit views.
  • Tests

    • Test schemas and expected outputs updated to include the new button fields.
  • Bug Fixes

    • Restored the Location property in the browse schema.
  • Refactor

    • Harmonized component naming and export surface for the new button across schemas.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds a new CopyToClipboardButton component to browse and edit-new schemas (componentNames, component modules, and component indexes), updates test fixtures/expected outputs, and removes a previously added CopyToClipboardButton alias and component creation from common actions/field.js.

Changes

Cohort / File(s) Change Summary
Component Name Registration
lib/schemas/browse/modules/componentNames.js, lib/schemas/edit-new/modules/componentNames.js
Added CopyToClipboardButton: 'CopyToClipboardButton' to exported componentNames mappings; browse file adjusted location: 'Location', to include trailing comma.
Component Implementation
lib/schemas/browse/modules/components/copyToClipboardButton.js, lib/schemas/edit-new/modules/components/copyToClipboardButton.js
New component modules created that import makeComponent and the CopyToClipboardButton name, and export makeComponent({ name: CopyToClipboardButton, properties: {} }).
Component Exports
lib/schemas/browse/modules/components/index.js, lib/schemas/edit-new/modules/components/index.js
Added require('./copyToClipboardButton') and included the imported copyToClipboardButton in the module.exports arrays.
Common Actions Update
lib/schemas/common/actions/field.js
Removed previously-added copyToClipBoardButton: 'CopyToClipboardButton' alias and removed adding makeComponent({ name: 'CopyToClipboardButton', properties: {} }) from the components array; retains ...browseComponentNames spread.
Test Mock Schemas
tests/mocks/schemas/browse.json, tests/mocks/schemas/edit.yml, tests/mocks/schemas/expected/browse.json, tests/mocks/schemas/expected/edit.json
Inserted new field entries using CopyToClipboardButton into browse and edit test fixtures and expected outputs (specific insert positions noted in diffs).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check consistent naming: CopyToClipboardButton vs any camelCase or misspelled variants (e.g., copyToClipBoardButton).
  • Verify component index export ordering and that new modules are required correctly.
  • Validate test fixture insertions and expected JSON/YAML ordering.

Possibly related PRs

Poem

🐇 I hop and copy, whiskers twitch,

A tiny button, quick as a switch,
From browse to edit, now set to share,
I tuck the bits with tender care,
Hooray — clipboard delights everywhere!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main objective of the PR: adding the CopyToClipboardButton component to browse and edit schemas.
Description check ✅ Passed The PR description covers all main template sections and provides clear context about the requirement, solution, testing approach, and changelog.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add-copyToClipboard-at-pages

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0ad01d and fe86a27.

📒 Files selected for processing (1)
  • lib/schemas/common/actions/field.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/schemas/common/actions/field.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Dec 9, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05c3d20 and 29bafa8.

📒 Files selected for processing (10)
  • lib/schemas/browse/modules/componentNames.js (1 hunks)
  • lib/schemas/browse/modules/components/copyToClipboardButton.js (1 hunks)
  • lib/schemas/browse/modules/components/index.js (2 hunks)
  • lib/schemas/edit-new/modules/componentNames.js (1 hunks)
  • lib/schemas/edit-new/modules/components/copyToClipboardButton.js (1 hunks)
  • lib/schemas/edit-new/modules/components/index.js (2 hunks)
  • tests/mocks/schemas/browse.json (1 hunks)
  • tests/mocks/schemas/edit.yml (1 hunks)
  • tests/mocks/schemas/expected/browse.json (1 hunks)
  • tests/mocks/schemas/expected/edit.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

Never report errors of the following categories lint/suspicious/noRedundantUseStrict, lint/complexity/noThisInStatic, lint/complexity/noStaticOnlyClass, reported by Biome.

Files:

  • lib/schemas/browse/modules/components/index.js
  • lib/schemas/edit-new/modules/components/copyToClipboardButton.js
  • lib/schemas/edit-new/modules/components/index.js
  • lib/schemas/edit-new/modules/componentNames.js
  • lib/schemas/browse/modules/componentNames.js
  • lib/schemas/browse/modules/components/copyToClipboardButton.js
🧬 Code graph analysis (2)
lib/schemas/browse/modules/components/index.js (2)
lib/schemas/edit-new/modules/components/index.js (2)
  • copyToClipboardButton (28-28)
  • require (3-3)
lib/schemas/common-components/index.js (1)
  • location (4-4)
lib/schemas/edit-new/modules/components/index.js (1)
lib/schemas/browse/modules/components/index.js (2)
  • copyToClipboardButton (18-18)
  • require (3-3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (8)
lib/schemas/browse/modules/components/copyToClipboardButton.js (1)

1-9: LGTM! Clean component module structure.

The implementation follows the established pattern for component modules in this codebase.

lib/schemas/browse/modules/components/index.js (2)

18-18: LGTM! Component import added correctly.

The new copyToClipboardButton module is properly imported.


36-37: LGTM! Component export added correctly.

The copyToClipboardButton is properly included in the exported components array.

tests/mocks/schemas/expected/edit.json (1)

606-610: Verify duplicate field name "name".

This fieldsGroup now contains two fields both named "name" (one Select component at line 533 and this CopyToClipboardButton). Duplicate field names within the same fieldsGroup could cause data binding or validation issues.

Is this intentional for testing purposes, or should the CopyToClipboardButton use a different field name (e.g., "copyableName")?

tests/mocks/schemas/edit.yml (1)

372-374: Verify duplicate field name "name".

Same concern as in the expected output: this creates a second field named "name" in the same fieldsGroup (the first is the Select at line 330). Consider using a unique field name if duplicate names could cause issues.

lib/schemas/edit-new/modules/components/index.js (2)

28-28: LGTM! Component import added correctly.

The copyToClipboardButton module is properly imported.


54-54: LGTM! Component export added correctly.

The copyToClipboardButton is properly included in the exported components array.

lib/schemas/edit-new/modules/components/copyToClipboardButton.js (1)

1-9: LGTM! Clean component module structure.

The implementation correctly follows the established pattern. Note that line 4 will need to be updated when the naming inconsistency in componentNames.js is fixed (changing copyToClipBoardButton to copyToClipboardButton).

countDown: 'CountDown',
location: 'Location'
location: 'Location',
copyToClipBoardButton: 'CopyToClipboardButton'

This comment was marked as resolved.

fieldList: 'FieldList',
steps: 'Steps'
steps: 'Steps',
copyToClipBoardButton: 'CopyToClipboardButton'

This comment was marked as resolved.

const componentNames = {
...browseComponentNames,
copyToClipBoardButton: 'CopyToClipboardButton'
CopyToClipboardButton: 'CopyToClipboardButton'

This comment was marked as resolved.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
lib/schemas/common/actions/field.js (1)

19-45: Avoid redundant CopyToClipboardButton definitions in actions schema

browseComponents already exports a CopyToClipboardButton component built with makeComponent, and browseComponentNames already exposes 'CopyToClipboardButton' in its values. The extra makeComponent({ name: 'CopyToClipboardButton', properties: {} }) in components and the explicit CopyToClipboardButton entry in componentNames are therefore redundant and could drift from the base definition in future.

You can simplify and keep a single source of truth like this:

 const components = [
   ...filteredBrowseComponents,
   makeComponent({
     name: 'FieldList',
@@
-		requiredProperties: ['direction', 'fields']
-	}),
-	makeComponent({ name: 'CopyToClipboardButton', properties: {} })
+		requiredProperties: ['direction', 'fields']
+	})
 ];
 
-const componentNames = {
-	...browseComponentNames,
-	CopyToClipboardButton: 'CopyToClipboardButton'
-};
+const componentNames = browseComponentNames;

This keeps the behavior the same today while reducing duplication and future maintenance risk.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29bafa8 and e0ad01d.

📒 Files selected for processing (5)
  • lib/schemas/browse/modules/componentNames.js (1 hunks)
  • lib/schemas/browse/modules/components/copyToClipboardButton.js (1 hunks)
  • lib/schemas/common/actions/field.js (1 hunks)
  • lib/schemas/edit-new/modules/componentNames.js (1 hunks)
  • lib/schemas/edit-new/modules/components/copyToClipboardButton.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/schemas/browse/modules/components/copyToClipboardButton.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

Never report errors of the following categories lint/suspicious/noRedundantUseStrict, lint/complexity/noThisInStatic, lint/complexity/noStaticOnlyClass, reported by Biome.

Files:

  • lib/schemas/edit-new/modules/components/copyToClipboardButton.js
  • lib/schemas/common/actions/field.js
  • lib/schemas/edit-new/modules/componentNames.js
  • lib/schemas/browse/modules/componentNames.js
🧬 Code graph analysis (1)
lib/schemas/edit-new/modules/components/copyToClipboardButton.js (2)
lib/schemas/browse/modules/components/copyToClipboardButton.js (2)
  • require (3-3)
  • require (4-4)
lib/schemas/utils.js (1)
  • makeComponent (13-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (3)
lib/schemas/browse/modules/componentNames.js (1)

29-30: Browse component name wiring for CopyToClipboardButton looks good

The new CopyToClipboardButton: 'CopyToClipboardButton' entry aligns with how the browse component module destructures this constant and ensures the value is available in browse schemas. No issues here.

lib/schemas/edit-new/modules/componentNames.js (1)

38-39: Edit-new component name mapping for CopyToClipboardButton is consistent

The CopyToClipboardButton: 'CopyToClipboardButton' entry matches how components/copyToClipboardButton.js imports this constant and ensures the value is part of the edit-new component enum. Looks correct.

lib/schemas/edit-new/modules/components/copyToClipboardButton.js (1)

1-9: CopyToClipboardButton component wiring for edit-new is correct

This module cleanly reuses makeComponent with the CopyToClipboardButton name from componentNames, giving edit-new schemas a valid componentAttributes contract (empty, with no extra props). No problems spotted.

@dgiannico19 dgiannico19 changed the title add validations and components Add CopyToClipboardButton component to browse and edit schemas Dec 9, 2025
@colomfernando colomfernando merged commit fe86a27 into master Dec 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants