Skip to content

Commit 9213698

Browse files
committed
Fix API Collection icon rendering in documentation
Adds the missing .collectionGroup case in renderKindAndRole function to ensure API Collections render as articles with collectionGroup role for correct icon display. Removes temporary test skip to enable validation of the fix. rdar://135837611
1 parent 55266b8 commit 9213698

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Sources/SwiftDocC/Model/Rendering/DocumentationContentRenderer.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ public class DocumentationContentRenderer {
264264
return (.section, role)
265265
case .sampleCode:
266266
return (.article, role)
267+
268+
case .collectionGroup:
269+
return (.article, role)
267270
case _ where kind.isSymbol:
268271
return (.symbol, role)
269272

Tests/SwiftDocCTests/Rendering/DocumentationContentRendererTests.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,9 @@ class DocumentationContentRendererTests: XCTestCase {
133133
}
134134

135135
func testRenderKindAndRoleForAPICollection() throws {
136-
throw XCTSkip("TDD: Temporarily disabled while implementing API Collection icon fix")
137-
138136
// API Collections should render as articles with collectionGroup role to display correct icon
139137
let (collectionKind, collectionRole) = DocumentationContentRenderer.renderKindAndRole(.collectionGroup, semantic: nil)
140-
XCTAssertEqual(collectionKind, RenderNode.Kind.article, "API Collections should render as articles, not symbols")
138+
XCTAssertEqual(collectionKind, RenderNode.Kind.article, "API Collections should render as articles")
141139
XCTAssertEqual(collectionRole, "collectionGroup", "API Collections should have collectionGroup role for correct icon")
142140

143141
// Verify other node types still work correctly

0 commit comments

Comments
 (0)