Add custom project icons with an in-app image picker - #425
Merged
Merged
Conversation
guivieiras
marked this pull request as ready for review
September 13, 2026 20:02
Tryanks
force-pushed
the
topic/project-icons
branch
from
September 14, 2026 17:12
b0f4d4d to
e193aa3
Compare
Owner
|
Hey @guivieiras, thanks — I've decided to take this feature. This PR introduces a new project-level config file, Once all of these PRs are merged I plan to tackle #409 and then cut a new release. |
Contributor
Author
|
@Tryanks nice, thanks! |
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.
Projects can use custom images through the project menu or command palette. The picker browses the attached host and keeps a normalized copy there, so removing the original does not break a manual icon. Use project default clears the choice and refreshes every connected client, including an already selected default.
Defaults come from
iconPathin the project-roottcode.json, ort3.jsononly when the primary file is absent. Project configuration documents file selection, host-relative and absolute paths, unknown fields, invalid JSON/types, image limits, overrides and refresh behavior. The dedicated configuration reader owns these rules. The document also records requirements for a future preserving, atomic editor; configuration writing is not added here.The host owns thumbnail and display-size raster generation in one implementation. Source pixel limits bound the floating-point resize allocation in addition to decoder limits. Clients return complete host paths unchanged, so a client OS cannot introduce its own separators into a remote path. Icon cache entries refresh after reconnect and reset, and the picker exposes selection to accessibility clients. Icons appear across project views; compact thread status indicators take precedence.
Tests retain the existing persistence/copy/replacement/reset, old-index compatibility and Enter-key regression coverage. The two transparent-edge tests are consolidated at the shared host raster owner. Added cases protect foreign host paths, cached successes/errors across reconnect/reset, resource rejection, map-only configuration and cleanup only after successful index persistence (without deleting external files). UI fixtures use asynchronous protocol replies, keeping file validation at the host owner and exercising the same image-loading path as production. This removes the browse-query synchronous branch and the Windows file-handle cleanup race from the former live-host cache fixture. The existing live-host sidebar/shell fixtures still need a test-only image-query scheduling adapter; the new icon fixtures exercise the asynchronous path. The cache regression establishes an initial Index baseline before reconnecting, and also fails when reconnect baseline clearing is temporarily removed.
Thread lists with matching sample data before and after.
Desktop · Ungrouped
Desktop · Grouped
Mobile · Ungrouped
Mobile · Grouped
Change icon from the command palette
Change project icon from the project menu
Choose an image in the in-app file picker
Validation
Passed on macOS in an isolated worktree and build directory:
cargo fmt --all --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo build --workspace --lockedcargo test --workspace --lockedcargo-machete .(CI version 0.9.2)RUSTFLAGS='-D warnings' IPHONEOS_DEPLOYMENT_TARGET=26.0 cargo check -p tcode-ios --target aarch64-apple-ios-sim --lockedRUSTFLAGS='-D warnings' cargo check -p tcode-web --target wasm32-unknown-unknown --lockedRUSTFLAGS='-D warnings' CARGO_NDK_PLATFORM=26 cargo ndk -t arm64-v8a check -p tcode-android --locked(NDK 27.1.12297006)Temporarily removing the fixes made four regressions fail: oversized image conversion, positional-array config, foreign host paths and cached icon recovery. Restoring the final source made them pass. The existing transparent-edge regression now covers thumbnail and display sizes through the same host implementation.
Manual validation used a disposable profile: light/dark, wide/compact windows, command-palette entry, directory navigation, path Enter without dismissal, filtering, scrolling, focus outlines, selecting/saving and resetting. Reset removed the managed PNG and cleared the persisted override. The screenshots above illustrate the feature; the refactor retains its layout.
An initial shared-cache run hit the existing terminal burst throughput threshold; the complete isolated rerun passed. That independently reproduced runtime issue is fixed separately in #448. The macOS debug link emitted an unwind-table size warning, and Cargo reports the existing
blockdependency future-compatibility notice. Native Windows/Linux execution remains for CI; mobile/Web checks above are compilation checks.