header uri name

This commit is contained in:
Andrew Pareles 2025-03-15 03:42:21 -07:00
parent 7ea5870a11
commit c1e83e458b
2 changed files with 3 additions and 3 deletions

View file

@ -5,7 +5,7 @@ import { isFeatureNameDisabled } from '../../../../common/voidSettingsTypes.js'
import { URI } from '../../../../../../../base/common/uri.js'
import { LucideIcon, RotateCw } from 'lucide-react'
import { Check, X, Square, Copy, Play, } from 'lucide-react'
import { ToolContentsWrapper } from '../sidebar-tsx/SidebarChat.js'
import { getBasename, ToolContentsWrapper } from '../sidebar-tsx/SidebarChat.js'
import { ChatMarkdownRender } from './ChatMarkdownRender.js'
enum CopyButtonText {
@ -288,7 +288,7 @@ export const BlockCodeApplyWrapper = ({
<div className="flex items-center">
{statusIndicatorHTML}
<span className="text-[13px] font-light text-void-fg-3">
{language || 'text'}
{uri !== 'current' ? getBasename(uri.fsPath) : language || 'text'}
</span>
</div>
<div className={`${canApply ? '' : 'hidden'} flex items-center gap-1`}>

View file

@ -491,7 +491,7 @@ const ScrollToBottomContainer = ({ children, className, style, scrollContainerRe
};
const getBasename = (pathStr: string) => {
export const getBasename = (pathStr: string) => {
// 'unixify' path
pathStr = pathStr.replace(/[/\\]+/g, '/') // replace any / or \ or \\ with /
const parts = pathStr.split('/') // split on /