Skip to content

fix: UiKit Playground using wrong surface#37418

Merged
kodiakhq[bot] merged 2 commits into
developfrom
fix/playgroundSurfaceSelection
Nov 7, 2025
Merged

fix: UiKit Playground using wrong surface#37418
kodiakhq[bot] merged 2 commits into
developfrom
fix/playgroundSurfaceSelection

Conversation

@gabriellsh
Copy link
Copy Markdown
Member

@gabriellsh gabriellsh commented Nov 6, 2025

Proposed changes (including videos or screenshots)

Some elements were not working right despite having the correct payload, caused by the wrong surface being passed down in the component tree.

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced surface component rendering with improved fallback logic, now intelligently determining default surface types based on screen payload availability instead of using a fixed default.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Nov 6, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 6, 2025

⚠️ No Changeset found

Latest commit: 54bfd42

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 6, 2025

Walkthrough

The Surface component's DraggableList surface prop now dynamically uses the active screen's surface payload with a nullish coalescing fallback to SurfaceOptions.Message, replacing the previous static SurfaceOptions.Modal constant.

Changes

Cohort / File(s) Summary
Surface prop fallback logic
apps/uikit-playground/src/Components/Preview/Display/Surface/Surface.tsx
Changed DraggableList surface prop from static SurfaceOptions.Modal to conditional screens[activeScreen]?.payload.surface ?? SurfaceOptions.Message

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

  • Area of attention: Verify the nullish coalescing fallback is appropriate and SurfaceOptions.Message is the intended default when no surface is present in the active screen payload

Poem

🐰 A prop that once stood still and firm,
Now dances with the screen's concern.
From Modal's grip to Message's grace,
The surface finds its rightful place.
With fallback's touch, the choice runs deep—
Our UI awake, no static sleep! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: UiKit Playground using wrong surface' clearly and concisely describes the main change: fixing incorrect surface selection in the UiKit Playground.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 fix/playgroundSurfaceSelection

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
Copy Markdown
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

🧹 Nitpick comments (1)
apps/uikit-playground/src/Components/Preview/Display/Surface/Surface.tsx (1)

94-94: Consider using nullish coalescing operator (??) instead of logical OR (||).

The || operator treats all falsy values (null, undefined, false, 0, '', NaN) as triggers for the fallback. If surface could legitimately be a falsy but valid value, ?? would be more precise as it only checks for null/undefined.

Apply this diff if you want stricter nullish handling:

-            surface={screens[activeScreen]?.payload.surface || SurfaceOptions.Message}
+            surface={screens[activeScreen]?.payload.surface ?? SurfaceOptions.Message}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3310983 and 552c15e.

📒 Files selected for processing (1)
  • apps/uikit-playground/src/Components/Preview/Display/Surface/Surface.tsx (1 hunks)
🔇 Additional comments (1)
apps/uikit-playground/src/Components/Preview/Display/Surface/Surface.tsx (1)

92-94: Both components receive identical values due to SurfaceRender's default parameter.

The review comment identifies a false inconsistency. SurfaceRender has a default parameter type = SurfaceOptions.Message in its component definition, so when undefined is passed, it defaults to SurfaceOptions.Message—the same value that DraggableList explicitly receives via the || operator. Both components handle the undefined case identically by design.

Likely an incorrect or invalid review comment.

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.86%. Comparing base (95eefa8) to head (54bfd42).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37418      +/-   ##
===========================================
- Coverage    68.12%   63.86%   -4.27%     
===========================================
  Files         3364     3081     -283     
  Lines       115749   112369    -3380     
  Branches     20909    20314     -595     
===========================================
- Hits         78855    71764    -7091     
- Misses       34204    38411    +4207     
+ Partials      2690     2194     -496     
Flag Coverage Δ
e2e 43.40% <ø> (-14.08%) ⬇️
unit 72.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tassoevan tassoevan added this to the 7.13.0 milestone Nov 7, 2025
@tassoevan tassoevan added the stat: QA assured Means it has been tested and approved by a company insider label Nov 7, 2025
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Nov 7, 2025
@kodiakhq kodiakhq Bot merged commit fddc37a into develop Nov 7, 2025
62 of 63 checks passed
@kodiakhq kodiakhq Bot deleted the fix/playgroundSurfaceSelection branch November 7, 2025 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants