Skip to content

ENG-1635: Change key image setting from checkbox to toggle switch#1121

Open
sid597 wants to merge 1 commit into
mainfrom
eng-1635-change-key-image-setting-from-checkbox-to-toggle-switch
Open

ENG-1635: Change key image setting from checkbox to toggle switch#1121
sid597 wants to merge 1 commit into
mainfrom
eng-1635-change-key-image-setting-from-checkbox-to-toggle-switch

Conversation

@sid597

@sid597 sid597 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Change the Key image (first image from file) setting in Obsidian node type settings from a plain checkbox to the Obsidian-native toggle switch, matching core Obsidian behavior
  • Uses the same checkbox-container / is-enabled pattern as the existing toggles in GeneralSettings, AdminPanelSettings, and RelationshipSection
  • The onClick guard preserves the existing disabled behavior for imported node types

Test plan

  • npx eslint --max-warnings 0 (only pre-existing warning, same as main)
  • npx prettier --check
  • npx tsc --noEmit --skipLibCheck (only pre-existing packages/database errors, same as main)
  • Obsidian plugin build passes with 0 errors

Open in Devin Review

@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

ENG-1635

@supabase

supabase Bot commented Jun 10, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
discourse-graph Skipped Skipped Jun 10, 2026 8:39am

Request Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

if (!disabled) onChange(!value);
}}
>
<input type="checkbox" checked={!!value} disabled={disabled} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Controlled checkbox missing readOnly prop causes React console warning

The <input type="checkbox" checked={!!value} /> at line 166 is a controlled React input (it has checked prop) but lacks both onChange and readOnly. React will emit a console warning: "You provided a checked prop to a form field without an onChange handler. This will render a read-only field. If the field should be mutable use defaultChecked. Otherwise, set either onChange or readOnly."

The existing pattern in RelationshipSection.tsx:615 correctly adds readOnly to suppress this warning. The fix is to add readOnly to the input element.

Suggested change
<input type="checkbox" checked={!!value} disabled={disabled} />
<input type="checkbox" checked={!!value} readOnly disabled={disabled} />
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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