Skip to content

fix(ui): replace keyword editor unicode buttons with phosphor icons - #24

Merged
Athemis merged 1 commit into
mainfrom
23-default-font-misses-most-unicode-icons
Dec 5, 2025
Merged

fix(ui): replace keyword editor unicode buttons with phosphor icons#24
Athemis merged 1 commit into
mainfrom
23-default-font-misses-most-unicode-icons

Conversation

@Athemis

@Athemis Athemis commented Dec 5, 2025

Copy link
Copy Markdown
Owner

Summary

  • Fixes non-visible unicode icons by replacing them with icons from Phosphor icon set.

Testing

  • cargo fmt
  • cargo clippy --all-targets --all-features
  • cargo test

Screenshots (if UI changes)

Old

Old behaviour

New

New behaviour

Notes for reviewers

Summary by CodeRabbit

  • Style
    • Updated keyword editing interface to use icon buttons for Save and Cancel actions, replacing previous text labels with phosphor icons for improved visual consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@Athemis Athemis linked an issue Dec 5, 2025 that may be closed by this pull request
@Athemis
Athemis marked this pull request as ready for review December 5, 2025 15:34
@coderabbitai

coderabbitai Bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The rendering of Save and Cancel actions in the keyword editing interface has been refined. Text labels have been replaced with icon buttons utilizing egui_phosphor's CHECK and X icons, while maintaining identical functionality and behavior patterns.

Changes

Cohort / File(s) Summary
Keyword UI Icon Buttons
src/ui/components/keywords.rs
Replaced text-based Save and Cancel action labels ("✔" and "✕") with icon buttons using egui_phosphor CHECK and X icons; behavior and state management unchanged

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Localized UI rendering change affecting only one file
  • No logic modifications or control flow alterations
  • No public API or message signature changes

Poem

✨ Icons now grace the edit, crisp and clear,
Where Picard's wisdom meets design most dear,
From text to symbols, the interface takes flight,
A refined touch makes the keywords shine bright! 🚀

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing unicode buttons with Phosphor icons in the keyword editor UI component.
Description check ✅ Passed The description follows the template structure with completed Summary, Testing checklist, Screenshots for UI changes, and Notes sections.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 23-default-font-misses-most-unicode-icons

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 528311d and d5093e5.

📒 Files selected for processing (1)
  • src/ui/components/keywords.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Entry point at src/main.rs which calls app::run() to start eframe/egui. Add SPDX headers on all source files: SPDX-License-Identifier: MIT plus one or more SPDX-FileCopyrightText lines naming actual authors.
Commands (PickFiles, HashFile, LoadThumbnail, SaveArchive) perform side-effects via run_command and emit follow-up messages back into the update loop for re-rendering.
Follow rustfmt defaults with 4-space indent and trailing commas where appropriate; run cargo fmt before committing.
Use snake_case for functions, variables, and filenames; use CamelCase for types; keep module files small and focused.
Use English language within the codebase.
Use code comments sparingly to explain intent, invariants, or non-obvious control flow; avoid restating what the code already makes clear.
Use rustdoc with /// for public items and //! for module-level docs; start with one-line summary ending with period; structure details with # headings (e.g., # Examples, # Errors, # Panics, # Safety, # Performance).
Include small, runnable examples marked no_run/ignore in rustdoc when side effects exist; keep examples minimal and dependency-free.
In rustdoc, explain invariants, panics, and error cases explicitly; prefer present tense and describe behavior, not intent.
Use intra-doc links in rustdoc like [`TypeName`] or [`module::function`]; disambiguate with full paths when needed.
Document private helpers in rustdoc when it aids maintainers; keep explanations concise.

Files:

  • src/ui/components/keywords.rs
{src/ui/**/*.rs,src/ui/components/**/*.rs}

📄 CodeRabbit inference engine (AGENTS.md)

