Skip to content

Conversation

@pzanella
Copy link
Contributor

Restyled the publish UI and cleaned up the code.
Here are some image examples:
image
image
image

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

Walkthrough

The PR renames CSS classes across publish UI components to a BEM-like publish-ui__* scheme and updates active-state modifiers. Source buttons (Camera, Microphone, File, Screen, Nothing) and MediaSourceSelector wrapper/controls are restructured; MediaSourceSelector now hides sources on change. PublishStatusIndicator switches from Switch/Match to a STATUS_MAP-driven render. New component-scoped CSS files and expanded CSS variables are added. Context changes export the PublishStatus type, initialize muted/invisible/source to “nothing”, and adjust publish status derivation and file-selection muted behavior. No public API signatures beyond exporting PublishStatus.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: restyling Publish UI' directly and clearly describes the main change—a restyling/refactoring of the Publish UI components across multiple files.
Description check ✅ Passed The description states 'Restyled the publish UI and cleaned up the code' with visual examples, which is directly related to the changeset's core objectives of UI restyling and code refactoring.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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
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: 1

🤖 Fix all issues with AI agents
In `@js/hang-ui/src/publish/components/NothingSourceButton.tsx`:
- Around line 14-18: The "No Source" button in NothingSourceButton is missing
the shared wrapper class used by other source buttons; update the component so
the Button is wrapped (or the outer div) uses the
publish-ui__source-button-wrapper class to ensure spacing/margins from
source-button.css are applied (locate the JSX in the NothingSourceButton
component where the Button with class publish-ui__source-button--no-source is
rendered and add the publish-ui__source-button-wrapper wrapper class to match
other source buttons).
🧹 Nitpick comments (4)
js/hang-ui/src/publish/components/FileSourceButton.tsx (1)

29-35: Redundant flex--center class.

The Button component already applies flex--center internally (see button.tsx line 42: class={`flex--center button ${props.class}`}). Adding it again in the class prop results in duplicate class application.

Suggested fix
 			<Button
 				title="Upload File"
-				class={`publish-ui__source-button flex--center ${context.fileActive() ? "publish-ui__source-button--active" : ""}`}
+				class={`publish-ui__source-button ${context.fileActive() ? "publish-ui__source-button--active" : ""}`}
 				onClick={onClick}
 			>
js/hang-ui/src/publish/components/ScreenSourceButton.tsx (1)

15-21: Redundant flex--center class.

Same as FileSourceButton: the Button component already applies flex--center internally. Adding it in the class prop is redundant.

Suggested fix
 			<Button
 				title="Screen"
-				class={`publish-ui__source-button flex--center ${context.screenActive() ? "publish-ui__source-button--active" : ""}`}
+				class={`publish-ui__source-button ${context.screenActive() ? "publish-ui__source-button--active" : ""}`}
 				onClick={onClick}
 			>
js/hang-ui/src/publish/components/PublishStatusIndicator.tsx (1)

21-35: Consider memoizing statusConfig to avoid repeated calls.

statusConfig() is invoked three times in the JSX (lines 29, 32, 34). In Solid.js, each call re-executes the function. While the computation is lightweight, you can avoid redundancy by using createMemo or extracting the result once.

♻️ Suggested optimization
+import { createMemo } from "solid-js";
 import type { PublishStatus } from "../context";
 import usePublishUIContext from "../hooks/use-publish-ui";
 
 // ... STATUS_MAP and unknownStatus unchanged ...
 
 export default function PublishStatusIndicator() {
 	const context = usePublishUIContext();
 
-	const statusConfig = (): StatusIndicatorConfig => {
+	const statusConfig = createMemo((): StatusIndicatorConfig => {
 		const status: PublishStatus = context.publishStatus();
 		return STATUS_MAP[status] || unknownStatus;
-	};
+	});
 
 	return (
 		<div class="publish-ui__status-indicator flex--center">
 			<span
 				class={`publish-ui__status-indicator-dot publish-ui__status-indicator-dot--${statusConfig().variant}`}
 			/>
 			<span
 				class={`publish-ui__status-indicator-text publish-ui__status-indicator-text--${statusConfig().variant}`}
 			>
 				{statusConfig().text}
 			</span>
 		</div>
 	);
 }
