Skip to content

docs: audit and prune low-value comments across src/#77

Merged
StudentWeis merged 1 commit into
mainfrom
docs/76-comment-audit
May 6, 2026
Merged

docs: audit and prune low-value comments across src/#77
StudentWeis merged 1 commit into
mainfrom
docs/76-comment-audit

Conversation

@StudentWeis
Copy link
Copy Markdown
Owner

Summary

Repository-wide comment audit driven by Clean Code's "explain why, not what" principle. Drops stale, dangling, and signature-restating comments; compresses verbose SAFETY: blocks; preserves every module-level //! doc and why comment that pulls its weight.

Linked Issue

Closes #76

Changes

  • Stale / wrong / dangling notes (P0)
    • repository/models.rs: drop the Image (stored as base64) doc that contradicts the current sidecar storage path; tighten ContentType and ClipboardRecord field docs to the few that actually add context.
    • gui/board/preview.rs: promote a /// floating between two use statements into a real module //! doc.
    • gui/board/hotkey_record_handler.rs: remove the merged from gui/hotkey_record.rs historical marker (git history covers it).
  • Signature-restating docs (P1) stripped across repository/{errors, backend, repo, favorites, cleanup}.rs, updater/{models, http}.rs, i18n/{error, translations}.rs, gui/board/{record_ops, settings_editor, clear_confirm, header, filtering, updater_ui}.rs, gui/panel/{about, help, settings}.rs, gui/{tray, theme}.rs, clipboard/writer.rs, config/settings/mod.rs, and constants.rs. Where the why matters (dedup behavior, sidecar lifetime, validation contract, cleanup-buffer rationale, etc.) the doc is rewritten to state it.
  • Boilerplate / verbosity (P2)
    • gui/utils.rs: introduce a module-level //! capturing the SAFETY invariants shared across all 11 Win32 blocks; per-block // SAFETY: notes now only call out block-specific deltas.
    • utils/single_instance.rs: SAFETY block compressed; add a why note explaining the Zed::Window magic class name (GPUI's Win32 class).
    • config/autostart.rs: drop # Arguments / # Returns rustdoc templates; rewrite get_app_path and sync_state docs to explain the .app-bundle constraint and the no-op-when-equal rationale.
    • gui/board/preview.rs: drop # Usage Example blocks.
    • clipboard/writer.rs: tighten the macOS race-condition note.
    • constants.rs: replace the historical narrative with a one-line module doc; expand SILENT_ARG to explain why it exists.
  • Inline standalone markers (P3) in app.rs's launch() collapsed; the genuinely helpful ordering / dependency notes (Settings before I18n, tray needs I18n) survive in concise form.

Behavior is unchanged — comments only.

Testing

  • scripts/precheck.sh passes locally (cargo check, cargo clippy -D warnings, 421 tests passed, cargo machete, check_i18n.py, check_icons.py, check_themes.py)
  • No new lints reported by the IDE on the 30 modified files.

- Remove stale ContentType::Image "stored as base64" doc that no longer
  matches the on-disk-sidecar storage path.
- Promote a dangling `///` between use statements in gui/board/preview.rs
  into a proper module `//!` doc.
- Drop historical 'merged from gui/hotkey_record.rs' marker.
- Drop signature-restating doc comments across repository, updater, i18n,
  gui/board, gui/panel, gui/{tray,theme}, clipboard/writer, config and
  constants modules so symbol names speak for themselves.
- Compress SAFETY blocks in gui/utils.rs and utils/single_instance.rs to
  the actual local invariants (with a shared module-level note in
  gui/utils.rs covering the common preconditions).
- Drop `# Arguments`/`# Returns` boilerplate on self-explanatory APIs in
  config/autostart.rs and `# Usage Example` blocks in
  gui/board/preview.rs.
- Tighten the macOS race-condition note in clipboard/writer.rs and the
  inline subsystem-init markers in app.rs.

Behavior is unchanged; precheck.sh passes locally (cargo check, clippy,
421 tests, machete, i18n/icons/themes).

Refs #76
@StudentWeis StudentWeis force-pushed the docs/76-comment-audit branch from a71188d to a2c1dbd Compare May 6, 2026 08:44
@StudentWeis StudentWeis merged commit ccb724c into main May 6, 2026
8 checks passed
@StudentWeis StudentWeis deleted the docs/76-comment-audit branch May 6, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: audit and clean up low-value comments across src/

1 participant