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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ it affects and how to migrate. The format follows [Keep a Changelog](https://kee
> from 2.0.0. Reference the packages with a range that stays within one minor version, for example `[1.6,1.7)`, rather
> than `1.*`. The policy and its reasons are in [ADR-052](maintainers/adr/adr-052-breaking-changes-in-1-x-minors.md).

## [Unreleased]
## [1.15.0] - 2026-11-16

Details and migration steps: [docs/en/changelogs/1.15.0.md](docs/en/changelogs/1.15.0.md)

Expand All @@ -23,6 +23,8 @@ Details and migration steps: [docs/en/changelogs/1.15.0.md](docs/en/changelogs/1
- `db upgrade` reports which tables their record decided, and a previous upgrade that failed or did not finish.
- A table rebuild keeps AutoIncrement numbers and a renamed column's values, and an upgrade no longer repeats itself on SQL Server, MySQL, Oracle and SQLite.
- A master field's expression can add up its detail rows with `Sum`, `Count`, `Min` and `Max`, on save and live in the Avalonia and Blazor heads.
- A generated form layout gives a multi-line field the whole row.
- DefineEditor's drafting conversation shows each step Claude takes and asks its questions as cards the user answers with a click.

## [1.14.0] - 2026-11-14

Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Polhem 套件的重要變更,每個版本只列幾項重點。每個版本都
> 版號自 2.0.0 起依循[語意化版本](https://semver.org/lang/zh-TW/)。引用套件時請使用不跨 minor 版的範圍,例如
> `[1.6,1.7)`,不要用 `1.*`。這項政策與理由見 [ADR-052](maintainers/adr/adr-052-breaking-changes-in-1-x-minors.md)。

## [Unreleased]
## [1.15.0] - 2026-11-16

詳細內容與遷移步驟:[docs/zh-TW/changelogs/1.15.0.md](docs/zh-TW/changelogs/1.15.0.md)

Expand All @@ -22,6 +22,8 @@ Polhem 套件的重要變更,每個版本只列幾項重點。每個版本都
- `db upgrade` 會回報哪些資料表由紀錄判定,以及上一次失敗或沒有完成的升級。
- rebuild 保留 AutoIncrement 編號與改名欄位的值;SQL Server、MySQL、Oracle 與 SQLite 上的升級不再重複發生。
- 主表欄位的運算式可以用 `Sum`、`Count`、`Min`、`Max` 加總明細列,存檔時計算,Avalonia 與 Blazor head 也即時更新。
- 產生的表單版面讓多行欄位獨占一整列。
- DefineEditor 的草擬對話會顯示 Claude 執行的每個步驟,並以卡片提問,使用者點選即可回答。

## [1.14.0] - 2026-11-14

Expand Down
6 changes: 3 additions & 3 deletions Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
and samples/ as well. This one is imported explicitly by the two directories that want it.
-->
<PropertyGroup>
<Version>1.14.0</Version>
<AssemblyVersion>1.14.0.0</AssemblyVersion>
<FileVersion>1.14.0.0</FileVersion>
<Version>1.15.0</Version>
<AssemblyVersion>1.15.0.0</AssemblyVersion>
<FileVersion>1.15.0.0</FileVersion>
</PropertyGroup>

</Project>
25 changes: 23 additions & 2 deletions docs/en/changelogs/1.15.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ what the upgrade does. A tool of an older format no longer undoes a newer one, a
current is not compared with the database, which makes a start-up that changes nothing much cheaper. The upgrade also
follows four written principles: it keeps the data, takes the current definition as the target, never needs repeating,
and stops and reports when the data blocks it. A rebuild therefore keeps AutoIncrement numbers, and refuses what it
cannot recreate. A master field's expression can now add up its detail rows. The wire format is the
one of 1.14.0.
cannot recreate. A master field's expression can now add up its detail rows, a generated layout gives a multi-line field the whole
row, and DefineEditor's drafting conversation shows its progress and asks with clickable questions. The wire format is
the one of 1.14.0.

Applications on SQLite or Oracle should expect the first upgrade after updating to change their `Date` columns to the
new default, which on SQLite rebuilds those tables (see the breaking changes).
Expand Down Expand Up @@ -92,6 +93,26 @@ the aggregates, so a drafted form keeps its totals. The guide is

- **Background:** [ADR-066](../../../maintainers/adr/adr-066-detail-aggregates-in-expressions.md)

### A multi-line field takes the whole row of a generated layout

`FormLayoutGenerator.Generate` gives a master field whose editor is a `MemoEdit` (an explicit `MemoEdit`, or `Auto` on a
`Text` field) a `ColumnSpan` of the layout's column count, and `FormLayoutGenerator.Merge` does the same for a memo field
it adds. Document drafting, its preview and the Excel import all generate through it. Fields already in a FormLayout
file keep their span; regenerating the file gives a memo field its own row. When drafting, asking for a field to span
the row makes it a `MemoEdit`.

### The drafting conversation shows its steps and asks with question cards

`FormDraftSession.Activity` reports each step of a turn (thinking, the model's reasoning summary, and every tool call
with what it works on), and the new `ask_user` tool lets the model ask structured questions, each with options and the
one it suggests, raised as `FormDraftSession.QuestionsAsked`. After its questions, a reply first says what changed in the
draft that turn. `FormDraftingOptions.MarkdownReplies` tells the model whether the host renders Markdown.

In DefineEditor's "Draft a Form from Documents" window, a card follows the current step and collapses into the number of
steps when the turn ends, and a question card offers the options with the suggested one marked, a free-text answer,
**Use the Suggestions** and **Send Answers**. Typing a reply still works. See
[Drafting Forms from Documents §3](../guides/document-form-drafting.md#3-drafting-a-form).

## Breaking changes

### The upgrade trusts a table's record instead of comparing it
Expand Down
14 changes: 12 additions & 2 deletions docs/zh-TW/changelogs/1.15.0.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- source: en/changelogs/1.15.0.md blob: af29dc4d5e0e2f7a44d115ec7769a2aafd6d39c2 -->
<!-- source: en/changelogs/1.15.0.md blob: 7bb4e20e8cdf48e96f2163e18bc0e2fdc21d4052 -->
# Polhem 1.15.0 — 發佈說明

[English](../../en/changelogs/1.15.0.md)

本檔是 [CHANGELOG.zh-TW.md](../../../CHANGELOG.zh-TW.md) 中 `[1.15.0]` 條目的詳細內容。

資料表升級現在會把每張表的升級記錄在 `st_table_upgrade`,並帶上為升級行為編版的格式版本。舊格式的工具不再復原新格式做過的改動;紀錄顯示已是最新的資料表不再與資料庫比對,沒有任何變更的啟動因此快很多。升級也明文遵循四項原則:保存資料、以目前的定義為準、不需重複升級,以及資料擋住升級時停下並回報。因此 rebuild 會保留 AutoIncrement 編號,無法重建的部分則拒絕執行。主表欄位的運算式現在可以加總明細列。wire 格式與 1.14.0 相同。
資料表升級現在會把每張表的升級記錄在 `st_table_upgrade`,並帶上為升級行為編版的格式版本。舊格式的工具不再復原新格式做過的改動;紀錄顯示已是最新的資料表不再與資料庫比對,沒有任何變更的啟動因此快很多。升級也明文遵循四項原則:保存資料、以目前的定義為準、不需重複升級,以及資料擋住升級時停下並回報。因此 rebuild 會保留 AutoIncrement 編號,無法重建的部分則拒絕執行。主表欄位的運算式現在可以加總明細列,產生的版面讓多行欄位獨占一整列,DefineEditor 的草擬對話也會顯示進度,並以可點選的問題提問。wire 格式與 1.14.0 相同。

使用 SQLite 或 Oracle 的應用,更新後的第一次升級會把 `Date` 欄位改成新的預設值;在 SQLite 上這會重建那些資料表(見破壞性變更)。

Expand Down Expand Up @@ -55,6 +55,16 @@ rebuild 會複製每個欄位,包括定義沒有宣告的欄位,現在也包

- **背景:** [ADR-066](../../../maintainers/adr/adr-066-detail-aggregates-in-expressions.md)

### 多行欄位在產生的版面中獨占一整列

`FormLayoutGenerator.Generate` 會讓編輯器為 `MemoEdit` 的主表欄位(明確指定 `MemoEdit`,或 `Text` 欄位的 `Auto`)的 `ColumnSpan` 等於版面的欄數;`FormLayoutGenerator.Merge` 新增 memo 欄位時也一樣。文件草擬、草擬預覽與 Excel 匯入都經由它產生版面。既有 FormLayout 檔中的欄位維持原本的跨欄;重新產生該檔時,memo 欄位會獨占一列。草擬時要求某欄位跨整列,該欄位就會設為 `MemoEdit`。

### 草擬對話顯示步驟,並以問題卡提問

`FormDraftSession.Activity` 回報一輪中的每個步驟(思考、模型的推理摘要,以及每次工具呼叫與其對象),新的 `ask_user` 工具讓模型提出結構化問題,每題附選項與建議答案,透過 `FormDraftSession.QuestionsAsked` 發出。提問之後的回覆會先說明這輪改了草稿的哪些地方。`FormDraftingOptions.MarkdownReplies` 告訴模型宿主是否會呈現 Markdown。

在 DefineEditor 的「從文件草擬表單」視窗中,進度卡會跟著目前的步驟,該輪結束時收合成步驟數;問題卡列出選項並標示建議答案,可輸入自由回答,也有「**全部採用建議**」與「**送出回答**」。直接打字回覆仍然可以。見[從文件草擬表單 §3](../guides/document-form-drafting.md#3-草擬表單)。

## 破壞性變更

### 升級改為相信資料表的紀錄,不再逐一比對
Expand Down
43 changes: 43 additions & 0 deletions src/Polhem.Db/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ Polhem.Db.Schema.DescriptionLevel.Table = 0 -> Polhem.Db.Schema.DescriptionLevel
Polhem.Db.Schema.ITableSchemaProvider
Polhem.Db.Schema.ITableSchemaProvider.DatabaseId.get -> string!
Polhem.Db.Schema.ITableSchemaProvider.GetTableSchema(string! tableName) -> Polhem.Definition.Database.TableSchema?
Polhem.Db.Schema.SchemaFormat
Polhem.Db.Schema.TableSchemaBuilder
Polhem.Db.Schema.TableSchemaBuilder.CompareToDiff(string! categoryId, string! tableName) -> Polhem.Db.Schema.TableSchemaDiff!
Polhem.Db.Schema.TableSchemaBuilder.DatabaseId.get -> string!
Expand All @@ -496,6 +497,41 @@ Polhem.Db.Schema.TableUpgradeOrchestrator.Execute(Polhem.Db.Schema.UpgradePlan!
Polhem.Db.Schema.TableUpgradeOrchestrator.Plan(Polhem.Db.Schema.TableSchemaDiff! diff, Polhem.Db.Schema.UpgradeOptions? options = null) -> Polhem.Db.Schema.UpgradePlan!
Polhem.Db.Schema.TableUpgradeOrchestrator.TableUpgradeOrchestrator(Polhem.Db.Providers.IDialectFactory! dialect, Polhem.Db.Manager.IDbConnectionManager! connectionManager) -> void
Polhem.Db.Schema.TableUpgradeOrchestrator.TableUpgradeOrchestrator(string! databaseId, Polhem.Db.Manager.IDbConnectionManager! connectionManager) -> void
Polhem.Db.Schema.TableUpgradeRecord
Polhem.Db.Schema.TableUpgradeRecord.Error.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.Error.init -> void
Polhem.Db.Schema.TableUpgradeRecord.FormatVersion.get -> int
Polhem.Db.Schema.TableUpgradeRecord.FormatVersion.init -> void
Polhem.Db.Schema.TableUpgradeRecord.FrameworkVersion.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.FrameworkVersion.init -> void
Polhem.Db.Schema.TableUpgradeRecord.SchemaHash.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.SchemaHash.init -> void
Polhem.Db.Schema.TableUpgradeRecord.SchemaXml.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.SchemaXml.init -> void
Polhem.Db.Schema.TableUpgradeRecord.Status.get -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeRecord.Status.init -> void
Polhem.Db.Schema.TableUpgradeRecord.TableName.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.TableName.init -> void
Polhem.Db.Schema.TableUpgradeRecord.TableUpgradeRecord() -> void
Polhem.Db.Schema.TableUpgradeRecord.UpdateTime.get -> System.DateTime
Polhem.Db.Schema.TableUpgradeRecord.UpdateTime.init -> void
Polhem.Db.Schema.TableUpgradeRecordStore
Polhem.Db.Schema.TableUpgradeRecordStore.DescribeNewerFormat() -> string?
Polhem.Db.Schema.TableUpgradeRecordStore.GetHighestFormatVersion() -> int
Polhem.Db.Schema.TableUpgradeRecordStore.GetRecord(string! tableName) -> Polhem.Db.Schema.TableUpgradeRecord?
Polhem.Db.Schema.TableUpgradeRecordStore.GetRecordedStatus(string! tableName) -> Polhem.Db.Schema.TableUpgradeStatus?
Polhem.Db.Schema.TableUpgradeRecordStore.IsRecordedAsCurrent(Polhem.Definition.Database.TableSchema! define) -> bool
Polhem.Db.Schema.TableUpgradeRecordStore.RecordTableName.get -> string!
Polhem.Db.Schema.TableUpgradeRecordStore.TableUpgradeRecordStore(string! databaseId, Polhem.Db.Manager.IDbConnectionManager! connectionManager) -> void
Polhem.Db.Schema.TableUpgradeRecordStore.TryRecordUnchanged(Polhem.Definition.Database.TableSchema! define) -> bool
Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeStatus.Failed = 2 -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeStatus.Succeeded = 1 -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeStatus.Upgrading = 0 -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeStatus.Verified = 3 -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.UpgradeCompareMode
Polhem.Db.Schema.UpgradeCompareMode.Fast = 0 -> Polhem.Db.Schema.UpgradeCompareMode
Polhem.Db.Schema.UpgradeCompareMode.Full = 1 -> Polhem.Db.Schema.UpgradeCompareMode
Polhem.Db.Schema.UpgradeExecutionMode
Polhem.Db.Schema.UpgradeExecutionMode.Alter = 2 -> Polhem.Db.Schema.UpgradeExecutionMode
Polhem.Db.Schema.UpgradeExecutionMode.Create = 1 -> Polhem.Db.Schema.UpgradeExecutionMode
Expand All @@ -504,9 +540,13 @@ Polhem.Db.Schema.UpgradeExecutionMode.Rebuild = 3 -> Polhem.Db.Schema.UpgradeExe
Polhem.Db.Schema.UpgradeOptions
Polhem.Db.Schema.UpgradeOptions.AllowColumnNarrowing.get -> bool
Polhem.Db.Schema.UpgradeOptions.AllowColumnNarrowing.init -> void
Polhem.Db.Schema.UpgradeOptions.CompareMode.get -> Polhem.Db.Schema.UpgradeCompareMode
Polhem.Db.Schema.UpgradeOptions.CompareMode.init -> void
Polhem.Db.Schema.UpgradeOptions.UpgradeOptions() -> void
Polhem.Db.Schema.UpgradePlan
Polhem.Db.Schema.UpgradePlan.AllStatements.get -> System.Collections.Generic.IEnumerable<string!>!
Polhem.Db.Schema.UpgradePlan.DefineTable.get -> Polhem.Definition.Database.TableSchema?
Polhem.Db.Schema.UpgradePlan.DefineTable.init -> void
Polhem.Db.Schema.UpgradePlan.IsEmpty.get -> bool
Polhem.Db.Schema.UpgradePlan.Mode.get -> Polhem.Db.Schema.UpgradeExecutionMode
Polhem.Db.Schema.UpgradePlan.Stages.get -> System.Collections.Generic.IReadOnlyList<Polhem.Db.Schema.UpgradeStage!>!
Expand Down Expand Up @@ -560,6 +600,7 @@ const Polhem.Db.CommandTextVariable.CompanyId = "{@CompanyId}" -> string!
const Polhem.Db.CommandTextVariable.Parameters = "{@Parameters}" -> string!
const Polhem.Db.DbBatchSpec.FailedIndexDataKey = "Polhem.BatchIndex" -> string!
const Polhem.Db.Manager.DatabaseCreator.MaxDatabaseNameLength = 63 -> int
const Polhem.Db.Schema.TableUpgradeRecordStore.DefaultRecordTableName = "st_table_upgrade" -> string!
const Polhem.Db.Storage.DbDefineStorage.DefineDatabaseId = "common" -> string!
override Polhem.Db.CacheNotify.CacheNotifyChange.GetHashCode() -> int
override Polhem.Db.DbAccess.ToString() -> string!
Expand Down Expand Up @@ -611,6 +652,8 @@ static Polhem.Db.Providers.SqlServer.SqlTableSchemaProvider.GetFieldDbType(strin
static Polhem.Db.Providers.SqlServer.SqlTableSchemaProvider.ParseDBDefaultValue(string! dataType, string! defaultValue, string! originalDefaultValue) -> string!
static Polhem.Db.Providers.Sqlite.SqliteTableSchemaProvider.MapToFieldDbType(string! baseType, bool isPrimaryKey) -> Polhem.Core.Data.FieldDbType
static Polhem.Db.Providers.Sqlite.SqliteTableSchemaProvider.ParseDefaultValue(string! rawDefault, Polhem.Core.Data.FieldDbType dbType, string! originalDefault) -> string!
static Polhem.Db.Schema.SchemaFormat.Current.get -> int
static Polhem.Db.Schema.TableUpgradeRecordStore.ComputeHash(string! schemaXml) -> string!
static Polhem.Db.Schema.UpgradeOptions.Default.get -> Polhem.Db.Schema.UpgradeOptions!
~override Polhem.Db.CacheNotify.CacheNotifyChange.Equals(object obj) -> bool
~override Polhem.Db.CacheNotify.CacheNotifyChange.ToString() -> string
43 changes: 0 additions & 43 deletions src/Polhem.Db/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,44 +1 @@
#nullable enable
Polhem.Db.Schema.SchemaFormat
Polhem.Db.Schema.TableUpgradeRecord
Polhem.Db.Schema.TableUpgradeRecord.Error.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.Error.init -> void
Polhem.Db.Schema.TableUpgradeRecord.FormatVersion.get -> int
Polhem.Db.Schema.TableUpgradeRecord.FormatVersion.init -> void
Polhem.Db.Schema.TableUpgradeRecord.FrameworkVersion.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.FrameworkVersion.init -> void
Polhem.Db.Schema.TableUpgradeRecord.SchemaHash.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.SchemaHash.init -> void
Polhem.Db.Schema.TableUpgradeRecord.SchemaXml.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.SchemaXml.init -> void
Polhem.Db.Schema.TableUpgradeRecord.Status.get -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeRecord.Status.init -> void
Polhem.Db.Schema.TableUpgradeRecord.TableName.get -> string!
Polhem.Db.Schema.TableUpgradeRecord.TableName.init -> void
Polhem.Db.Schema.TableUpgradeRecord.TableUpgradeRecord() -> void
Polhem.Db.Schema.TableUpgradeRecord.UpdateTime.get -> System.DateTime
Polhem.Db.Schema.TableUpgradeRecord.UpdateTime.init -> void
Polhem.Db.Schema.TableUpgradeRecordStore
Polhem.Db.Schema.TableUpgradeRecordStore.DescribeNewerFormat() -> string?
Polhem.Db.Schema.TableUpgradeRecordStore.GetHighestFormatVersion() -> int
Polhem.Db.Schema.TableUpgradeRecordStore.GetRecord(string! tableName) -> Polhem.Db.Schema.TableUpgradeRecord?
Polhem.Db.Schema.TableUpgradeRecordStore.RecordTableName.get -> string!
Polhem.Db.Schema.TableUpgradeRecordStore.TableUpgradeRecordStore(string! databaseId, Polhem.Db.Manager.IDbConnectionManager! connectionManager) -> void
Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeStatus.Failed = 2 -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeStatus.Succeeded = 1 -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeStatus.Upgrading = 0 -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.UpgradePlan.DefineTable.get -> Polhem.Definition.Database.TableSchema?
Polhem.Db.Schema.UpgradePlan.DefineTable.init -> void
const Polhem.Db.Schema.TableUpgradeRecordStore.DefaultRecordTableName = "st_table_upgrade" -> string!
static Polhem.Db.Schema.SchemaFormat.Current.get -> int
static Polhem.Db.Schema.TableUpgradeRecordStore.ComputeHash(string! schemaXml) -> string!
Polhem.Db.Schema.TableUpgradeRecordStore.IsRecordedAsCurrent(Polhem.Definition.Database.TableSchema! define) -> bool
Polhem.Db.Schema.TableUpgradeRecordStore.TryRecordUnchanged(Polhem.Definition.Database.TableSchema! define) -> bool
Polhem.Db.Schema.UpgradeCompareMode
Polhem.Db.Schema.UpgradeCompareMode.Fast = 0 -> Polhem.Db.Schema.UpgradeCompareMode
Polhem.Db.Schema.UpgradeCompareMode.Full = 1 -> Polhem.Db.Schema.UpgradeCompareMode
Polhem.Db.Schema.UpgradeOptions.CompareMode.get -> Polhem.Db.Schema.UpgradeCompareMode
Polhem.Db.Schema.UpgradeOptions.CompareMode.init -> void
Polhem.Db.Schema.TableUpgradeStatus.Verified = 3 -> Polhem.Db.Schema.TableUpgradeStatus
Polhem.Db.Schema.TableUpgradeRecordStore.GetRecordedStatus(string! tableName) -> Polhem.Db.Schema.TableUpgradeStatus?
Loading
Loading