docs: add implementation patterns & gotchas guide#15
Merged
Conversation
Capture durable libcosmic/iced lessons recovered from the pre-public development history, rewritten against the current codebase: - Performance: why view() must stay cheap (runs every frame), cache results and failures, GPU image decode/upload cost - Live widget idioms grounded in current src/: dropdown 'static closure gotcha, file_chooser open/save dialogs, cosmic::task::future async - Theming via the typed cosmic_theme API (not hand-edited RON files) - Config paths resolved centrally in src/paths.rs - RustEmbed .ftl compile-time embedding gotcha (cargo clean to re-embed) Cross-linked from architecture/OVERVIEW.md Performance Guidelines. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Recovers durable libcosmic/iced development lessons from the project's pre-public history (the old
docs/development/LEARNINGS.md) and rewrites them against the current codebase. The original note referenced files that no longer exist (wallpaper_config.rs, the monolithicapp.rs,ThumbnailCache,flex_row/button::image), so it's reconstructed rather than restored.New:
docs/development/PATTERNS.mdview(): it runs every frame; cache results and failures; GPU image cost is decode+upload, not display size. Framed as a general principle (the wallpaper grid that taught it is gone).src/:widget::dropdown— the'staticclosure gotcha (src/app/visuals.rs)file_chooseropen/save dialogs withCancelledhandlingcosmic::task::futurefor async work off the UI threadcosmic_themeAPI (dark_config()/light_config()), not hand-edited RON files.src/paths.rs..ftlgotcha:RustEmbedembeds translations at compile time (src/localize.rs);cargo cleanforces a re-embed.Changed:
docs/architecture/OVERVIEW.mdCross-reference from "Performance Guidelines" to the new guide.
Notes
PROJECT-NAMING.md(settled decision) and stale/removed widget examples to avoid re-introducing dead references.lint-docsonly checkscargo doc, so no markdown lint impact.pre-public-historybranch.🤖 Generated with Claude Code