@@ -258,23 +368,33 @@ const { userId, communityId, compact = false } = Astro.props;
- ${allDelegations.map(d => `
-
- |
-
- ${d.direction === 'outgoing' ? '→ To' : '← From'}
-
- |
- ${d.delegate_username || d.delegator_username || 'Unknown'} |
- ${this.getScopeLabel(d.scope)} |
- ${((d.weight || 1) * 100).toFixed(0)}% |
-
-
- ${d.is_active ? 'Active' : 'Revoked'}
- |
- ${new Date(d.created_at).toLocaleDateString()} |
-
- `).join('')}
+ ${allDelegations.map(d => {
+ const direction = String(d.direction || '').toLowerCase();
+ const safeDirection = direction === 'outgoing' ? 'outgoing' : 'incoming';
+ const user = this.escapeHtml(d.delegate_username || d.delegator_username || 'Unknown');
+ const scope = this.escapeHtml(this.getScopeLabel(d.scope));
+ const weightPct = ((Number(d.weight) || 1) * 100).toFixed(0);
+ const statusLabel = d.is_active ? 'Active' : 'Revoked';
+ const dateLabel = d.created_at ? new Date(d.created_at).toLocaleDateString() : '';
+
+ return `
+
+ |
+
+ ${safeDirection === 'outgoing' ? '→ To' : '← From'}
+
+ |
+ ${user} |
+ ${scope} |
+ ${this.escapeHtml(weightPct)}% |
+
+
+ ${this.escapeHtml(statusLabel)}
+ |
+ ${this.escapeHtml(dateLabel)} |
+
+ `;
+ }).join('')}
`;
@@ -304,6 +424,87 @@ const { userId, communityId, compact = false } = Astro.props;
border: 1px solid var(--color-border);
}
+ .graph-content {
+ position: relative;
+ }
+
+ .inspector {
+ position: absolute;
+ right: 0.75rem;
+ bottom: 0.75rem;
+ width: min(360px, calc(100% - 1.5rem));
+ background: rgba(15, 23, 42, 0.92);
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ border-radius: 14px;
+ padding: 0.85rem;
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
+ backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
+ }
+
+ .inspector-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.75rem;
+ padding-bottom: 0.5rem;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.12);
+ margin-bottom: 0.6rem;
+ }
+
+ .inspector-title {
+ font-size: 0.8125rem;
+ letter-spacing: 0.02em;
+ text-transform: uppercase;
+ color: rgba(255, 255, 255, 0.75);
+ font-weight: 700;
+ }
+
+ .inspector-close {
+ appearance: none;
+ background: transparent;
+ border: 1px solid rgba(255, 255, 255, 0.18);
+ color: rgba(255, 255, 255, 0.85);
+ width: 28px;
+ height: 28px;
+ border-radius: 10px;
+ cursor: pointer;
+ line-height: 1;
+ }
+
+ .inspector-close:hover {
+ border-color: rgba(255, 255, 255, 0.28);
+ background: rgba(255, 255, 255, 0.08);
+ }
+
+ .inspector-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 0.6rem;
+ }
+
+ .inspector-kv {
+ background: rgba(255, 255, 255, 0.06);
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: 12px;
+ padding: 0.55rem 0.6rem;
+ }
+
+ .inspector-kv .k {
+ font-size: 0.7rem;
+ letter-spacing: 0.02em;
+ text-transform: uppercase;
+ color: rgba(255, 255, 255, 0.65);
+ margin-bottom: 0.15rem;
+ font-weight: 700;
+ }
+
+ .inspector-kv .v {
+ font-size: 0.875rem;
+ color: rgba(255, 255, 255, 0.92);
+ word-break: break-word;
+ }
+
.graph-header {
display: flex;
justify-content: space-between;
diff --git a/frontend/src/pages/delegations.astro b/frontend/src/pages/delegations.astro
index ec68f65..412106f 100644
--- a/frontend/src/pages/delegations.astro
+++ b/frontend/src/pages/delegations.astro
@@ -5,143 +5,226 @@ import DelegationGraph from '../components/voting/DelegationGraph.astro';
---
-
-
-
-
-
Please log in to manage delegations.
-
-
-
-
-
-
-
-
-
-
-
-
-
-