Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/release-notes/v0.1.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
本次更新新增双向亲属称呼查询,修复人物搜索排序与家谱树定位,并将 Android 底部导航改为左侧滑出菜单。

## 查称呼

- 新增独立“查称呼”页面,选择两个人物后,同时查看双方如何称呼对方,并展示关系路径;支持交换人物。
- 人物详情和家谱树人物预览增加“查称呼”快捷入口,自动带入当前人物。
- 支持爸爸、妈妈、爷爷、奶奶等日常称呼,以及较复杂的亲属关系。长幼不明时使用合称,不猜测年龄顺序;收养、继亲、监护、离异等关系保留说明。
- 人物选择支持姓名和别名搜索、键盘操作及窄屏布局。资料不足、没有关联或选择同一人物时提供明确反馈。
- 全部称呼计算在本地完成,不写入或修改家谱资料。

## 搜索与家谱树

- 家谱树和人物档案优先展示姓名最匹配的人物,同等匹配下主姓名优先于别名;排序在分页前完成。
- 家谱树搜索结果支持点击、方向键和 Enter 定位,并高亮匹配人物;搜索保留当前缩放和平移。
- 移除遮挡家谱画布的“人物与称呼”浮层,保留人物卡片上的称呼。
- 修复人物预览区操作按钮的对齐,统一按钮尺寸和间距。

## Android 与移动端导航

- 移除底部 Tab,改用左侧滑出菜单;Android 横屏同样使用侧边菜单。
- 支持顶部菜单按钮或左侧边缘右滑打开,点击遮罩、左滑或返回键关闭。
- 修复菜单操作影响页面返回路径的问题,补充键盘焦点管理、无障碍语义和安全区适配。

## 版本与安装

- 桌面端、共享核心与 CLI 统一为 `0.1.7`,CLI Contract 保持 `3`;Android APK 的 `versionName` 为 `0.1.7`,`versionCode` 为 `1007`。
- 本次更新不修改家谱数据格式或数据库 Schema。
- 发布产物包括已签名的 Android arm64 Release APK,以及 Windows x64、macOS Apple Silicon / Intel、Linux x64 桌面安装包。桌面安装包内置匹配版本的 CLI 与 Skill,可从“AI 工具”页面安装或更新;暂不提供 iOS 安装包。
- Android 正式版升级使用相同签名密钥。Debug 与 Release 签名不同,同包名时不能互相覆盖安装。

### macOS

macOS 安装包使用 ad-hoc 签名,尚未经过 Apple Developer ID 签名和公证。从本项目官方 Release 下载并将“有谱”拖入“应用程序”后,若系统提示“App 已损坏”或无法验证开发者,可执行:

```bash
xattr -dr com.apple.quarantine "/Applications/有谱.app"
open "/Applications/有谱.app"
```

以上命令仅移除“有谱”的下载隔离标记,不会关闭系统的全局 Gatekeeper。Windows 安装包目前也未进行商业代码签名,安装时可能显示安全提醒。

## 已知限制

重复人物合并、项目清理和历史快照恢复尚未接入共享 Rust 核心,当前会拒绝这些操作。本版本未改变这一限制。

