Add forceEditable prop to TokenRow for Smart Settings - #395
Conversation
…consumption 18 tokens surfaced in Smart Settings panels (typography, spacing, borders, shadows, layout) carry role="consumption" in the API index because their CSS defaults reference other variables via var()/calc(). TokenRow was treating this as read-only, greying them out with a dashed box. Added a `forceEditable` prop to TokenRow that bypasses the consumption guard when a token is explicitly curated as a configurable entry point. SmartSettings now passes forceEditable to every TokenRow it renders so all controls — including Heading font, radius ramp, shadow ramp, gutter, touch-target, etc. — are fully editable with live preview and reset. The full All Tokens catalogue view is unchanged: consumption tokens remain read-only there to preserve the "edit the upstream configure token" guidance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrEDodTGN4MpmWJfP1p5Vb
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
More reviews will be available in 32 minutes and 6 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
PR Summary by QodoAllow Smart Settings to edit consumption-role tokens via TokenRow forceEditable Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
5 rules 1.
|
…ows; guard picker on parseability Fixes two bugs surfaced by code review: 1. The consume readonly branch in TokenRow was displaying token.value (framework default) even when an active override existed, making the override invisible and impossible to clear from the catalogue view. Now shows effectiveValue (override ?? default), surfaces a reset button when modified, and applies row--modified for all modified tokens regardless of consume status. 2. TokenEditor's color picker (OklchPicker) cannot parse derived expressions like oklch(from var(...)). Opened against such a value it would start from arbitrary defaults and overwrite the expression with an unrelated literal. Now gated behind isPickerParseable() — tokens with unparseable default values fall back to the text input only until the user types a literal color that the picker can handle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SrEDodTGN4MpmWJfP1p5Vb
Summary
Adds a new
forceEditableprop to theTokenRowcomponent to allow consumption-role tokens to be rendered as editable in Smart Settings panels, where they are explicitly surfaced as configurable entry points.Changes
TokenRow.svelte
forceEditableprop (default:false) to component signature with JSDoc documentationrow--modifiedclass now applies whenmodified && (!isConsume || forceEditable)row--consumeclass now applies whenisConsume && !forceEditableTokenEditornow displays when!isConsume || forceEditable(previously only!isConsume)SmartSettings.svelte
forceEditableprop to allTokenRowinstances in Smart Settings panels:Implementation Details
The
forceEditableprop overrides the normal consumption-role behavior, allowing tokens that would normally be read-only (because they are derived from configure tokens) to be edited when explicitly surfaced in Smart Settings. The styling and control visibility logic respects this override, ensuring the UI correctly reflects the editable state.https://claude.ai/code/session_01SrEDodTGN4MpmWJfP1p5Vb