{src/ui/**/*.rs,src/ui/components/**/*.rs}: UI components in src/ui/ and src/ui/components/* must remain side-effect free and emit messages only; all validation and state transitions belong in src/mvu/ or model/logic modules; IO happens only in commands executed by run_command.
Use Phosphor icons via egui_phosphor::regular::NAME (with RichText or button labels) instead of embedding SVGs. The font is registered in src/main.rs. Keep icon+text buttons short using format!("{} Label", icon) and reuse existing helpers in src/ui.rs.

Files:

  • src/ui/components/keywords.rs
src/ui/components/keywords.rs

📄 CodeRabbit inference engine (AGENTS.md)

src/ui/components/keywords.rs implements keywords editor with inline edits and add-keywords modal.

Files:

  • src/ui/components/keywords.rs
{**/*.rs,tests/**/*.rs}

📄 CodeRabbit inference engine (AGENTS.md)

Use cargo test for unit and integration coverage; colocate simple unit tests with modules and broader scenarios under tests/. Name tests after behavior (e.g., submits_trimmed_input) and keep them deterministic.

Files:

  • src/ui/components/keywords.rs
{src/ui/**/*.rs,src/app/**/*.rs}

📄 CodeRabbit inference engine (AGENTS.md)

No external assets are fetched at runtime; all UI is generated by egui at runtime.

Files:

  • src/ui/components/keywords.rs
{src/mvu/**/*.rs,src/ui/**/*.rs}

📄 CodeRabbit inference engine (AGENTS.md)

File dialog operations use rfd crate for cross-platform native dialogs.

Files:

  • src/ui/components/keywords.rs
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.363Z
Learning: Applies to {src/ui/**/*.rs,src/ui/components/**/*.rs} : Use Phosphor icons via `egui_phosphor::regular::NAME` (with `RichText` or button labels) instead of embedding SVGs. The font is registered in `src/main.rs`. Keep icon+text buttons short using `format!("{} Label", icon)` and reuse existing helpers in `src/ui.rs`.
📚 Learning: 2025-12-03T16:16:45.363Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.363Z
Learning: Applies to src/ui/components/keywords.rs : `src/ui/components/keywords.rs` implements keywords editor with inline edits and add-keywords modal.

Applied to files:

  • src/ui/components/keywords.rs
📚 Learning: 2025-12-03T16:16:45.363Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.363Z
Learning: Applies to {src/ui/**/*.rs,src/ui/components/**/*.rs} : Use Phosphor icons via `egui_phosphor::regular::NAME` (with `RichText` or button labels) instead of embedding SVGs. The font is registered in `src/main.rs`. Keep icon+text buttons short using `format!("{} Label", icon)` and reuse existing helpers in `src/ui.rs`.

Applied to files:

  • src/ui/components/keywords.rs
📚 Learning: 2025-12-03T16:16:45.363Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.363Z
Learning: Applies to src/ui.rs : UI strings live directly in `src/ui.rs` within the egui code; prefer short, actionable labels.

Applied to files:

  • src/ui/components/keywords.rs
📚 Learning: 2025-12-03T16:16:45.363Z
Learnt from: CR
Repo: Athemis/ELNPack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-03T16:16:45.363Z
Learning: Applies to src/ui/components/markdown.rs : `src/ui/components/markdown.rs` implements markdown editor with toolbar, cursor-aware insertions, and text area.

Applied to files:

  • src/ui/components/keywords.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (rust)
🔇 Additional comments (1)
src/ui/components/keywords.rs (1)

242-256: Phosphor icons integrated cleanly; existing behavior intact

The new CHECK and X buttons faithfully mirror the prior ✔/✕ behavior (same hover text, same CommitEdit/CancelEdit messages) while adopting the Phosphor icon set. The component remains purely message-driven and free of side effects—precisely as it should be. Make it so.

Based on learnings, this follows the repository convention to use egui_phosphor::regular::* icons in src/ui components.


Comment @coderabbitai help to get the list of available commands and usage tips.

@Athemis
Athemis merged commit 70210ee into main Dec 5, 2025
10 checks passed
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.

Default font misses most unicode icons

1 participant