Skip to content

Commit d268cea

Browse files
authored
Update tab visibility logic to show AI description only when no README is present (#2429)
1 parent 9ea4a40 commit d268cea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/ViewPackagePage/components/important-files-view.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,12 @@ export default function ImportantFilesView({
142142
const availableTabs = useMemo((): TabInfo[] => {
143143
const tabs: TabInfo[] = []
144144

145-
// Only show AI description tab if there's actual AI content
146-
if (hasAiContent) {
145+
const hasReadme = importantFiles.some((file) =>
146+
isReadmeFile(file.file_path),
147+
)
148+
149+
// Only show AI description tab if there's actual AI content and no README
150+
if (hasAiContent && !hasReadme) {
147151
tabs.push({
148152
type: "ai",
149153
filePath: null,

0 commit comments

Comments
 (0)