[查看完整改动](https://github.com/tenlee2012/branchloom/compare/v0.1.6...v0.1.7)
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ members = [
resolver = "2"

[workspace.package]
version = "0.1.6"
version = "0.1.7"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ Android 端目前不提供 CLI、Codex Skill 安装或“AI 工具”页面。
- 记录人物的多种姓名、生卒信息、生平、职业、称谓、备注和头像。
- 整理亲生、收养、继亲、监护,以及婚姻、订婚、事实伴侣、分居、离异等关系。
- 从家谱树、人物列表和时间线浏览家庭资料。
- Android 和窄屏界面通过左侧滑出菜单切换页面:点击顶部菜单按钮或从左边缘右滑打开,点击遮罩、左滑或返回关闭;底部不再显示导航标签栏。
- 家谱树与人物档案搜索默认优先展示姓名完全匹配的人物,其次为姓名开头、姓名包含匹配,最后为生平、备注等其他资料匹配;同等匹配下主姓名优先于别名。排序在分页前完成,人物档案仍可手动按最近更新或出生时间排序。
- 桌面家谱树支持部分姓名、字号搜索,高亮匹配人物并点击定位;选中人物后,在家谱卡片上查看其对其他人物的日常称呼,如爸爸、妈妈、爷爷、奶奶、太奶奶。长幼不明时保留“兄弟”“姐妹”等合称;上四代及更远的直系祖辈显示“老祖宗”及代数。称呼仅根据已载入资料的最短关系路径计算,收养、继亲、监护、已结束的伴侣关系及信息不足的情况保留关系说明,不写入家谱资料。
- 管理地点、家庭事件、史料来源、引文与本地附件。
- 在“查称呼”页面搜索并选择当前项目中的任意两个人物,自动查看双向日常称呼、交换人物及查看最短关系路径;人物详情和家谱树人物预览提供预填当前人物的快捷入口。查询独立于画布显示代数,按当前项目的完整人物与关系资料推算,支持桌面与手机布局;资料缺失或读取失败时明确提示,不将称呼写入家谱资料。

### 核对、备份与迁移

Expand Down
29 changes: 27 additions & 2 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,33 @@ The desktop application uses:

Branchloom does not relicense `elkjs`. Recipients may obtain its source and license from the upstream project above.

## Release requirement
## Kinship calculator

The family tree's local kinship calculator uses `relationship.js` 1.2.9
([source](https://github.com/mumuy/relationship)) under the MIT License:

> Copyright (c) 2016 Haole Zheng
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.

## Release inventory

Before publishing a binary release, generate and review a complete third-party license inventory from the exact npm and Cargo lockfiles used for that release. Include all required license texts, copyright notices, attributions, and source-availability statements with the distributed application or installer.

This file highlights a dependency with reciprocal redistribution requirements; it is not a substitute for the complete per-release inventory.
This file highlights selected runtime dependencies; it is not a substitute for the complete per-release inventory.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"cytoscape-elk": "2.3.0",
"elkjs": "0.11.1",
"pinia": "4.0.2",
"relationship.js": "1.2.9",
"vue": "3.5.40",
"vue-router": "5.2.0"
},
Expand Down
23 changes: 14 additions & 9 deletions packages/desktop/e2e/app-smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test'
import { resetDemo } from './helpers/demo'
import { openProjectMenu, resetDemo } from './helpers/demo'

test.beforeEach(async ({ page }) => resetDemo(page))

Expand Down Expand Up @@ -63,11 +63,16 @@ for (const viewport of [{ width: 1280, height: 900 }, { width: 390, height: 844

test('mobile project navigation reaches sync and switches back after creating a project', async ({ page }, testInfo) => {
await page.setViewportSize({ width: 390, height: 844 })
const mobileNavigation = page.getByRole('navigation', { name: '移动端项目导航' })
const openOverview = async () => {
const menu = await openProjectMenu(page)
await menu.getByRole('link', { name: '项目管理', exact: true }).click()
await expect(menu).toHaveCount(0)
}
const assertShell = async (hasRefresh = true) => {
await expect(page.locator('.app-topbar')).toBeVisible()
await expect(mobileNavigation).toBeVisible()
await expect(page.getByRole('navigation', { name: '项目导航', exact: true })).toBeHidden()
await expect(page.getByRole('button', { name: '打开菜单', exact: true })).toBeVisible()
await expect(page.getByRole('dialog', { name: '项目菜单' })).toHaveCount(0)
await expect(page.getByRole('navigation', { name: '项目导航', exact: true })).toHaveCount(0)
if (hasRefresh) {
await expect(page.getByRole('button', { name: '刷新资料' })).toBeVisible()
} else {
Expand All @@ -76,7 +81,7 @@ test('mobile project navigation reaches sync and switches back after creating a
expect(await page.locator('html').evaluate((element) => element.scrollWidth)).toBeLessThanOrEqual(390)
}
await assertShell()
await mobileNavigation.getByRole('link', { name: '项目', exact: true }).click()
await openOverview()
await expect(page).toHaveURL('/project/project-demo-family/manage/overview')
await assertShell(false)
await page.screenshot({ path: testInfo.outputPath('mobile-project-overview.png') })
Expand All @@ -88,14 +93,14 @@ test('mobile project navigation reaches sync and switches back after creating a
await expect(page.getByRole('heading', { name: '协作同步', exact: true })).toBeVisible()
await assertShell()

await mobileNavigation.getByRole('link', { name: '项目', exact: true }).click()
await openOverview()
await page.getByRole('link', { name: '打开项目设置' }).click()
await assertShell()
await mobileNavigation.getByRole('link', { name: '项目', exact: true }).click()
await openOverview()
await page.locator('.project-overview').getByRole('link', { name: '新建项目', exact: true }).click()
await expect(page).toHaveURL('/project/project-demo-family/manage/new')
await expect(page.getByRole('button', { name: '刷新资料' })).toHaveCount(0)
await expect(mobileNavigation).toBeVisible()
await expect(page.getByRole('button', { name: '打开菜单', exact: true })).toBeVisible()
expect(await page.locator('html').evaluate((element) => element.scrollWidth)).toBeLessThanOrEqual(390)
const back = page.locator('.app-topbar').getByRole('link', { name: '返回项目管理' })
await back.focus()
Expand All @@ -114,7 +119,7 @@ test('mobile project navigation reaches sync and switches back after creating a
await expect(page).toHaveURL(/\/project\/(?!project-demo-family)[^/]+\/tree$/)
await assertShell()

await mobileNavigation.getByRole('link', { name: '项目', exact: true }).click()
await openOverview()
await assertShell(false)
const switcher = page.locator('.project-switcher')
await switcher.locator('summary').focus()
Expand Down
7 changes: 7 additions & 0 deletions packages/desktop/e2e/helpers/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ export async function openDemo(page: Page, suffix = '/tree'): Promise<void> {
await expect(page.getByRole('navigation', { name: '项目导航' })).toBeVisible()
}

export async function openProjectMenu(page: Page) {
await page.getByRole('button', { name: '打开菜单', exact: true }).click()
const menu = page.getByRole('dialog', { name: '项目菜单', exact: true })
await expect(menu).toBeVisible()
return menu
}

export function watchRuntimeErrors(page: Page): string[] {
const errors: string[] = []
page.on('pageerror', (error) => errors.push(`pageerror: ${error.message}`))
Expand Down
77 changes: 77 additions & 0 deletions packages/desktop/e2e/kinship-query.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { expect, test } from '@playwright/test'
import { DEMO_PROJECT_PATH, expectNoRuntimeErrors, openProjectMenu, resetDemo, watchRuntimeErrors } from './helpers/demo'

test.beforeEach(async ({ page }) => resetDemo(page))

for (const width of [1440, 900, 390, 320]) {
test(`query from a person, swap, refresh and return with a shared shell at ${width}px`, async ({ page }, testInfo) => {
const errors = watchRuntimeErrors(page)
await page.setViewportSize({ width, height: 1000 })
const detailPath = `${DEMO_PROJECT_PATH}/people/person-lin-chen`
await page.goto(detailPath)
await page.getByRole('button', { name: '查称呼', exact: true }).click()
await expect(page.getByRole('heading', { name: '查称呼', exact: true })).toBeVisible()
await expect(page.getByRole('button', { name: '谁来称呼:林晨', exact: true })).toBeVisible()
await page.getByRole('button', { name: '称呼谁:选择人物' }).click()
const search = page.getByRole('searchbox', { name: '称呼谁:搜索人物' })
await search.fill('海叔')
await search.press('ArrowDown')
const result = page.getByRole('region', { name: '称呼谁', exact: true }).getByRole('button', { name: /林海/ })
await expect(result).toBeFocused()
await page.keyboard.press('Enter')
const forward = page.locator('[data-kinship-direction="forward"]')
const reverse = page.locator('[data-kinship-direction="reverse"]')
await expect(forward).toContainText('爸爸')
await expect(reverse).toContainText('女儿')
await expect(page.locator('.kinship-view__path')).toContainText('林晨 → 爸爸:林海')
await page.screenshot({ path: testInfo.outputPath(`kinship-${width}.png`) })

await page.getByRole('button', { name: '交换两个人物' }).click()
await expect(forward).toContainText('女儿')
await expect(reverse).toContainText('爸爸')
await page.getByRole('button', { name: '刷新资料', exact: true }).click()
await expect(forward).toContainText('女儿')
await page.reload()
await expect(forward).toContainText('女儿')
await expect(page.locator('.app-topbar')).toBeVisible()
expect(await page.locator('html').evaluate((element) => element.scrollWidth)).toBeLessThanOrEqual(width)
if (width < 768) {
const menu = await openProjectMenu(page)
const current = menu.getByRole('link', { name: '查称呼', exact: true })
await expect(current).toHaveAttribute('aria-current', 'page')
expect((await current.boundingBox())!.height).toBeGreaterThanOrEqual(44)
await page.keyboard.press('Escape')
await expect(menu).toHaveCount(0)
} else {
await expect(page.getByRole('navigation', { name: '项目导航', exact: true }).getByRole('link', { name: '查称呼', exact: true })).toHaveAttribute('aria-current', 'page')
}
const back = page.getByRole('link', { name: '返回人物详情', exact: true })
await back.focus()
await expect(back).toHaveCSS('outline-style', 'solid')
await page.keyboard.press('Enter')
await expect(page).toHaveURL(detailPath)
expectNoRuntimeErrors(errors)
})
}

test('standalone entry searches both people and keeps a no-match search distinct from a disconnected pair', async ({ page }) => {
const errors = watchRuntimeErrors(page)
await page.getByRole('navigation', { name: '项目导航', exact: true }).getByRole('link', { name: '查称呼', exact: true }).click()
await expect(page.getByText('从两个人的名字开始', { exact: true })).toBeVisible()
await page.getByRole('button', { name: '谁来称呼:选择人物' }).click()
const fromSearch = page.getByRole('searchbox', { name: '谁来称呼:搜索人物' })
await fromSearch.fill('晨晨')
await fromSearch.press('Enter')
await page.getByRole('button', { name: '称呼谁:选择人物' }).click()
const toSearch = page.getByRole('searchbox', { name: '称呼谁:搜索人物' })
await toSearch.fill('查无此人的测试')
await expect(page.getByRole('region', { name: '称呼谁', exact: true })).toContainText('未找到匹配人物')
await toSearch.press('Escape')
await expect(page.getByRole('button', { name: '称呼谁:选择人物' })).toBeFocused()
await page.getByRole('button', { name: '称呼谁:选择人物' }).click()
await page.getByRole('searchbox', { name: '称呼谁:搜索人物' }).fill('小晨')
await page.getByRole('searchbox', { name: '称呼谁:搜索人物' }).press('Enter')
await expect(page.getByText('当前资料中未找到关系路径', { exact: true })).toBeVisible()
await expect(page.locator('[data-kinship-direction]')).toHaveCount(0)
expectNoRuntimeErrors(errors)
})
12 changes: 7 additions & 5 deletions packages/desktop/e2e/mobile-layout.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test, type Locator } from '@playwright/test'
import { DEMO_PROJECT_PATH, resetDemo } from './helpers/demo'
import { DEMO_PROJECT_PATH, openProjectMenu, resetDemo } from './helpers/demo'

test.beforeEach(async ({ page }) => resetDemo(page))

Expand Down Expand Up @@ -38,7 +38,8 @@ for (const width of [320, 390]) {
const refresh = topbar.getByRole('button', { name: '刷新资料', exact: true })
const addPerson = topbar.getByRole('button', { name: '添加人物', exact: true })

for (const button of [refresh, addPerson]) {
const menuButton = topbar.getByRole('button', { name: '打开菜单', exact: true })
for (const button of [menuButton, refresh, addPerson]) {
await expect(button).toBeVisible()
const bounds = await button.boundingBox()
expect(bounds!.width).toBeGreaterThanOrEqual(44)
Expand All @@ -51,7 +52,7 @@ for (const width of [320, 390]) {
const projectName = topbar.locator('.app-topbar__mobile-project')
await expect(projectName).toBeVisible()
const titleArea = await topbar.locator('.app-topbar__drag-surface').boundingBox()
expect(titleArea!.width).toBeGreaterThan(width * 0.45)
expect(titleArea!.width).toBeGreaterThanOrEqual(120)
await expectNoOverflow(topbar)

await refresh.click()
Expand Down Expand Up @@ -82,8 +83,8 @@ for (const width of [320, 390]) {
await newPerson.click()
await expect(page).toHaveURL(`${DEMO_PROJECT_PATH}/people/new`)

await page.getByRole('navigation', { name: '移动端项目导航' })
.getByRole('link', { name: '时间', exact: true }).click()
const menu = await openProjectMenu(page)
await menu.getByRole('link', { name: '时间线', exact: true }).click()
await expect(page).toHaveURL(`${DEMO_PROJECT_PATH}/timeline`)
const timelineHeader = page.locator('.timeline-view__heading')
await expect(timelineHeader.locator('.timeline-view__count')).toHaveText(/8\s*件事件/)
Expand All @@ -105,6 +106,7 @@ for (const width of [320, 390]) {
test('desktop keeps text labels on tree actions and readable page headings', async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 900 })
const topbar = page.locator('.app-topbar')
await expect(topbar.getByRole('button', { name: '打开菜单' })).toHaveCount(0)
await expect(topbar.locator('.data-refresh__label')).toBeVisible()
await expect(topbar.locator('.app-topbar__add-person-label')).toBeVisible()
await expect(topbar.getByRole('button', { name: '适应画布' })).toBeVisible()
Expand Down
Loading
Loading