Skip to content

Commit

Permalink
Fix headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpgreen2 committed Dec 7, 2023
1 parent 0902116 commit 0d5423a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,11 @@
}
};
let headerWidth: number;
function isHeaderWidthSmall(width: number) {
return width < 800;
}
$: titleInput = modelName;
</script>

<WorkspaceHeader
{...{ titleInput: formatModelName(titleInput), onChangeCallback }}
on:resize={(e) => (headerWidth = e.detail.width)}
>
<svelte:fragment slot="workspace-controls">
<IconButton
Expand All @@ -120,7 +113,7 @@
<PanelCTA side="right">
<ModelWorkspaceCTAs
availableDashboards={$availableDashboards?.data}
collapse={isHeaderWidthSmall(headerWidth)}
{collapse}
modelHasError={$modelHasError}
{modelName}
suppressTooltips={contextMenuOpen}
Expand Down
9 changes: 1 addition & 8 deletions web-common/src/layout/workspace/WorkspaceHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import TooltipContent from "@rilldata/web-common/components/tooltip/TooltipContent.svelte";
import { createResizeListenerActionFactory } from "@rilldata/web-common/lib/actions/create-resize-listener-factory";
import { dynamicTextInputWidth } from "@rilldata/web-common/lib/actions/dynamic-text-input-width";
import { createEventDispatcher, getContext } from "svelte";
import { getContext } from "svelte";
import type { Tweened } from "svelte/motion";
import type { Writable } from "svelte/store";
import SourceUnsavedIndicator from "../../features/sources/editor/SourceUnsavedIndicator.svelte";
Expand All @@ -18,8 +18,6 @@
export let editable = true;
export let showInspectorToggle = true;
const dispatch = createEventDispatcher();
let titleInputElement;
let editingTitle = false;
Expand All @@ -42,12 +40,7 @@
}
}
function dispatchWidth(width: number) {
dispatch("resize", { width: width });
}
$: width = $observedNode?.getBoundingClientRect()?.width;
$: dispatchWidth(width);
function onInput() {
if (editable) {
Expand Down

0 comments on commit 0d5423a

Please sign in to comment.