Skip to content

index.html の更新#747

Open
chi20253032 wants to merge 3 commits intomindcraft-bots:developfrom
chi20253032:develop
Open

index.html の更新#747
chi20253032 wants to merge 3 commits intomindcraft-bots:developfrom
chi20253032:develop

Conversation

@chi20253032
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR rewrites src/mindcraft/public/index.html, aiming to modernize the Mindcraft web dashboard UI with theming and multi-language support.

Changes:

  • Replaced the previous dashboard layout/styles with a new “card/grid” UI, sticky header, fixed footer, and toast styling.
  • Added language selection + theme toggle with persistence via localStorage.
  • Removed most of the prior client-side functionality (agent rendering, create-agent flow, settings modals, and live state subscriptions).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mindcraft/public/index.html Outdated
Comment on lines 225 to 227
socket.on('connect', () => updateStatus(true));
socket.on('disconnect', () => updateStatus(false));

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dashboard no longer subscribes to agent updates: there’s no socket.emit('listen-to-agents') on connect and no handlers for agents-status / state-update. As a result, #agents will never render and #noAgents will never be updated, effectively breaking the UI. Reintroduce the subscription and rendering logic (or equivalent) tied to these existing server events.

Copilot uses AI. Check for mistakes.
Comment thread src/mindcraft/public/index.html Outdated
</div>
</div>
<footer class="footer">
<div><button id="openCreateAgentBtn"><span data-lang="en">➕ New Agent</span></button></div>
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openCreateAgentBtn is still rendered, but the Create Agent modal and all related JS (fetching /settings_spec.json, profile upload, emitting create-agent, etc.) were removed. This leaves a dead control and removes the ability to create agents from the web UI even though the server still supports create-agent. Either restore the create-agent flow or remove the button to avoid a broken UX.

Suggested change
<div><button id="openCreateAgentBtn"><span data-lang="en">➕ New Agent</span></button></div>

Copilot uses AI. Check for mistakes.
Comment thread src/mindcraft/public/index.html Outdated
function updateStatus(connected) {
const statusEl = document.getElementById('msStatus');
statusEl.classList.remove('offline', 'online');
statusEl.classList.add(connected ? 'online' : 'offline');
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateStatus() only toggles the online/offline classes but never updates the status text, and the markup hard-codes every language string as “Offline”. After a successful connect the badge will still say “Offline”. Consider updating the visible [data-lang] span text (or swapping between separate online/offline spans) when connection state changes.

Suggested change
statusEl.classList.add(connected ? 'online' : 'offline');
statusEl.classList.add(connected ? 'online' : 'offline');
// Update visible status text for all localized spans within the status element
const statusText = connected ? 'Online' : 'Offline';
const localizedSpans = statusEl.querySelectorAll('[data-lang]');
if (localizedSpans.length > 0) {
localizedSpans.forEach(span => {
span.textContent = statusText;
});
} else {
statusEl.textContent = statusText;
}

Copilot uses AI. Check for mistakes.
Comment thread src/mindcraft/public/index.html Outdated
}
.status-badge.online { color: var(--success); border-color: var(--success); }
.status-badge.offline { color: var(--danger); border-color: var(--danger); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; animation: pulse 2s infinite; }
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.status-dot has size/animation but no background-color, so it will likely be invisible. If the intent is a colored status indicator, set background (e.g., currentColor) and/or override it in .status-badge.online/.offline.

Suggested change
.status-dot { width: 8px; height: 8px; border-radius: 50%; animation: pulse 2s infinite; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }

Copilot uses AI. Check for mistakes.
Comment thread src/mindcraft/public/index.html Outdated
Comment on lines +101 to +103
<body data-theme="dark">
<header class="header">
<div class="header-title">
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theme initialization is inconsistent: <body data-theme="dark"> sets a data-theme attribute on body, but the CSS and setTheme() both use html[data-theme]. This body attribute is unused and can be misleading; consider removing it or switching to a single source of truth.

Copilot uses AI. Check for mistakes.
Comment thread src/mindcraft/public/index.html Outdated
<span data-lang="id" style="display:none;">Offline</span>
<span data-lang="uk" style="display:none;">Автономний</span>
<span data-lang="cs" style="display:none;">Offline</span>
<span data-lang="el" style="display:none;">Σύνδεση</span>
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greek translation for the offline status appears incorrect: Σύνδεση means “connection/connected”, not “offline”. If this badge is meant to indicate offline, use the appropriate Greek phrase (e.g., “Εκτός σύνδεσης”).

Suggested change
<span data-lang="el" style="display:none;">Σύνδεση</span>
<span data-lang="el" style="display:none;">Εκτός σύνδεσης</span>

Copilot uses AI. Check for mistakes.
Comment thread src/mindcraft/public/index.html Outdated
.modal-backdrop.active { display: flex; }
.modal { background: var(--bg-surface); border-radius: 12px; width: 90vw; max-width: 600px; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); padding: 20px; }
[data-lang] { display: none; }
[data-lang="en"] { display: auto; }
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS uses display: auto for language toggling ([data-lang="en"] { display: auto; }), but auto is not a valid value for display. Because [data-lang] { display: none; } hides everything, this rule won’t re-enable English content. Use a valid display value (e.g., inline/block) or toggle a class/hidden attribute instead.

Suggested change
[data-lang="en"] { display: auto; }
[data-lang="en"] { display: inline; }

Copilot uses AI. Check for mistakes.
Comment thread src/mindcraft/public/index.html Outdated
currentLang = lang;
localStorage.setItem('mindcraft-lang', lang);
document.querySelectorAll('[data-lang]').forEach(el => {
el.style.display = el.getAttribute('data-lang') === lang ? 'auto' : 'none';
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setLanguage() assigns el.style.display = 'auto', but auto is not a valid display value. For elements that start with style="display:none", setting an invalid value can leave them hidden, so language switching won’t work. Set to a valid value (e.g., '', inline, block) or use hidden/CSS classes for toggling.

Suggested change
el.style.display = el.getAttribute('data-lang') === lang ? 'auto' : 'none';
el.style.display = el.getAttribute('data-lang') === lang ? '' : 'none';

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正しました。

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