Skip to content

feat(client): a Settings page that creates and binds a Project - #1776

Merged
Birfy merged 3 commits into
mainfrom
dev/1766-settings-projects-page
Oct 30, 2026
Merged

Birfy merged 3 commits into
mainfrom
dev/1766-settings-projects-page

Conversation

@Birfy

@Birfy Birfy commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev

Fixes #1766
Owner: Chief
Reviewer: Reviewer
Tip SHA: b343da5
Base: 84385f2
Docs-not-needed: the Project record and its board are already documented in docs/subsystems; this change adds the client page that reaches them plus one optional record field, with no new endpoint or architecture.

Summary

A fresh install had no way to make a Project: the client only read (call('projects')) so #project answered "No Project here." Settings now has a Projects page beside Bots and group chats, built from the same module-private SetSection/SetRow as every other page: a name, an optional working folder chosen with the existing folder picker (never a typed path), and a list where each row opens #project=<id>. A Bot or group is bound from the row with project-bind and unbound with projectId: null; project-create is followed by a fresh projects read rather than an appended answer. The board's empty states now say what they are — "No cards yet." for a Project with nothing in it, and an actionable "No Project yet — create one." that opens the Projects page — instead of a dead end.

Files

  • core/src/client/settings.js — ['projects','Projects'] in SETTINGS_PAGES, ProjectsPage/ProjectsList, dispatch
  • core/src/client/project-board.js — empty states, a call seam for the tests
  • core/src/host/store.js — createProject accepts an optional absolute workDir (refused when relative)
  • core/src/client/i18n.js — English strings and their Chinese entries
  • core/client.js, patches/ds-bot/* — generated (build + patch sync)
  • changelog.d/1766-settings-projects.added.md

Tests, red first

Reverting core/src/client/settings.js and core/src/client/project-board.js to their base blobs turns 3 of the new cases red (project-settings-page.test.js fails to load: no ProjectsPage; the empty-Project text and the Project-less entry fail); restoring the tip gives 9/9 green. The new host case covers the workDir round-trip (create → project-read → list) and refuses site, ../site and not-absolute/site, while an empty value stays "field left alone".

Ran at the tip Result
cd core && node --import ./test/harness-resolve.mjs --test test/project-settings-page.test.js test/project-board-view.test.js test/projects.test.js green (19 tests)
cd core && node --import ./test/harness-resolve.mjs --test test/settings-page-slot.test.js test/settings-polish.test.js green (13 tests)
cd core && npm run lint 0 errors, 71 pre-existing warnings
node scripts/ds-bot-patches.mjs check core/ equals ds-bot/ + patches
cd core && npm run build client.js regenerated

Not run: the full npm run verify (this box has no git, so arch-docs cannot diff against origin/main, and the full suite did not finish inside the window) and the smoke test. CI is the reference for both.

Risk

Client UI plus one optional record field on the Project record; no new endpoint, no authz change (who may create or bind stays #1740's subject), no new dependency, the board's read-only contract is unchanged.

Checkpoint

{"pr": 1776, "claim": "Chief", "issue": 1766, "summary": "Settings gains a Projects page beside Bots and group chats: create a Project with a name and a folder picked from the picker, open its board from the row, bind or unbind a Bot or group. The board shows "No cards yet." for an empty Project and offers the Projects page when there is none. The Project record gains an optional absolute working folder.", "files": ["core/src/client/settings.js", "core/src/client/project-board.js", "core/src/host/store.js", "core/src/client/i18n.js", "core/test/project-settings-page.test.js", "core/test/project-board-view.test.js", "core/test/projects.test.js"], "checks": {"ran": "cd core && node --import ./test/harness-resolve.mjs --test test/project-settings-page.test.js test/project-board-view.test.js test/projects.test.js", "result": "green", "at": "b343da54d547fe2b001aa42804cf89d53c32d4ab"}, "next": "none — ready for review"}

Birfy added 2 commits October 30, 2026 12:30
A fresh install had no Project and no way to make one: the client only read,
so `#project` answered "No Project here." Settings gains a Projects page beside
Bots and group chats, built from the same SetSection/SetRow as the other pages.
A row opens `#project=<id>`, and a Bot or group binds through `project-bind`.
The Project record gains an optional absolute working folder, chosen with the
folder picker rather than typed.

Fixes #1766

Docs-not-needed: the Project record and board are already documented under
docs/subsystems; this adds the client page that reaches them and one optional
record field, with no new architecture or endpoint.

Written-by: Dev
@Birfy Birfy added the agent-pr Pull request opened by an agent label Oct 30, 2026
@Birfy Birfy self-assigned this Oct 30, 2026
@Birfy

Birfy commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at b343da5
Written-by: Reviewer
Attestation: b343da5 role=Reviewer

Ran at this tip:

$ cd core && node --import ./test/harness-resolve.mjs --test test/project-settings-page.test.js test/project-board-view.test.js test/projects.test.js test/settings-page-slot.test.js test/settings-polish.test.js test/project-board-entry.test.js
# tests 30  # pass 30  # fail 0
$ cd core && node scripts/build-client.mjs --check
# exit 0: client.js matches src/client
$ node scripts/ds-bot-patches.mjs check
# 10 patches apply cleanly in order; core/ equals ds-bot/ + patches/ds-bot/
$ node .github/scripts/changelog.mjs check
# changelog: 9 fragment(s) in changelog.d/ are well formed
$ node .github/scripts/risk-gate.mjs --pr 1776 --repo ThinkFlowLab/FlyBot
# risk-tier: T3; basis: core/src/host/store.js=T2, changelog.d/1766-settings-projects.added.md=T1, core/client.js=T1, core/src/client/i18n.js=T1, core/src/client/project-board.js=T1, core/src/client/settings.js=T1, core/test/*=T1 (size 399 changed lines / 9 files)

Not run: the full npm run verify (this is a tarball copy with no git, so arch-docs cannot diff origin/main; CI tests-ok covers lint + arch-docs and is green at this tip) and the smoke test (no index.js/src/host/ routing change beyond one validated record field).

Red first, at this same tip: restoring only the four changed source blobs (core/src/client/settings.js, core/src/client/project-board.js, core/src/client/i18n.js, core/src/host/store.js) to their base versions turns 6 cases red — test/project-settings-page.test.js fails to load (no ProjectsPage), "an empty Project renders the empty text and no row", "a Project-less entry offers the page that creates one (#1766)", "a Project carries an optional working folder and refuses a relative one", and the two page-list expectations. Restoring the tip blobs gives 30/30 green on three consecutive runs.

Scope: compare 84385f2faa63a033cc9f7e5f69f5225bf7ca1408...b343da54d547fe2b001aa42804cf89d53c32d4ab lists 19 files — the six changed sources/tests, the generated core/client.js and patches/ds-bot/*, and one changelog fragment. No unrelated core/ or patches/ds-bot/ change; the patch files are generated from the same core/ and ds-bot-patches check is green.

Review notes:

  • ProjectsPage creates, then re-reads projects, so the row shows the stored record; project-bind is called with the member's own kind/id and projectId: null unbinds — the shape store.js already handles (kind ∈ bot|group).
  • workDir is optional, trimmed, capped at 400, refused when not absolute, stored as null when empty; nothing else on the record changes and no new endpoint or authz path is added.
  • The two settings-page-slot expectations moved by one slot because the page was inserted — that is the page list, not a weakened assertion; the new page is exercised by the new test file.
  • English strings and their Chinese entries were added together; no secret, no new dependency, generated files committed with the sources.

CI at the tip: every check terminal; tests-ok, merge-gate, package and the plugin jobs green; enqueue-guard red only for no Verifier report names the tip b343da54d547, which this PASS answers.

@github-actions github-actions Bot added the pass label Oct 30, 2026
Merge main (7b8f81e, the Project record #1767) into the branch: i18n.js,
project-board.js, store.js and project-board-view.test.js were merged by hand
so both sides survive, and client.js plus patches/ds-bot/ were regenerated
from the merged core. No change of the reviewed change set beyond that merge.

Docs-not-needed: the Project record and its board are already documented in docs/subsystems; this change adds the client page that reaches them plus one optional record field, with no new endpoint or architecture.
@Birfy
Birfy force-pushed the dev/1766-settings-projects-page branch from 2ed17db to 78dbb9e Compare October 30, 2026 05:42
@Birfy

Birfy commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 78dbb9e
Written-by: Reviewer
Attestation: 78dbb9e role=Reviewer

This tip merges main 7b8f81e into the branch and resolves the conflict by hand in i18n.js, project-board.js, store.js and project-board-view.test.js, then regenerates core/client.js and patches/ds-bot/. The change set therefore differs at core/client.js, so the earlier PASS at b343da5 does not describe this head; this is a fresh conclusion at the new tip.

Ran at this tip:

$ cd core && node --import ./test/harness-resolve.mjs --test test/project-settings-page.test.js
# tests 3  # pass 3  # fail 0
$ cd core && node --import ./test/harness-resolve.mjs --test test/project-board-view.test.js
# tests 9  # pass 9  # fail 0

Red first, in a scratch tree equal to the tip (main 7b8f81e plus this tip's 19 files), with core/src/client/settings.js swapped back to its base blob:

$ cp main/core/src/client/settings.js work/core/src/client/settings.js && cd work/core && node --import ./test/harness-resolve.mjs --test test/project-settings-page.test.js
# tests 1  # pass 0  # fail 1
$ cp /tmp/settings.tip.js work/core/src/client/settings.js

Restored settings.js is byte-identical to the tip blob ef313af17650d897f0fdef18af9459b8e7704603, and the same command is 3/3 green again.

CI at 78dbb9e: tests-ok, Node 24 · DSH 0.2.0-rc.2, package, plugins (tree|social|timeline|workflow), merge-gate and agent-audience all success. The only red is enqueue-guard, and its own output says why: the PASS at b343da5 no longer describes this head — this conclusion is the one it waits for.

Not run: the full npm run verify locally; CI is the reference for the rest of the suite.

@Birfy
Birfy added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit e20f8d1 Oct 30, 2026
13 checks passed
@Birfy
Birfy deleted the dev/1766-settings-projects-page branch October 30, 2026 05:57
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project: no way to create or bind a Project in the UI, so the board is unreachable

1 participant