فهرست منبع

fix(tui): clarify saved permission copy

Kit Langton 1 هفته پیش
والد
کامیت
8cb7f49183
2فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 3 3
      packages/tui/src/util/permission.ts
  2. 2 2
      packages/tui/test/mini/permission.shared.test.ts

+ 3 - 3
packages/tui/src/util/permission.ts

@@ -154,14 +154,14 @@ function wildcardDirectory(value: string) {
 export function permissionAlwaysLines(input: { action: string; save?: ReadonlyArray<string> }): string[] {
   const save = input.save ?? []
   if (save.length === 1 && save[0] === "*") {
-    return [`This will allow ${input.action} until OpenCode is restarted.`]
+    return [`This will always allow ${input.action} for this project.`]
   }
-  return ["This will allow the following patterns until OpenCode is restarted.", ...save.map((item) => `- ${item}`)]
+  return ["This will always allow the following patterns for this project.", ...save.map((item) => `- ${item}`)]
 }
 
 export function permissionOptionLabel(option: "once" | "always" | "reject" | "confirm" | "cancel") {
   if (option === "once") return "Allow once"
-  if (option === "always") return "Allow always"
+  if (option === "always") return "Always allow"
   if (option === "reject") return "Reject"
   if (option === "confirm") return "Confirm"
   return "Cancel"

+ 2 - 2
packages/tui/test/mini/permission.shared.test.ts

@@ -183,11 +183,11 @@ describe("run permission shared", () => {
 
   test("formats always-allow copy for wildcard and explicit patterns", () => {
     expect(permissionAlwaysLines(req({ action: "bash", save: ["*"] }))).toEqual([
-      "This will allow bash until OpenCode is restarted.",
+      "This will always allow bash for this project.",
     ])
 
     expect(permissionAlwaysLines(req({ save: ["src/**/*.ts", "src/**/*.tsx"] }))).toEqual([
-      "This will allow the following patterns until OpenCode is restarted.",
+      "This will always allow the following patterns for this project.",
       "- src/**/*.ts",
       "- src/**/*.tsx",
     ])