settings: About links the website, usemagpie.ai
About had Discord and GitHub but nothing pointing to usemagpie.ai (the
owner, with a screenshot). A Website row above Community names the
site and its Open opens it; en, zh, zh-TW, ja and de.
app.js grows 213 bytes (budgets 1,310,460 and 1,526,556, said in
core_budget_test.go), Settings' own row, with no room added.
Run at this head (origin/main + this):
- go test ./internal/gui/: ok.
- GUI, chromium + webkit: about-website (new, every language at 1100
and 420), i18n-keys, public-url-default, settings-sections, cli-path:
81 pass, 1 fail. The fail is i18n-keys "a plugin's words are its own"
on "Runs as", red on main since 7f827b3b0, filed as #3897.
- Broken by hand: without the row, about-website is red.
- Looked at in a zh dark screenshot of About.
Not run: the full GUI suite and go test ./...; not tried in the real
app.
This commit is contained in:
@@ -19615,6 +19615,9 @@ function renderSettings() {
|
||||
row(t("Gateway URL"), t("the address every agent is pointed at"), gw, copyBtn(gw, t("Gateway URL")));
|
||||
// MAGPIE_PUBLIC_URL, where other machines reach it (#1551)
|
||||
if (s.publicURL && gw !== s.publicURL) row(t("Public address"), t("MAGPIE_PUBLIC_URL: where other computers reach the gateway, with a gateway key"), s.publicURL, copyBtn(s.publicURL, t("Public address"))).id = "publicURLRow";
|
||||
const site = el("button", "text", t("Open"));
|
||||
site.onclick = () => api("open", { url: "https://usemagpie.ai" }).catch(() => {});
|
||||
row(t("Website"), t("downloads, docs and what's new"), "usemagpie.ai", site);
|
||||
const join = el("button", "discord");
|
||||
join.innerHTML = DISCORD_SVG;
|
||||
join.append(el("span", "", t("Join Discord")));
|
||||
|
||||
@@ -2532,7 +2532,7 @@ const I18N = {
|
||||
"Couldn't add the plugin {spec}: {error}": "无法添加插件 {spec}:{error}",
|
||||
"Library brought in and written into the agents": "资源库已导入,并已写入各 agent",
|
||||
"{agent} couldn't get {what}: {error}": "{agent} 未能写入 {what}:{error}",
|
||||
"Community": "社区", "questions, ideas and feedback, on Discord or GitHub": "提问、想法和反馈,Discord 或 GitHub 都可以", "Join Discord": "加入 Discord",
|
||||
"Website": "官网", "downloads, docs and what's new": "下载、文档和更新内容", "Community": "社区", "questions, ideas and feedback, on Discord or GitHub": "提问、想法和反馈,Discord 或 GitHub 都可以", "Join Discord": "加入 Discord",
|
||||
"Copy": "复制",
|
||||
"Copied": "已复制",
|
||||
"Region": "区域",
|
||||
@@ -6547,7 +6547,7 @@ const I18N = {
|
||||
"Couldn't add the plugin {spec}: {error}": "無法新增外掛 {spec}:{error}",
|
||||
"Library brought in and written into the agents": "資源庫已匯入,並已寫入各 agent",
|
||||
"{agent} couldn't get {what}: {error}": "{agent} 未能寫入 {what}:{error}",
|
||||
"Community": "社群",
|
||||
"Website": "官網", "downloads, docs and what's new": "下載、文件和更新內容", "Community": "社群",
|
||||
"questions, ideas and feedback, on Discord or GitHub": "提問、想法和反饋,Discord 或 GitHub 都可以",
|
||||
"Join Discord": "加入 Discord",
|
||||
"Copy": "複製",
|
||||
@@ -10562,7 +10562,7 @@ const I18N = {
|
||||
"Couldn't add the plugin {spec}: {error}": "プラグイン {spec} を追加できませんでした:{error}",
|
||||
"Library brought in and written into the agents": "ライブラリを取り込み、エージェントに書き込みました",
|
||||
"{agent} couldn't get {what}: {error}": "{agent} に {what} を書き込めませんでした:{error}",
|
||||
"Community": "コミュニティ",
|
||||
"Website": "公式サイト", "downloads, docs and what's new": "ダウンロード、ドキュメント、更新内容", "Community": "コミュニティ",
|
||||
"questions, ideas and feedback, on Discord or GitHub": "質問、アイデア、フィードバックは Discord または GitHub で",
|
||||
"Join Discord": "Discord に参加",
|
||||
"Copy": "コピー",
|
||||
@@ -14587,7 +14587,7 @@ const I18N = {
|
||||
"Couldn't add the plugin {spec}: {error}": "Die Erweiterung {spec} konnte nicht hinzugefügt werden: {error}",
|
||||
"Library brought in and written into the agents": "Bibliothek importiert und in die Agenten geschrieben",
|
||||
"{agent} couldn't get {what}: {error}": "{agent} konnte {what} nicht übernehmen: {error}",
|
||||
"Community": "Community",
|
||||
"Website": "Website", "downloads, docs and what's new": "Downloads, Dokumentation und Neuigkeiten", "Community": "Community",
|
||||
"questions, ideas and feedback, on Discord or GitHub": "Fragen, Ideen und Feedback auf Discord oder GitHub",
|
||||
"Join Discord": "Discord beitreten",
|
||||
"Copy": "Kopieren",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,39 @@
|
||||
const assert = require("node:assert/strict");
|
||||
const { test } = require("node:test");
|
||||
const { chromium, webkit } = require("playwright");
|
||||
const { fixture } = require("./fixtures/caller-keys.cjs");
|
||||
const { openPart } = require("./reader.cjs");
|
||||
|
||||
// Settings › About had Discord and GitHub but no link to usemagpie.ai (the
|
||||
// owner). Its Website row names the site and opens it, in every language and
|
||||
// at the tray panel's width.
|
||||
const words = {
|
||||
en: "Website", zh: "官网", "zh-TW": "官網", ja: "公式サイト", de: "Website",
|
||||
};
|
||||
|
||||
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
|
||||
for (const lang of Object.keys(words)) {
|
||||
for (const width of [1100, 420]) {
|
||||
test(`${engine} ${lang} ${width}: About links the website`, async (t) => {
|
||||
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
|
||||
t.after(() => browser.close());
|
||||
const page = await (await browser.newContext({ viewport: { width, height: 800 }, reducedMotion: "reduce" })).newPage();
|
||||
page.setDefaultTimeout(6000);
|
||||
const errors = [];
|
||||
page.on("pageerror", (e) => errors.push(e.message));
|
||||
await page.route("**/*", fixture(lang, "light", []));
|
||||
await page.goto("http://magpie.test/");
|
||||
await page.locator("#prefs").click();
|
||||
await openPart(page, "about");
|
||||
const row = page.locator("#about .row", { has: page.locator(".who", { hasText: words[lang] }) });
|
||||
await row.waitFor();
|
||||
assert.equal(await row.locator("code").textContent(), "usemagpie.ai");
|
||||
const opened = page.waitForRequest((r) => r.url().includes("/api/open"));
|
||||
await row.locator("button.text").click();
|
||||
assert.equal(JSON.parse((await opened).postData()).url, "https://usemagpie.ai");
|
||||
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), true, "About wider than the window");
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user