Skip to content

Refactor to D7460N architecture: separate structure from data#5

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/refactor-html-content-structure
Draft

Refactor to D7460N architecture: separate structure from data#5
Copilot wants to merge 5 commits intomainfrom
copilot/refactor-html-content-structure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 18, 2026

JSON files contained formulaic HTML structure in content fields. This couples presentation with data and prevents proper separation of concerns.

Changes

Structure → HTML

Created index.html at root with semantic custom elements as data targets:

<app-container>
  <header>
    <app-logo>🎭 EASTER Knowledge Base</app-logo>
  </header>
  <nav>
    <label>
      Introduction
      <input type="radio" name="nav" value="introduction" checked>
    </label>
    <!-- ... -->
  </nav>
  <main>
    <article>
      <app-document-list><ol></ol></app-document-list>
    </article>
  </main>
  <aside>
    <app-document-detail>
      <app-document-title></app-document-title>
      <app-document-content></app-document-content>
    </app-document-detail>
  </aside>
</app-container>

UI Logic → CSS

All state management via CSS using :checked, :has(), :empty:

/* Navigation state */
nav label:has(input:checked) {
  background: var(--color-primary);
  font-weight: 600;
}

/* Show aside when document loaded */
aside:has(app-document-title:not(:empty)) {
  display: block;
}

/* Holy Grail layout */
app-container {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(300px, 3fr) minmax(200px, 1fr);
  grid-template-rows: auto auto 1fr auto;
}

Data Transport → JS

Minimal JavaScript for CRUD only:

// Data fetch + inject, no UI logic
async function loadCategory(categoryName) {
  const response = await fetch(`./assets/data/${categoryName}.json`);
  const data = await response.json();
  
  // Inject into empty semantic tags
  document.querySelector('app-category-name').textContent = data.name;
  
  const list = document.querySelector('app-document-list ol');
  data.documents.forEach(doc => {
    const li = document.createElement('li');
    li.setAttribute('data-id', doc.id);
    // ... inject doc elements
    list.appendChild(li);
  });
}

Data Structure

JSON remains unchanged - content field still contains HTML for document bodies, but structural elements moved to index.html.

Architecture Adherence

  • ✅ HTML = structure (semantic custom elements, no classes/IDs)
  • ✅ CSS = all UI logic, layout, state (Grid, :checked, :has())
  • ✅ JS = data transport only (fetch, inject, oninput)
  • ✅ Zero dependencies, no inline styles/scripts
  • ✅ Progressive enhancement (structure exists without JS)

Screenshots

Category view with document list:
Roles Category

Document detail in aside:
Director Document


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 18, 2026 03:28
Co-authored-by: dragontheory <80736+dragontheory@users.noreply.github.com>
Co-authored-by: dragontheory <80736+dragontheory@users.noreply.github.com>
Co-authored-by: dragontheory <80736+dragontheory@users.noreply.github.com>
Co-authored-by: dragontheory <80736+dragontheory@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor index.html to use empty tags for dynamic content Refactor to D7460N architecture: separate structure from data Feb 18, 2026
Copilot AI requested a review from dragontheory February 18, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants