Repository navigation
feat: carry the manifest thumbnail through to the effect catalog (#12, data half) - #66
Merged
Merged
Conversation
…ugh the gateway FileSystemGateway gains readData(_:upTo:), which the live gateway answers with FileHandle.read(upToCount:), so a caller that keeps only so many bytes never reads a larger file whole. FileHandle reports a missing file as fileNoSuchFile, not readString's fileReadNoSuchFile; the smoke suite pins that, and the in-memory gateway now holds bytes and raises the same code.
…ckage A manifest may name a thumbnail, a PNG or JPEG file inside the package. The DataSource refuses a path by its text first (empty, absolute, holding a NUL, or with a `..` component, split at the byte `/`), reads at most 1 MiB and one byte, and keeps the bytes only when they begin with a PNG or JPEG signature, which decides the format. A thumbnail that cannot be used costs the package its picture and nothing else: the package stays ready, and the reason is logged with the path quoted. The thumbnail's file and the directories on its way are watched. Part of #12
EffectCatalogEntry gains an optional thumbnail, which the Repository fills from the package; the bundled effect and a broken package have none. A listing that changes only a thumbnail publishes a new state and prepares nothing, and on the loopback an edit of the thumbnail file reaches the catalog. Part of #12
Ripple.lens names a 256 x 256 thumbnail.png of its swaying stripes. The example suite now copies every file byte for byte and requires a named thumbnail to be read.
The README explains the optional `thumbnail` key, ARCHITECTURE records the decisions in a Key Design Decisions entry (bytes rather than a path, the lexical refusals, the 1 MiB limit, symbolic links, the logging, the watch), and AGENTS.md and the testing rules describe the byte-holding fake.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
… leave it out of package(_:) FileHandle fails below a file with fileWriteUnknown and on a directory with codes that differ between runs (fileNoSuchFile, fileWriteUnknown and fileWriteNoPermission have all been seen), so sorting those reads by code logged a missing thumbnail as an error, or a directory as missing. The DataSource now asks isDirectory before it reads: a directory on the way that is not there, or is a file, makes the thumbnail missing, and a directory where the file should be is refused as such, both unread. package(_:) is the read a source is prepared from, for the chosen package on every listing and every choice, so reading the picture there read it again and logged its problem again for a value nobody takes. It now answers a ready package without its thumbnail, which travels with packages() alone. The package is now built once, from the manifest and the source, instead of being rebuilt field by field around the thumbnail, and the parents of the file are found without a range that would trap on no components.
…hose The smoke suite now pins fileWriteNoPermission for a file that may not be read, and that a path below a file does not throw a missing code; for a directory it pins only that the read throws, since the code is not stable. The port says which code a missing file throws and that a directory is to be asked about, and the fake no longer claims to mirror live for a directory.
…uire Ripple's The UseCase test named a thumbnail change "of the chosen package or another" but only changed the chosen one's. The example suite passed with Ripple's thumbnail key removed (nil == nil); it now requires Ripple's PNG to be read.
… docs claim The README and the doc comments described the effect picker as showing the thumbnail, which nothing does yet. A `..` is refused as a path segment, not anywhere in the text; a null thumbnail is no thumbnail, not the wrong type; the watch adds the directories on a thumbnail's way that are there; the 1 MiB limit is per package. ARCHITECTURE no longer says the fake raises fileReadNoSuchFile for every missing file, and records the directory check and why package(_:) leaves the picture out.
…ect-thumbnail-manifest # Conflicts: # docs/ARCHITECTURE.md
The merge joined main's wording of readString's missing code with this branch's readData doc; readData now names its own code in the same form.
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue #12 (エフェクトピッカーのサムネイル) のデータ側。
の
に載せる。View 側 (Presenter / Geometry / View / Router) は別
で進んでおり、セルへの配線・View での画像デコード・README Roadmap・
の
で行う。この
では #12 を閉じない。
.lensのmanifest.jsonにthumbnailを足し、その画像のバイト列を DataSource が FileSystem port 経由で読んで、EffectCatalogEntry.thumbnailまでカタCloses #12は両方がマージされたSources/Presenters・Sources/Views・Sources/AppRouterには触れていない。契約
取り決めた契約はそのまま守っている:
EffectManifest.thumbnail: String?: パッケージ内の相対nullならnilEffectThumbnail(Sources/Entity/、Sendable, Hashable):data: DataEffectCatalogEntry.thumbnail: EffectThumbnail?: init の最後の引数で、既定はnil。nilEffectCatalogEntryのフィールドの意味は変えていない契約に足したもの (どれも
の意味は変えない):
EffectThumbnail.format: EffectThumbnailFormat(png/jpeg): 拡張子ではなく先頭のシグネチャで決まる。View がデコーダを選ぶのに使えるEffectPackage.thumbnail: EffectThumbnail?: DataSource から Repository へ渡すためFileSystemGateway.readData(_:upTo:):FileHandle.read(upToCount:)で、不正な値の扱い
方針: 使えないサムネイルで失うのは絵だけ。 パッケージは
は Swift の文字列表記 (
を
して
に出す。黙って捨てることはない。詳しい
は
.readyのままthumbnailがnilになり、String(reflecting:)) でdocs/ARCHITECTURE.mdの Key Design Decisions、Thumbnails: a picture that can only be missing に書いた。is empty/…)is an absolute path, …holds a NUL character..の成分 (中に戻ってくるものも含む。/のバイトでhas a \..` component, …`.png/.jpg/.jpeg(大文字小文字は問わない) 以外is not a .png, .jpg or .jpeg filefileNoSuchFile/fileReadNoSuchFile)is missingcould not be read: …is larger than 1048576 bytesis not a PNG or JPEG imagethumbnailが JSON の文字列でない (数値・オブジェクト)manifestInvalid、authorとmanifest.json/effect.metalとpackage(_:)も読み直すので、2 つの答えが食い違わない。サムネイルだけが変わった一覧は、新しい state を publish するが、何も prepare し直さない508d0f0feat(file-system):FileSystemGateway.readData(_:upTo:)、live、fake (InMemoryFileSystemGatewayがバイト列を持つようになった:write(_:bytes:)、dataReads、UTF-8 でないテキストは live とfileReadCorruptFile、readDataはFileHandleとfileNoSuchFile) と、その smoke / contract12a9864feat(effect-package): Entity (EffectThumbnail、EffectManifest.thumbnail、EffectPackage.thumbnail)、純粋なEffectThumbnailReading(0da3f5ffeat(catalog):EffectCatalogEntry.thumbnailと Repository での受け渡し、UseCase とループバック1ef6fb9feat(examples):Examples/Ripple.lensに 256 × 256 のthumbnail.png(50,333 バイト、揺れる縞) を足した。ExamplePackagesTestsは全ファイルをバイト単位でコピーし、名前があるサムネイルは読めることを求める8c64a16docs:docs/ARCHITECTURE.md(Entity の一覧、Physical Abstraction Table、file gateway の段落、.lensの段落、catalog / watch の段落、新しい Key Design Decision)、README (manifest のAGENTS.md、.claude/rules/testing.mdExamplePackagesTestsの読み取り):EffectManifestDecodingTests): あり / なし /null/ 書かれたとおり (trim しない、../もデコード時点では保持) / 空 / 型違い (数値・オブジェクト) は broken。round trip でもthumbnailをEffectThumbnailReadingTests):..\u{301}と../\u{301}の~、...、tooLarge、EffectThumbnailListingTests): fake から読めた / サブディレクトリ / 指定なし / 使えない 16 パターン (package(_:)も)EffectPackageRepositoryThumbnailTests)、UseCase (EffectCatalogThumbnailTests: state がサムネイルを持つ、サムネイルだけのEffectCatalogIntegrationTestsのanEditedThumbnailReachesTheCatalog): ループバック上でサムネイルのファイル自体の watch を発火させ、FileSystemGatewayImplTests): バイト列、fileNoSuchFile、ディレクトリは missing ではないローカル (origin/main
9153a42起点):make format:make lint:make check: 全スクリプトmake build(App + ExtensionApp release) /make build-dev-harness:make test: 987 tests in 134 suites passed, 12 known issues。main の既知 10 件に加え、fake の contractwithKnownIssueを 2 件足した (ディレクトリにバイト列を書く、ファイルの下に書く:writeの誤用make test-gpu: 27 tests in 6 suites passedversion.txtはマージchore(release)commit で入れる。Part of #12