Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vscode-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@
"default": true,
"description": "Shows device frame in the IDE panel."
},
"RadonIDE.userInterface.christmasMode": {
"RadonIDE.userInterface.festiveMode": {
"type": "boolean",
"scope": "window",
"default": false,
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode-extension/src/common/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export type RadonAISettings = {
export type UserInterfaceSettings = {
panelLocation: PanelLocation;
showDeviceFrame: boolean;
christmasMode?: boolean;
festiveMode?: boolean;
};

export type DeviceControlSettings = {
Expand Down Expand Up @@ -628,7 +628,7 @@ export const initialState: State = {
userInterface: {
panelLocation: "tab",
showDeviceFrame: true,
christmasMode: false,
festiveMode: false,
},
deviceSettings: {
deviceRotation: DeviceRotation.Portrait,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const WorkspaceConfigurationKeyMap = {
userInterface: {
panelLocation: "userInterface.panelLocation",
showDeviceFrame: "userInterface.showDeviceFrame",
christmasMode: "userInterface.christmasMode",
festiveMode: "userInterface.festiveMode",
},
deviceSettings: {
deviceRotation: "deviceSettings.deviceRotation",
Expand Down Expand Up @@ -65,8 +65,8 @@ export function getCurrentWorkspaceConfiguration(config: WorkspaceConfiguration)
"tab",
showDeviceFrame:
config.get<boolean>(WorkspaceConfigurationKeyMap.userInterface.showDeviceFrame) ?? true,
christmasMode:
config.get<boolean>(WorkspaceConfigurationKeyMap.userInterface.christmasMode) ?? false,
festiveMode:
config.get<boolean>(WorkspaceConfigurationKeyMap.userInterface.festiveMode) ?? false,
},
deviceControl: {
startDeviceOnLaunch:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from "../../common/State";
import { useSelectedDeviceSessionState } from "../hooks/selectedSession";

import AsciiChristmasTree from "./christmas/AsciiChristmasTree";
import AsciiChristmasTree from "./festive/AsciiChristmasTree";

const startupStageWeightSum = StartupStageWeight.map((item) => item.weight).reduce(
(acc, cur) => acc + cur,
Expand Down Expand Up @@ -113,11 +113,11 @@ function PreviewLoader({ onRequestShowPreview }: { onRequestShowPreview: () => v
}
}

const christmasMode = use$(store$.workspaceConfiguration.userInterface.christmasMode);
const festiveMode = use$(store$.workspaceConfiguration.userInterface.festiveMode);

return (
<div className={`preview-loader-wrapper ${isLandscape ? "landscape" : "portrait"}`}>
{christmasMode && <AsciiChristmasTree />}
{festiveMode && <AsciiChristmasTree />}
<div className="preview-loader-load-info">
<button className="preview-loader-container" onClick={handleLoaderClick}>
<div className="preview-loader-button-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ActivateLicenseView } from "../views/ActivateLicenseView";
import { LicenseStatus } from "../../common/License";
import ExportLogsView from "../views/ExportLogsView";

import { ChristmasModeToggle } from "./christmas/ChristmasModeToggle";
import { FestiveModeToggle } from "./festive/FestiveModeToggle";

interface SettingsDropdownProps {
children: React.ReactNode;
Expand Down Expand Up @@ -168,7 +168,7 @@ function SettingsDropdown({ project, isDeviceRunning, children, disabled }: Sett
</DropdownMenu.Item>
{telemetryEnabled && <SendFeedbackItem />}
{shouldShowActivateLicenseItem && <ActivateLicenseItem />}
<ChristmasModeToggle />
<FestiveModeToggle />
<div className="dropdown-menu-item device-settings-version-text">
Radon IDE version: {extensionVersion}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function AsciiChristmasTree({ width = 46, height = 19 }: { width?: number; heigh
}, []);

const treeImage = useMemo(() => {
return generateChristmasScene(width, height, baubleColors);
return generateFestiveScene(width, height, baubleColors);
}, [width, height, baubleColors]);

return (
Expand All @@ -60,7 +60,7 @@ function AsciiChristmasTree({ width = 46, height = 19 }: { width?: number; heigh
);
}

function generateChristmasScene(width: number, _height: number, baubleColors: string[]): Pixel[][] {
function generateFestiveScene(width: number, _height: number, baubleColors: string[]): Pixel[][] {
// Generate single centered tree with fixed size
const treeWidth = 21;
const tree = generateTree(treeWidth, baubleColors, 0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import * as Switch from "@radix-ui/react-switch";
import { use$ } from "@legendapp/state/react";
import { useStore } from "../../providers/storeProvider";
export function ChristmasModeToggle() {
export function FestiveModeToggle() {
const store$ = useStore();
const christmasMode = use$(store$.workspaceConfiguration.userInterface.christmasMode);
const festiveMode = use$(store$.workspaceConfiguration.userInterface.festiveMode);
return (
<div className="dropdown-menu-item">
<span className="codicon codicon-sparkle" />
Christmas Mode
Festive Mode
<Switch.Root
className="switch-root small-switch"
id="christmas-mode"
data-testid="settings-dropdown-christmas-mode-switch"
id="festive-mode"
data-testid="settings-dropdown-festive-mode-switch"
onCheckedChange={(checked) =>
store$.workspaceConfiguration.userInterface.christmasMode.set(checked)
store$.workspaceConfiguration.userInterface.festiveMode.set(checked)
}
defaultChecked={christmasMode}
defaultChecked={festiveMode}
style={{ marginLeft: "auto" }}>
<Switch.Thumb className="switch-thumb" />
</Switch.Root>
Expand Down
6 changes: 3 additions & 3 deletions packages/vscode-extension/src/webview/views/PreviewView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { usePaywalledCallback } from "../hooks/usePaywalledCallback";
import { useDevices } from "../hooks/useDevices";
import { useIsFeatureAdminDisabled } from "../hooks/useIsFeatureAdminDisabled";

import FestiveSnow from "../components/christmas/FestiveSnow";
import FestiveSnow from "../components/festive/FestiveSnow";

const INSPECTOR_AVAILABILITY_MESSAGES = {
[InspectorAvailabilityStatus.Available]: "Select an element to inspect it",
Expand Down Expand Up @@ -160,7 +160,7 @@ function PreviewView() {
const radonConnectEnabled = projectState.connectState.enabled;
const rotation = use$(store$.workspaceConfiguration.deviceSettings.deviceRotation);
const zoomLevel = use$(store$.projectState.previewZoom);
const christmasMode = use$(store$.workspaceConfiguration.userInterface.christmasMode);
const festiveMode = use$(store$.workspaceConfiguration.userInterface.festiveMode);
const onZoomChanged = useCallback(
(zoom: ZoomLevelType) => {
store$.projectState.previewZoom.set(zoom);
Expand Down Expand Up @@ -363,7 +363,7 @@ function PreviewView() {

return (
<div className="panel-view" data-testid="radon-panel-view">
{christmasMode && <FestiveSnow />}
{festiveMode && <FestiveSnow />}
<div className="button-group-top">
<div className="button-group-top-left">
<UrlBar disabled={!selectedProjectDevice} />
Expand Down
Loading