Remove unused Mini App conversations and expand UI
This commit is contained in:
@@ -350,7 +350,6 @@ const INDEX_HTML: &str = r#"<!doctype html>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<button id="refresh">Refresh</button>
|
||||
<button id="expand" class="secondary">Expand</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="nav" class="nav"></div>
|
||||
@@ -395,13 +394,15 @@ const INDEX_HTML: &str = r#"<!doctype html>
|
||||
{ id: "home", label: "Home" },
|
||||
{ id: "apps", label: "Apps" },
|
||||
{ id: "feed", label: "Feed" },
|
||||
{ id: "conversations", label: "Conversations" },
|
||||
{ id: "files", label: "Files" },
|
||||
];
|
||||
|
||||
function parseRoute() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
state.currentTab = params.get("tab") || "home";
|
||||
if (!NAV_TABS.some(tab => tab.id === state.currentTab)) {
|
||||
state.currentTab = "home";
|
||||
}
|
||||
state.selectedFeedId = params.get("feed");
|
||||
state.selectedAppId = params.get("app");
|
||||
state.feedTurnId = params.get("turn_id");
|
||||
@@ -481,7 +482,6 @@ const INDEX_HTML: &str = r#"<!doctype html>
|
||||
|
||||
async function authenticate() {
|
||||
tg?.ready?.();
|
||||
tg?.expand?.();
|
||||
const initData = tg?.initData || "";
|
||||
if (!initData) {
|
||||
throw new Error("This page must be opened from Telegram so the gateway can verify your identity.");
|
||||
@@ -684,15 +684,6 @@ const INDEX_HTML: &str = r#"<!doctype html>
|
||||
`;
|
||||
}
|
||||
|
||||
function renderConversations() {
|
||||
return `
|
||||
<div class="card">
|
||||
<h2>Conversations stay in Telegram</h2>
|
||||
<p class="muted">The Mini App is for outputs, apps, and previews. Use the Telegram chat itself for normal back-and-forth conversation with Claude.</p>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
function renderFiles() {
|
||||
const fileItems = state.feed.filter(item => item.file_name);
|
||||
if (!fileItems.length) {
|
||||
@@ -1070,9 +1061,6 @@ const INDEX_HTML: &str = r#"<!doctype html>
|
||||
case "feed":
|
||||
content = renderFeedList();
|
||||
break;
|
||||
case "conversations":
|
||||
content = renderConversations();
|
||||
break;
|
||||
case "files":
|
||||
content = renderFiles();
|
||||
break;
|
||||
@@ -1166,7 +1154,6 @@ const INDEX_HTML: &str = r#"<!doctype html>
|
||||
document.getElementById("refresh").addEventListener("click", () => {
|
||||
refreshData().catch(error => showToast(error.message));
|
||||
});
|
||||
document.getElementById("expand").addEventListener("click", () => tg?.expand?.());
|
||||
document.getElementById("admin-toggle").addEventListener("click", async () => {
|
||||
updateRoute({ admin: state.adminMode ? null : "1", app: null, feed: null });
|
||||
if (state.adminMode && !state.admin) {
|
||||
@@ -1328,7 +1315,7 @@ async fn bootstrap(
|
||||
Ok(Json(MiniAppBootstrapResponse {
|
||||
profile_id: session.profile_id,
|
||||
display_name: session.display_name,
|
||||
sections: vec!["home", "apps", "feed", "conversations", "files"],
|
||||
sections: vec!["home", "apps", "feed", "files"],
|
||||
admin_available: true,
|
||||
}))
|
||||
}
|
||||
@@ -1743,8 +1730,9 @@ mod tests {
|
||||
assert!(INDEX_HTML.contains("Home"));
|
||||
assert!(INDEX_HTML.contains("Apps"));
|
||||
assert!(INDEX_HTML.contains("Feed"));
|
||||
assert!(INDEX_HTML.contains("Conversations"));
|
||||
assert!(INDEX_HTML.contains("Files"));
|
||||
assert!(!INDEX_HTML.contains("Conversations"));
|
||||
assert!(!INDEX_HTML.contains(">Expand<"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user