Skip to content

fix(store): promote IncompatibleToggle to empty-state CTA when nothing matches (closes #355)#423

Merged
jaylfc merged 1 commit into
masterfrom
fix/incompatible-toggle-empty-state
May 8, 2026
Merged

fix(store): promote IncompatibleToggle to empty-state CTA when nothing matches (closes #355)#423
jaylfc merged 1 commit into
masterfrom
fix/incompatible-toggle-empty-state

Conversation

@jaylfc
Copy link
Copy Markdown
Owner

@jaylfc jaylfc commented May 8, 2026

Closes #355 (johny on #312). When the compatible-cards section is empty, the previously-subtle IncompatibleToggle at the bottom of a blank pane was unfindable. Now it renders as a yellow alert card at the top with explanatory copy + opens the list by default, while preserving the subtle bottom-toggle behaviour when there ARE compatible items above. tsc -b clean.


Jay is asleep right now so this PR was opened by Claude Opus 4.7.

Summary by CodeRabbit

New Features

  • Improved empty-state handling – When a section has no matching items, users now see a clear empty-state message with an alert icon displaying the count of incompatible items
  • Toggle to show incompatible items – New "Show all" button reveals the incompatible list, which opens by default when no matches exist in the section

…g matches

Reported by @johny-mnemonic in discussion #312 — on his low-spec N100,
the compatible-cards area was empty and the IncompatibleToggle sat at
the bottom of an otherwise blank section. He didn't realise there was
any filter at all.

When compatibleCount === 0 the toggle now renders as a yellow alert
card at the TOP of the area with explanatory copy + a Show all button,
and the dimmed list opens by default. Subtle bottom-toggle behaviour
preserved when there ARE compatible items above.

Closes #355.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 40949be5-f6b9-4e5a-941f-79cf866a0fb2

📥 Commits

Reviewing files that changed from the base of the PR and between 8d803d5 and fb86702.

📒 Files selected for processing (2)
  • desktop/src/apps/StoreApp/IncompatibleToggle.tsx
  • desktop/src/apps/StoreApp/index.tsx

📝 Walkthrough

Walkthrough

The IncompatibleToggle component now accepts an optional compatibleCount prop to detect when no compatible items exist. When the compatible section is empty, it renders a prominent amber CTA with an alert icon instead of a hidden bottom toggle, automatically opening the incompatible list to help users understand why nothing matched their device.

Changes

IncompatibleToggle Empty-State UX

Layer / File(s) Summary
Type Definitions
desktop/src/apps/StoreApp/IncompatibleToggle.tsx
Props interface adds optional compatibleCount?: number prop (default 1) and imports AlertCircle icon from lucide.
Empty-State Rendering
desktop/src/apps/StoreApp/IncompatibleToggle.tsx
When compatibleCount === 0, component initializes isOpen = true and renders amber CTA with alert icon, message showing incompatible count, and "Show all"/"Hide" toggle at the top instead of the bottom divider.
Non-Empty-State Rendering
desktop/src/apps/StoreApp/IncompatibleToggle.tsx
Default rendering preserves bottom divider toggle layout for sections with compatible items, now deriving open state from updated initialization logic.
Parent Integration
desktop/src/apps/StoreApp/index.tsx
JSX line placement adjusted around IncompatibleToggle rendering to reflect updated component structure.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A toggle that hid in the basement below,
Now shines at the top with a luminous glow. 🌟
When nothing matches, users now see,
A friendly alert: "Show all to me!" 🐰

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/incompatible-toggle-empty-state

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.

@jaylfc jaylfc merged commit 169c28d into master May 8, 2026
5 of 8 checks passed
@jaylfc jaylfc deleted the fix/incompatible-toggle-empty-state branch May 8, 2026 03:30
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 8, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
desktop/src/apps/StoreApp/IncompatibleToggle.tsx 20 State 'open' is initialized based on 'compatibleCount' but does not update if the prop changes, potentially leading to incorrect initial state if 'compatibleCount' is updated dynamically
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

Files Reviewed (2 files)
  • desktop/src/apps/StoreApp/IncompatibleToggle.tsx - 1 issues
  • desktop/src/apps/StoreApp/index.tsx - 0 issues

Fix these issues in Kilo Cloud


Reviewed by grok-code-fast-1:optimized:free · 113,653 tokens

const [open, setOpen] = useState(false);
export function IncompatibleToggle({ count, compatibleCount = 1, children }: Props) {
const [open, setOpen] = useState(compatibleCount === 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: State 'open' is initialized based on 'compatibleCount' but does not update if the prop changes, potentially leading to incorrect initial state if 'compatibleCount' is updated dynamically. Consider using useEffect to synchronize the state with prop changes.

@github-project-automation github-project-automation Bot moved this from Todo to Done in TinyAgentOS Roadmap May 8, 2026
jaylfc added a commit that referenced this pull request May 11, 2026
#425 (providers): the cloud-backend list inside the get-providers re-probe
block was duplicated as an inline tuple even though CLOUD_TYPES is already
defined as a module constant at line 22 and used elsewhere in the same
file. Swap the inline tuple for the constant — same membership set, one
source of truth, easier to extend.

#423 (IncompatibleToggle): useState(compatibleCount === 0) only runs the
initializer once. filtered.length / compatibleCount can transition to 0
*after* mount when the user changes the device filter, and the docstring
on the prop says the toggle should auto-open in that case — but it didn't
because the open state was frozen from mount-time. Added a useEffect that
sets open=true when compatibleCount becomes 0. Only triggers on the 0
transition, so the user's explicit close-after-filter choice is preserved
on the way back up.

PR #418's bot finding was a false positive — mlc-llm/manifest.yaml already
has type: service at line 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

ux(store): IncompatibleToggle is unfindable when nothing is compatible

1 participant