Skip to content

Conversation

@mikewuu
Copy link
Contributor

@mikewuu mikewuu commented Oct 7, 2025

Closes https://linear.app/seam/issue/CX-450/status-field-disappears-when-clicking-unlock-button-in-seam-components

Previously we were hiding the toggle to prevent the case where the device doesn't report lock status.

This PR conditionally renders buttons depending on whether the device has capability to unlock/lock:

  • Can both lock/unlock = show toggle (current button)
  • Can lock only = show lock status + lock button only
  • Can unlock only = show lock status + unlock button only
  • Cannot lock or unlock = show unknown status + both lock/unlock buttons

Screenshots

CleanShot 2025-10-08 at 14 01 45@2x

@mikewuu
Copy link
Contributor Author

mikewuu commented Oct 7, 2025

Copy link
Member

Choose a reason for hiding this comment

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

useLockDoor/useUnlockDoor / use-(un)lock-door.ts

Copy link
Contributor Author

@mikewuu mikewuu Oct 16, 2025

Choose a reason for hiding this comment

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

Comment on lines 131 to 157
return (
<div className='seam-content seam-lock-status'>
<div>
<span className='seam-label'>{t.lockStatus}</span>
<span className='seam-value'>{t.statusUnknown}</span>
</div>
<div className='seam-right'>
<Button
size='small'
onClick={() => {
lock.mutate(device)
}}
>
{t.lock}
</Button>
<Button
size='small'
onClick={() => {
unlock.mutate(device)
}}
>
{t.unlock}
</Button>
</div>
</div>
)
}
Copy link
Member

Choose a reason for hiding this comment

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

For this last condition

Cannot lock or unlock = show unknown status + both lock/unlock buttons

We should not show ANY buttons or any row. If cannot lock or unlock then the buttons are not going to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense, thanks!

@mikewuu mikewuu merged commit 0ee1e3f into main Oct 16, 2025
16 checks passed
@mikewuu mikewuu deleted the fix-unlock-hidden branch October 16, 2025 09:32
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.

5 participants