Skip to content

fix: allow disabling operations in UI#40

Merged
thephez merged 2 commits intomasterfrom
feat/disable-api
Feb 5, 2026
Merged

fix: allow disabling operations in UI#40
thephez merged 2 commits intomasterfrom
feat/disable-api

Conversation

@thephez
Copy link
Collaborator

@thephez thephez commented Feb 5, 2026

Summary

Adds support for disabling operations in the UI without removing them from the codebase. Operations with a disabled property in api-definitions.json are shown with a "(Disabled)" suffix in the dropdown and display a warning message explaining why. Users can still view operation details, but the execute button is disabled.

Changes

  • Add disabled property support to operation definitions in api-definitions.json
  • Operations marked as disabled show "(Disabled)" suffix in dropdown
  • Selecting a disabled operation shows a red warning banner with the disable reason
  • Execute button is disabled for disabled operations
  • Users can still click disabled operations to view their inputs and description
  • Test utilities strip "(Disabled)" suffix so tests remain agnostic to disabled state

Disabled Operations

  • getIdentitiesContractKeys - Requires fix for upstream issue #3028
  • All platform address operations (queries and transitions) - Not fully implemented in SDK

Usage

To disable an operation, add a disabled property to its definition:

{
  "operationName": {
    "label": "Operation Label",
    "description": "...",
    "disabled": "Reason for disabling",
    "inputs": [...]
  }
}

Example:

image

Summary by CodeRabbit

  • New Features

    • Nine API endpoints now display a disabled status with descriptive messages, preventing execution.
    • Disabled operations are marked in the interface dropdown and the execute button is disabled when unavailable.
  • Style

    • Added visual styling for disabled warning states and disabled select options.

thephez and others added 2 commits February 5, 2026 11:13
Operations can now be disabled by adding a "disabled" property to their
definition in api-definitions.json. Disabled operations appear grayed
out in the dropdown with "(Disabled)" suffix, show a red warning with
the disable reason, and have the execute button disabled.

Disables platform address operations (not yet available on testnet) and
getIdentitiesContractKeys (upstream issue #3028).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Users can now select disabled operations to see their inputs and
description. The execute button remains disabled. Updated disabled
reason message for platform address operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

The changes introduce a disabled state mechanism for API endpoints. A "disabled" field is added to nine endpoints in the API definitions, with corresponding UI updates to display disabled status, prevent execution of disabled operations, and apply visual styling for the disabled state.

Changes

Cohort / File(s) Summary
API Definitions Update
public/api-definitions.json
Added a disabled field to 9 endpoints spanning identity and address categories: getIdentitiesContractKeys, getPlatformAddress, getPlatformAddresses, addressTransfer, addressTopUpIdentity, addressWithdraw, addressTransferFromIdentity, addressFundFromAssetLock, and addressCreateIdentity.
UI Implementation
public/app.js, public/index.css
Updated populateOperations to append " (Disabled)" to disabled operation text; modified onOperationChange to display disabled reason in query description with warning styling and disable the execute button when operations are disabled. Added CSS classes for disabled warning appearance and disabled select options.
Test Utilities
tests/e2e/utils/sdk-page.js
Updated getAvailableQueryTypes to strip the trailing " (Disabled)" suffix from operation options after filtering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: allow disabling operations in UI' accurately summarizes the main change: adding support for disabling operations in the UI while keeping them visible.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/disable-api

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.

Copy link
Contributor

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
public/app.js (1)

686-693: ⚠️ Potential issue | 🟡 Minor

Disabled options won’t appear greyed out.

You removed option.disabled to allow selection, but the CSS rule targets option:disabled, so the “disabled” styling won’t apply. Consider adding a data attribute/class to options and styling that instead.

🛠️ Proposed fix (keep selectable + add styling hook)
-    if (def?.disabled) {
-      // option.disabled = true; // Allow clicking to see operation details
-      option.textContent += ' (Disabled)';
-    }
+    if (def?.disabled) {
+      // option.disabled = true; // Allow clicking to see operation details
+      option.textContent += ' (Disabled)';
+      option.dataset.disabled = 'true';
+      option.setAttribute('aria-disabled', 'true');
+    }
- select option:disabled {
+ select option[data-disabled="true"] {
   color: `#999`;
 }

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK

@thephez thephez changed the title fix: allow clicking disabled operations to view their details fix: allow disabling operations in UI Feb 5, 2026
@thephez thephez merged commit fa446a0 into master Feb 5, 2026
2 checks passed
@thephez thephez deleted the feat/disable-api branch February 5, 2026 20:21
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.

2 participants