fix(native): offer one "Files" row in the new-tab list

The editor type's page identity IS the `files` kind takeover (same
explorer, same title), so the guide/new-tab list showed two identical
"Files" entries — observed on a real profile after the takeover landed.
The editor type now contributes no guide entry of its own; it stays
registered as the file RESOURCE viewer. Covered by the registration
lifecycle test (editor: no guide, files takeover: guide).
This commit is contained in:
Menghuan1918
2026-09-09 15:06:31 +08:00
parent 4da2b43610
commit b56ceec41d
2 changed files with 14 additions and 4 deletions
+5 -1
View File
@@ -160,7 +160,11 @@ export function registerNativeSurface(deps: NativeSurfaceDeps): () => void {
// A resource tab is titled by the file it shows; a page tab keeps the
// descriptor's own title.
title: (address: string) => (isEditor ? fileTitleOf(address) ?? titleOf(descriptor) : titleOf(descriptor)),
...(descriptor.hidden === true
// No guide entry for the editor: its page identity is the `files`
// kind takeover below (same view, same title), so listing both would
// offer the reader two identical "Files" rows. The type itself stays
// registered as the file RESOURCE viewer.
...(descriptor.hidden === true || isEditor
? {}
: {
guide: [{