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
16 changes: 8 additions & 8 deletions apps/web/src/components/debug/UserInputDebugPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,14 @@ export function UserInputDebugPanel() {
className="fixed inset-x-2 bottom-2 z-50 max-h-[45vh] overflow-hidden rounded-2xl border border-white/12 bg-neutral-950/92 text-white shadow-2xl backdrop-blur-md sm:right-4 sm:w-[28rem] sm:inset-x-auto"
style={floatingStyle}
>
<div
className="flex cursor-grab touch-none items-center justify-between gap-2 border-b border-white/10 px-3 py-2 active:cursor-grabbing"
onPointerDown={beginDrag}
onPointerMove={onDragMove}
onPointerUp={endDrag}
onPointerCancel={endDrag}
>
<div className="min-w-0">
<div className="flex items-center justify-between gap-2 border-b border-white/10 px-3 py-2">
<div
className="min-w-0 cursor-grab touch-none active:cursor-grabbing"
onPointerDown={beginDrag}
onPointerMove={onDragMove}
onPointerUp={endDrag}
onPointerCancel={endDrag}
>
<p className="text-[11px] font-semibold tracking-[0.16em] text-white/55 uppercase">
User Input Debug
</p>
Expand Down
19 changes: 18 additions & 1 deletion apps/web/src/debug/userInputDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ function readSearchParamEnabled(): boolean {
return value === "1" || value === "true" || value === "on";
}

function canPersistDebugState(): boolean {
if (typeof window === "undefined") {
return false;
}
const hostname = window.location.hostname.toLowerCase();
return (
hostname === "t3-dev.claude.do" ||
hostname === "localhost" ||
hostname === "127.0.0.1" ||
hostname === "::1"
);
}

function readPersistedEnabled(): boolean {
if (typeof window === "undefined") {
return false;
Expand Down Expand Up @@ -95,6 +108,10 @@ function persistDebugState(input: {
return;
}
try {
if (!canPersistDebugState()) {
window.localStorage.removeItem(USER_INPUT_DEBUG_STORAGE_KEY);
return;
}
if (input.enabled) {
window.localStorage.setItem(
USER_INPUT_DEBUG_STORAGE_KEY,
Expand All @@ -113,7 +130,7 @@ function persistDebugState(input: {
}

function resolveInitialEnabled(): boolean {
const enabled = readSearchParamEnabled() || readPersistedEnabled();
const enabled = readSearchParamEnabled() || (canPersistDebugState() && readPersistedEnabled());
if (enabled) {
const layout = readPersistedLayout();
persistDebugState({
Expand Down
Loading