js/hang-ui/src/publish/styles/status-indicator.css (1)

19-41: Consolidate duplicate ::after selectors for clarity.

Lines 19-29 define the ::after pseudo-element with animation, then lines 31-33 immediately override it with display: none. While this works via CSS cascade, it's confusing to read. Consider consolidating into a single base rule.

♻️ Suggested consolidation
 .publish-ui__status-indicator-dot::after {
 	content: "";
 	position: absolute;
 	inset: 0;
 	border-radius: 50%;
 	background: currentColor;
 	transform: scale(1);
 	opacity: 0.5;
 	animation: status-pulse 1.5s ease-out infinite;
 	z-index: -1;
+	display: none;
 }
 
-.publish-ui__status-indicator-dot::after {
-	display: none;
-}
-
 .publish-ui__status-indicator-dot--live::after,
 .publish-ui__status-indicator-dot--warning::after,
 .publish-ui__status-indicator-dot--connecting::after,
 .publish-ui__status-indicator-dot--audio-only::after,
 .publish-ui__status-indicator-dot--video-only::after {
 	display: block;
 }

Comment on lines 14 to 18
<div class="flex--center">
<Button
title="No Source"
class={`publishSourceButton ${context.nothingActive() ? "active" : ""}`}
class={`publish-ui__source-button flex--center publish-ui__source-button--no-source ${context.nothingActive() ? "publish-ui__source-button--no-source-active" : ""}`}
onClick={onClick}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use the shared wrapper class to keep spacing consistent.
Other source buttons use publish-ui__source-button-wrapper; without it, the “No Source” button may lose spacing/margins defined in source-button.css, leading to misalignment.

✅ Suggested fix
-		<div class="flex--center">
+		<div class="publish-ui__source-button-wrapper flex--center">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div class="flex--center">
<Button
title="No Source"
class={`publishSourceButton ${context.nothingActive() ? "active" : ""}`}
class={`publish-ui__source-button flex--center publish-ui__source-button--no-source ${context.nothingActive() ? "publish-ui__source-button--no-source-active" : ""}`}
onClick={onClick}
<div class="publish-ui__source-button-wrapper flex--center">
<Button
title="No Source"
class={`publish-ui__source-button flex--center publish-ui__source-button--no-source ${context.nothingActive() ? "publish-ui__source-button--no-source-active" : ""}`}
onClick={onClick}
🤖 Prompt for AI Agents
In `@js/hang-ui/src/publish/components/NothingSourceButton.tsx` around lines 14 -
18, The "No Source" button in NothingSourceButton is missing the shared wrapper
class used by other source buttons; update the component so the Button is
wrapped (or the outer div) uses the publish-ui__source-button-wrapper class to
ensure spacing/margins from source-button.css are applied (locate the JSX in the
NothingSourceButton component where the Button with class
publish-ui__source-button--no-source is rendered and add the
publish-ui__source-button-wrapper wrapper class to match other source buttons).

Copy link
Collaborator

@kixelated kixelated left a comment

Choose a reason for hiding this comment

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

Seems fine to me, although I don't understand the muted changes. Just make sure you've tested all of the permutations.

@pzanella
Copy link
Contributor Author

Seems fine to me, although I don't understand the muted changes. Just make sure you've tested all of the permutations.

Thank you for the review, @kixelated.
I noticed that when you click on the screen or upload file button, the microphone button becomes active, but the status shows “Video only” instead of “Live”. Is this correct?
Otherwise, if the old status was correct, I’m happy to reset the context.tsx file. Let me know, thanks!

<Button
title="Camera"
class={`publishSourceButton ${context.cameraActive() ? "active" : ""}`}
class={`publish-ui__source-button flex--center ${context.cameraActive() ? "publish-ui__source-button--active" : ""}`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is really cool! we should file an issue to re-factor all of the UI components to use this format.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Glad you like it! I agree we should use this format.

Copy link
Collaborator

@jdreetz jdreetz left a comment

Choose a reason for hiding this comment

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

This looks great! Love the refactoring of the styles too! Haven't tested but I'm good with merging if it works for you.

@jdreetz jdreetz merged commit a755386 into moq-dev:main Jan 23, 2026
1 check passed
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.

3 participants