fix(snapcompact): reported all foveated frame widths

- Collected distinct rendered frame widths for resume summaries.
- Covered mixed HQ/LQ archives with the existing foveation regression.
- Documented the fix in the snapcompact changelog.

Fixes #6712
This commit is contained in:
roboomp
2026-07-26 14:44:17 +00:00
parent 5a6334a508
commit 6c35f66231
3 changed files with 11 additions and 1 deletions
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed snapcompact resume guides reporting only the HQ grid width for mixed-width foveated archives ([#6712](https://github.com/can1357/oh-my-pi/issues/6712)).
## [17.1.0] - 2026-07-24
### Added
+6 -1
View File
@@ -1963,6 +1963,11 @@ export async function compact<TMessage = Message>(
const frames = await Promise.all(newFrames);
const totalChars = frames.reduce((sum, frame) => sum + frame.chars, 0) + textChars;
const frameCols: number[] = [];
for (const frame of frames) {
if (!frameCols.includes(frame.cols)) frameCols.push(frame.cols);
}
const summaryCols = frameCols.length > 0 ? frameCols.join(" or ") : geo.cols;
const { readFiles, modifiedFiles } = computeFileLists(fileOps);
const files = formatFileList(readFiles, modifiedFiles, fileOps.read);
@@ -1975,7 +1980,7 @@ export async function compact<TMessage = Message>(
frameCount: frames.length,
multipleFrames: frames.length > 1,
docColumns: high.columns === 2,
cols: geo.cols,
cols: summaryCols,
rows: geo.rows,
sentenceInk: high.variant === "sent",
stopwordDimmed: high.stopwordDim === true,
@@ -924,6 +924,7 @@ describe("compact", () => {
expect(cols.slice(0, 3)).toEqual([hiCols, hiCols, hiCols]);
expect(cols.slice(-3)).toEqual([hiCols, hiCols, hiCols]);
expect(cols[3]).toBeGreaterThan(hiCols);
expect(result.summary).toContain(`${hiCols} or ${cols[3]} characters wide`);
});
it("keeps foveated Silver archives on the Silver font", async () => {