fix: 处理 Copilot 二轮 review 的 10 条评论
- BrowserView: 即使 host 在白名单,GUI 自身 origin 永不给 allow-same-origin(裸 host 条目覆盖所有端口时可提权) - intercept: revealInExplorer 相对路径经 resolveSidebarPath 解析后再 revealPaths(交付物路径是相对的) - intercept: ctx.betterSidebar 改为 ctx.get(#357 纤维链读取约定) - FileTree/EditorHost/TreePanel/tabs: 把 revealed 贯通到树行渲染 + 高亮类 + scrollIntoView(此前高亮永不渲染) - state.revealPaths: 重建祖先目录时保留前导分隔符(POSIX/UNC 此前目录永远折叠) - state.schedulePersist: 仅活动会话写入全局宽度(targeted open 不再用非活动会话的过期宽度覆盖拖拽值) - browser.probe: GET 回退显式取消 body(否则流式/大响应挂住 socket) - terminal-font: leading generic 前只放 symbols-only 字体;fully-patched 放 generic 后(避免 hijack 度量字体) - sidebar.module.css: 恢复拖拽反馈(#130 的 silent resize 与 PR 描述冲突,取 HEAD) - Sidebar: 剩余 4 处 ctx.betterSidebar 改 ctx.get - tests: 补 revealPaths/iframeSandboxFor/terminal-font 回归测试 + EditorHost/FileTree 测试补 revealed prop
This commit is contained in:
@@ -500,9 +500,9 @@ export function Sidebar(props: { ctx: Context; store: SidebarStore }) {
|
||||
const scope = { sessionId }
|
||||
const title = typeof request.title === 'string' && request.title !== '' ? request.title : undefined
|
||||
if (request.kind === 'url') {
|
||||
ctx.betterSidebar?.openTab({ type: 'browser', url: request.target, title }, scope)
|
||||
ctx.get('betterSidebar')?.openTab({ type: 'browser', url: request.target, title }, scope)
|
||||
} else if (request.kind === 'folder') {
|
||||
ctx.betterSidebar?.openTab({
|
||||
ctx.get('betterSidebar')?.openTab({
|
||||
type: 'editor',
|
||||
title,
|
||||
path: request.target,
|
||||
@@ -510,7 +510,7 @@ export function Sidebar(props: { ctx: Context; store: SidebarStore }) {
|
||||
meta: { dir: true },
|
||||
}, scope)
|
||||
} else {
|
||||
ctx.betterSidebar?.openFile(scope, request.target, title)
|
||||
ctx.get('betterSidebar')?.openFile(scope, request.target, title)
|
||||
}
|
||||
} catch {
|
||||
// Malformed push: ignore (the next push carries its own request).
|
||||
@@ -1620,7 +1620,7 @@ export function Sidebar(props: { ctx: Context; store: SidebarStore }) {
|
||||
onMove={(x, y) => { store.reduce(s => moveFloat(s, float.id, x, y)) }}
|
||||
onResize={(w, h) => { store.reduce(s => resizeFloat(s, float.id, w, h)) }}
|
||||
onDock={(paneId) => { store.reduce(s => dockFloat(s, float.id, paneId ?? undefined)) }}
|
||||
onClose={() => { ctx.betterSidebar?.closeTab(float.tab.id, sessionId === undefined ? undefined : { sessionId, cwd }) }}
|
||||
onClose={() => { ctx.get('betterSidebar')?.closeTab(float.tab.id, sessionId === undefined ? undefined : { sessionId, cwd }) }}
|
||||
/>
|
||||
))}
|
||||
{/*
|
||||
|
||||
Reference in New Issue
Block a user