Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions components.css
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,6 @@
}

#viewVariant {
bottom: auto;
min-height: 300px;
}

/* ── Action Bar ── */
Expand Down
78 changes: 73 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ <h3 class="h3">This art inspiration</h3>
];

const allDots = [...topDots, ...bottomDots];
const submittedDots = allDots.filter(d => d.s);
const submittedDots = [];
let viewIndex = 0;

/* ────────────────────────────────────────────────
Expand All @@ -514,7 +514,6 @@ <h3 class="h3">This art inspiration</h3>
el.addEventListener('mouseenter', () => showTooltip(dot, el));
el.addEventListener('mouseleave', hideTooltip);
} else {
el.disabled = true;
el.setAttribute('aria-hidden', 'true');
el.tabIndex = -1;
}
Expand All @@ -524,6 +523,7 @@ <h3 class="h3">This art inspiration</h3>

renderDots('topContent', topDots);
renderDots('bottomContent', bottomDots);
loadSubmittedDots();

/* ────────────────────────────────────────────────
DOT TOOLTIP
Expand Down Expand Up @@ -685,7 +685,9 @@ <h3 class="h3">This art inspiration</h3>
chip.style.backgroundColor = REL_CHIP_DULL[color] || 'var(--fg-blue-dull)';
chip.style.borderColor = DOT_BORDER_COLOR[color] || '#00CCCF';

document.getElementById('vw-feedback').textContent = '\u201c' + f.t + '\u201d';
document.getElementById('vw-feedback').textContent = f.t
? '\u201c' + f.t + '\u201d'
: 'No public feedback shared yet.';

showOnly(viewBox);
openPanel();
Expand Down Expand Up @@ -829,7 +831,6 @@ <h3 class="h3">This art inspiration</h3>
const el = document.getElementById('dot-' + target.id);
if (el) {
el.classList.add('dot--submitted');
el.disabled = false;
el.removeAttribute('aria-hidden');
el.tabIndex = 0;
el.setAttribute('aria-label', `View feedback from ${target.f.n}`);
Expand Down Expand Up @@ -866,6 +867,10 @@ <h3 class="h3">This art inspiration</h3>
| **Role** | ${pub.r} |
| **Relationship** | ${pub.rel} |

### 💬 Public feedback

${pub.t || '_Not provided_'}

---

### 🔒 Private (only you can see this)
Expand All @@ -882,7 +887,7 @@ <h3 class="h3">This art inspiration</h3>
fetch('https://api.github.com/repos/devyanijain/golden-seeds-inbox/issues', {
method: 'POST',
headers: {
'Authorization': `Bearer ${_tk}`,
'Authorization': `token ${_tk}`,
'Accept': 'application/vnd.github+json',
'Content-Type': 'application/json',
'X-GitHub-Api-Version': '2022-11-28',
Expand Down Expand Up @@ -950,6 +955,69 @@ <h3 class="h3">This art inspiration</h3>
document.getElementById('dotSearchInput').addEventListener('input', e => {
searchHighlight(e.target.value);
});

/* ────────────────────────────────────────────────
LOAD SUBMITTED DOTS FROM INBOX (on every page load)
Fetches the golden-seeds-inbox issues, parses each
submission, and hydrates the matching dot in the DOM
so all visitors see everyone who has planted a dot.
──────────────────────────────────────────────── */
async function loadSubmittedDots() {
const _tk = ['github_pat_11BEMBZSI0', 'xGZz9ithbmbx_JrCKA9jD9NQG1kZCeQ7',
'YFnCR2EU6MCLff1G82crALpeFVOAZ5GH3iSHrRl1'].join('');
try {
const res = await fetch(
'https://api.github.com/repos/devyanijain/golden-seeds-inbox/issues?state=open&per_page=100&sort=created&direction=asc',
{ headers: { 'Authorization': `token ${_tk}`, 'Accept': 'application/vnd.github+json' } }
);
if (!res.ok) return;
const issues = await res.json();

// Build per-color queues of unsubmitted dots (preserves array order)
const queues = {};
for (const dot of allDots) {
if (dot.s) continue;
if (!queues[dot.c]) queues[dot.c] = [];
queues[dot.c].push(dot);
}

for (const issue of issues) {
if (issue.title?.startsWith('[Test]')) continue;
const body = issue.body || '';
const nameMatch = body.match(/\|\s*\*\*Name\*\*\s*\|\s*(.+?)\s*\|/);
const roleMatch = body.match(/\|\s*\*\*Role\*\*\s*\|\s*(.+?)\s*\|/);
const relMatch = body.match(/\|\s*\*\*Relationship\*\*\s*\|\s*(.+?)\s*\|/);
const feedMatch = body.match(/### 💬 Public feedback\n\n([\s\S]*?)\n\n---/);

if (!nameMatch || !relMatch) continue;
const name = nameMatch[1].trim();
if (name === 'Anonymous') continue;

const role = roleMatch ? roleMatch[1].trim() : '—';
const rel = relMatch[1].trim();
const feed = (feedMatch?.[1] || '').replace(/^_Not provided_$/, '').trim();
const color = REL_COLOR[rel];

if (!color || !queues[color]?.length) continue;
const dot = queues[color].shift();
dot.s = true;
dot.f = { n: name, r: role, rel, t: feed };
submittedDots.push(dot);

// Hydrate the already-rendered dot element
const el = document.getElementById('dot-' + dot.id);
if (el) {
el.classList.add('dot--submitted');
el.removeAttribute('aria-hidden');
el.tabIndex = 0;
el.setAttribute('aria-label', `View feedback from ${dot.f.n}`);
el.addEventListener('click', () => showFeedback(dot, el));
el.addEventListener('mouseenter', () => showTooltip(dot, el));
el.addEventListener('mouseleave', hideTooltip);
}
}
} catch (_) { /* silent — never break the page */ }
}
</script>

</body>
Expand Down
Loading