section

taskGroup

Wire value: "taskGroup"

Appears on: Documentation Topic

1. How swift-docc-render consumes this

A grep of src/components/ and src/views/ for the literal string "taskGroup" finds nothing — this kind never appears as a wire-level discriminator that swift-docc-render switches on. Instead, a grep for topicSections (the RenderNode field that holds an array of taskGroup objects) turns up exactly two consuming files: DocumentationTopic.vue#L137-L143 and the shared Topics.vue/TopicsTable.vue pair it delegates to. The same shape is reused, unconditionally, for two sibling RenderNode fields — defaultImplementationsSections and seeAlsoSections (DocumentationTopic.vue#L144-L160) — because all three RenderNode fields are typed as an array of the identical title/abstract/discussion/identifiers/generated/anchor object; swift-docc's own name for that payload type is TaskGroupRenderSection, and its wire form has no kind discriminator field at all (see Section 3).

DocumentationTopic.vue (the top-level component for API/symbol reference pages) passes topicSections straight into <Topics>:

<Topics
  v-if="shouldRenderTopicSection"
  :sections="topicSections"
  :isSymbolDeprecated="isSymbolDeprecated"
  :isSymbolBeta="isSymbolBeta"
  :topicStyle="topicSectionsStyle"
/>

(DocumentationTopic.vue#L137-L143.) DocumentationTopic/Topics.vue#L11-L20 is a thin wrapper that just forwards sections/topicStyle straight through to <TopicsTable>, which is where each individual taskGroup entry is actually unpacked and rendered:

<ContentTableSection
  v-for="(section, i) in sectionsWithTopics"
  :key="`${section.title}_${i}`"
  :title="section.title"
  :anchor="section.anchor"
  :class="{ 'no-title': !section.title }"
>
  ...
  <template v-if="section.abstract" #abstract>
    <ContentNode :content="section.abstract" />
  </template>
  <template v-if="section.discussion" #discussion>
    <ContentNode :content="section.discussion.content" />
  </template>
  <template v-if="shouldRenderList">
    <TopicsLinkBlock v-for="topic in section.topics" ... />
  </template>
  <TopicsLinkCardGrid v-else :items="section.topics" :topicStyle="topicStyle" class="topic" />
</ContentTableSection>

(DocumentationTopic/TopicsTable.vue#L11-L51.) The computed property sectionsWithTopics is what resolves each taskGroup object's raw identifiers array of topic-reference URLs into full reference objects, by looking each one up in the page-level references map (a mixin, referencesProvider):

sectionsWithTopics() {
  return this.sections.map(section => ({
    ...section,
    topics: section.identifiers.reduce(
      (list, id) => (this.references[id] ? list.concat(this.references[id]) : list),
      [],
    ),
  }));
},

(TopicsTable.vue#L110-L118.) Depending on topicStyle (a sibling RenderNode field, topicSectionsStyle, one of list/compactGrid/detailedGrid/hidden), each resolved topic renders either as a TopicsLinkBlock row (TopicsLinkBlock.vue#L11-L27) or as a card inside TopicsLinkCardGrid. The outer chrome (section title, top border, spacing) comes from ContentTable.vue (ContentTable.vue#L11-L18) and ContentTableSection.vue (ContentTableSection.vue#L11-L29), one ContentTable per RenderNode field and one ContentTableSection per taskGroup entry within it.

The exact same TopicsTable.vue component (minus the list/grid style toggle) is reused verbatim by SeeAlso.vue (SeeAlso.vue#L11-L19, title "See Also") and by DefaultImplementations.vue (DefaultImplementations.vue#L11-L19, title "Default Implementations") — confirming that from swift-docc-render's point of view, "Topics", "See Also", and "Default Implementations" are three independent RenderNode array fields holding the identical taskGroup item shape, not three different render kinds.

See also: The references map — how this and every other reference-dictionary lookup works across kinds.

2. Example JSON and rendered mockup

Fixture source: Tests/DocCArchiveTests/Fixtures/SampleLibrary.doccarchive/data/documentation/samplelibrary.json, the module-root RenderNode's topicSections array (three automatically-curated groups — Classes, Structures, Enumerations). This is a real, DocC-emitted example, unmodified except for truncation.

{
  "topicSections": [
    {
      "anchor": "Classes",
      "generated": true,
      "identifiers": [
        "doc://SampleLibrary/documentation/SampleLibrary/SampleActor",
        "doc://SampleLibrary/documentation/SampleLibrary/SampleClass"
      ],
      "title": "Classes"
    },
    {
      "anchor": "Structures",
      "generated": true,
      "identifiers": [
        "doc://SampleLibrary/documentation/SampleLibrary/SampleStruct"
      ],
      "title": "Structures"
    },
    {
      "anchor": "Enumerations",
      "generated": true,
      "identifiers": [
        "doc://SampleLibrary/documentation/SampleLibrary/SampleError"
      ],
      "title": "Enumerations"
    }
  ]
}

None of the fixtures under Tests/DocCArchiveTests/Fixtures/ happen to contain an authored task group (one with a populated abstract or discussion field, or "generated": false) — every taskGroup entry across both archives is an automatic curation group like the one above. The abstract/discussion fields in the data sheet below are documented from the vendored schema and swift-docc's Swift model (Section 3), not from a fixture, since no fixture exercises them.

Topics
Classes
Structures
Enumerations

mockup: one section.contenttable (the "Topics" content-table, titled from MainContentSectionAnchors.topics) contains one div.contenttable-section per taskGroup entry; each section's own title becomes an <h3> heading (anchored via section.anchor) and its resolved identifiers render as a list of TopicsLinkBlock rows, one per topic link, in topicStyle: "list" (the default). "See Also" and "Default Implementations" render identically, just as separate content tables lower on the page.

3. Data sheet

Source: Sources/DocCArchive/Vendored/RenderNode.spec.json, schema object #/components/schemas/TasksGroupSection (note the schema's own name differs from both the wire discriminator string "taskGroup" used in swift-docc's RenderSectionKind enum and from swift-docc's Swift type name TaskGroupRenderSection — see the naming note below the table), cross-checked against Components.Schemas.TasksGroupSection in Sources/DocCArchive/generated/Types.swift (lines 6301–6347). This schema is referenced from three sibling fields on DocumentationRenderNode: topicSections, seeAlsoSections, and defaultImplementationsSections (spec lines 2111–2128; generated lines 5367, 5369, 5371).

FieldTypeRequiredEnum values / defaultNote
kind — not present on the wire — Unlike most RenderSectionKind cases, TaskGroupRenderSection declares public let kind: RenderSectionKind = .taskGroup in Swift but its CodingKeys enum (swift-docc, TaskGroupRenderSection.swift lines 60–62) deliberately omits kind, so the JSON never carries a "kind": "taskGroup" field. The vendored TasksGroupSection schema matches this: it has no kind property at all. A consumer can only tell which RenderNode field a given taskGroup object came from by which array (topicSections / seeAlsoSections / defaultImplementationsSections) it was found in.
title string no — The task group's heading, e.g. "Classes" or an author-written ## Getting Started heading. Absent for the single unnamed catch-all group DocC sometimes emits.
abstract array of RenderInlineContent no — The first paragraph of authored prose under the group's heading, if any. Never populated for automatically-curated groups (generated: true).
discussion ContentRenderSection (vendored schema) / any RenderSection (swift-docc, in practice a ContentRenderSection) no — Additional authored prose after the abstract and before the link list, wrapped in its own nested render-section object (accessed in swift-docc-render as section.discussion.content).
identifiers array of string yes — Topic-graph reference identifiers (URLs in the doc:// scheme, or resolved external URLs) for the symbols/articles curated into this group. swift-docc-render resolves each one against the RenderNode's top-level references map before display.
generated boolean no (generated schema field is optional; swift-docc always emits it as false when omitted) default false Encoded only when true (swift-docc's encode(to:) uses if generated { try container.encode(...) }) — true marks a group DocC synthesized automatically (e.g. grouping all classes together) rather than one an author wrote under a ## Topics heading.
anchor string no defaults to a URL-readable slug of title Used as the deep-link fragment for the group's heading; swift-docc computes it via title.map(urlReadableFragment) when not explicitly supplied.

4. HTML/CSS mapping in DocC-Render output

Rendered DOM, outer to inner, for the "Topics" content table (identical structure for "See Also" and "Default Implementations", just with a different outer title/anchor):

SCSS files involved: ContentTable.vue, ContentTableSection.vue, and TopicsTable.vue each carry their own <style scoped lang="scss"> block, all importing the shared src/styles/_core.scss for the breakpoint() mixin and the spacing variables noted above. CSS custom properties consumed include --color-grid (the content-table's top border color, set on ContentTable.vue's .title) and --content-table-title-border-width (theme override for that border's width, default 1px).

DocCArchive transform status: not yet implemented. MyHTMLTransformer and MyMarkdownTransformer in Sources/DocCArchive/DocCArchive.swift are still stub placeholders — the HTML transformer returns a hardcoded comment regardless of input and the Markdown transformer returns an empty string — so there is no code path today that walks a RenderNode's topicSections/seeAlsoSections/defaultImplementationsSections arrays into a "Topics" heading plus a link list in either output format.

5. Modern CSS-only alternative

NOT APPLICABLE

Current behavior in play: rendering a taskGroup entry is a one-time, non-interactive template computation. TopicsTable.vue's sectionsWithTopics computed property (TopicsTable.vue#L110-L118) runs once per render pass to resolve identifiers against the page's reference map, and the v-for loops over groups and topics are ordinary static list rendering — there is no component-local mutable state being toggled, no click handler, and no later state transition (unlike, say, a tab navigator whose visible pane changes after mount). The only "dynamic" aspect — shouldRenderList switching between the TopicsLinkBlock list layout and the TopicsLinkCardGrid card layout — is resolved once from the RenderNode's own topicSectionsStyle field at render time, not from user interaction. Because there is no interactive/stateful behavior here to replace, none of <details>/<summary>, radio+:checked, :target, the Popover API, <dialog>, :has(), container queries, CSS anchor positioning, or view-transitions has anything to hold on this kind's behalf; a static server-rendered HTML document with the same nested-list/heading structure would be behaviorally identical. (The per-group deep-link anchor, e.g. #Classes, is already just a plain HTML id attribute plus a same-page fragment link — ordinary browser navigation, not JS-held state.)