Skip to content

Commit b56cb59

Browse files
DeusDatararepops
andcommitted
fix(graph-ui): label Project name honestly as permanent ID
The New Index modal presented the project name as an optional display name, but the value becomes permanent identity: the database filename, the projects primary key, and the QN prefix of every node. It can never be renamed afterwards. Implements the decision from the DeusData#805 review: keep the field, make it honest. The label now reads "Project ID (optional — permanent, cannot be renamed)", the placeholder and a new help line explain that the ID becomes the database name and query prefix and that leaving it blank derives it from the path. Both EN and zh locales updated, test asserting the old label adjusted. Co-authored-by: rarepops <rarepops@protonmail.com> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 9871e7e commit b56cb59

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎graph-ui/src/components/StatsTab.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe("StatsTab index modal", () => {
6565
fireEvent.change(await screen.findByLabelText("Repository path"), {
6666
target: { value: "D:\\work\\信租风控通后端" },
6767
});
68-
fireEvent.change(screen.getByLabelText("Project name"), {
68+
fireEvent.change(screen.getByLabelText("Project ID (optional — permanent, cannot be renamed)"), {
6969
target: { value: "信租风控通后端" },
7070
});
7171
fireEvent.click(screen.getByRole("button", { name: "Index This Folder" }));

‎graph-ui/src/components/StatsTab.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ function CreateIndexModal({ onClose, onCreated }: { onClose: () => void; onCreat
269269
onChange={(e) => setProjectName(e.target.value)}
270270
className="w-full bg-white/[0.04] border border-white/[0.06] rounded-lg px-3 py-2 text-[12px] text-foreground outline-none focus:border-primary/40 placeholder:text-foreground/20"
271271
/>
272+
<span className="block text-[10px] text-foreground/25 mt-1">{t.index.projectNameHelp}</span>
272273
</label>
273274
</div>
274275

‎graph-ui/src/lib/i18n.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ export const messages = {
4545
selectRepositoryFolder: "Select Repository Folder",
4646
instructions: "Navigate to the project root and click \"Index This Folder\".",
4747
repositoryPath: "Repository path",
48-
projectName: "Project name",
49-
projectNamePlaceholder: "Optional display name",
48+
projectName: "Project ID (optional — permanent, cannot be renamed)",
49+
projectNamePlaceholder: "Derived from folder name if blank",
50+
projectNameHelp: "Becomes the database name and query prefix. Leave blank to derive it from the path.",
5051
filterFolders: "Filter folders",
5152
noSubdirectories: "No subdirectories",
5253
indexThisFolder: "Index This Folder",
@@ -116,8 +117,9 @@ export const messages = {
116117
selectRepositoryFolder: "选择仓库目录",
117118
instructions: "导航到项目根目录,然后点击“索引此目录”。",
118119
repositoryPath: "仓库路径",
119-
projectName: "项目名称",
120-
projectNamePlaceholder: "可选显示名称",
120+
projectName: "项目 ID(可选,永久且不可重命名)",
121+
projectNamePlaceholder: "留空则从路径派生",
122+
projectNameHelp: "将作为数据库名称与查询前缀;留空则从路径派生。",
121123
filterFolders: "筛选目录",
122124
noSubdirectories: "没有子目录",
123125
indexThisFolder: "索引此目录",

0 commit comments

Comments
 (0)