Commit 06bef45f authored by Jiachi Liu's avatar Jiachi Liu Committed by RobPruzan

fix default boundaries

parent 5fe8a00b
......@@ -2,7 +2,10 @@ import { useCallback, useState, useRef, useMemo } from 'react'
import { Menu } from '@base-ui-components/react/menu'
import type { SegmentNodeState } from '../../../userspace/app/segment-explorer-node'
import { ChevronDownIcon } from '../../icons/chevron-down'
import { normalizeBoundaryFilename } from '../../../../server/app-render/segment-explorer-path'
import {
isBoundaryFile,
normalizeBoundaryFilename,
} from '../../../../server/app-render/segment-explorer-path'
import { cx } from '../../utils/cx'
import { useClickOutside } from '../errors/dev-tools-indicator/utils'
......@@ -71,9 +74,9 @@ export function SegmentBoundaryTrigger({
}, [boundaries, possibleExtension])
const fileName = (pagePath || '').split('/').pop() || ''
const isBoundaryFile = fileType.startsWith('boundary:')
const isBoundary = isBoundaryFile(fileType)
const pageFileName = normalizeBoundaryFilename(
isBoundaryFile
isBoundary
? fileName // Show the selected boundary file name when overridden
: fileName || `page.${possibleExtension}`
)
......@@ -154,8 +157,8 @@ export function SegmentBoundaryTrigger({
[onSelectBoundary, pagePath, openInEditor]
)
// For layout/template files, just render a simple button to open in editor
if (fileType === 'layout' || fileType === 'template') {
// For non-page files, just render a simple button to open in editor
if (fileType !== 'page' && !fileType.startsWith('boundary:')) {
return (
<button
className="segment-boundary-trigger"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment