(segments: string[])
| 136 | } |
| 137 | |
| 138 | function describeFileReadTarget(segments: string[]): string { |
| 139 | const lastSegment = segments[segments.length - 1] || '' |
| 140 | const facetLabel = FILE_FACET_LABELS[lastSegment] |
| 141 | // Treat the suffix as a facet only when a real file name precedes it; otherwise |
| 142 | // the leaf is the file itself (e.g. a file literally named "content"). |
| 143 | if (facetLabel !== undefined && segments.length > 2) { |
| 144 | const fileName = segments[segments.length - 2] |
| 145 | return facetLabel ? `${facetLabel} ${fileName}` : fileName |
| 146 | } |
| 147 | // Show just the file name, not the folder path — these are glanceable status |
| 148 | // lines, and the other resource types already render the leaf only. |
| 149 | return lastSegment |
| 150 | } |
| 151 | |
| 152 | function getLeafResourceSegment(segments: string[]): string { |
| 153 | const lastSegment = segments[segments.length - 1] || '' |
no outgoing calls
no test coverage detected