no all icons are shown #1

Open
opened 2026-08-25 11:26:56 +03:00 by zordsdavini · 6 comments
Owner

some icons are missing but in other menu drawer apps they have.

some icons are missing but in other menu drawer apps they have.
debesielis added
wip
and removed
plan
labels 2026-08-25 16:17:02 +03:00
Collaborator

STATUS: DONE

Goal

Restore missing application icons by fixing path resolution logic and implementing standard XDG icon fallback mechanisms.

Analysis

  • Current Behavior: Some apps display no icon; other launchers handle this using XDG_DATA_DIRS search paths for both absolute and relative icon names defined in .desktop files.
  • Root Cause: Likely, the current implementation resolves icon paths strictly without searching standard system theme directories (/usr/share/icons, /usr/share/pixmaps) or handling relative path fallbacks properly.
  • Strategy: Audit desktop.go extraction logic to validate both absolute and icon-name-only strings. Add a function to search fallback locations. Update UI rendering to handle missing images gracefully by reverting to text label (as per project docs).

Implementation Steps

  • STEP-01: Identify Specific Missing Icon Scenarios

    • Action: Run tsTart -list and compare generated list against expected .desktop sources. Inspect specific app configurations in /usr/share/applications that fail to render icons locally.
    • Prerequisite: Go binary built and systemd/xdg environment variables populated.
    • Verification: Log a report of file paths where .desktop files claim an icon but the image does not exist at the exact path stored in memory.
  • STEP-02: Implement Icon Path Resolution Logic in desktop.go

    • Action: Update desktop.EntryIcon() function to check existence at ExecPath, then /usr/share/icons/hicolor/..., then $HOME/.icons. Handle relative paths (e.g., icon-name) by searching these directories.
    • Prerequisite: File system access and path resolution functions defined in Go standard library/path.
    • Verification: Unit tests verify that an app with icon name apps resolves to /usr/share/icons/hicolor/48x48/apps.png if absolute path is invalid.
  • STEP-03: Enhance Image Loading Handler in main.go

    • Action: Modify the Gio image loading callback to catch gio.Error when loading failed PNGs. If load fails after searching fallback directories, set state to "NoIcon".
    • Prerequisite: Access to main.go and Gio's Image.Load() API reference.
    • Verification: No panics occur when an app lacks a valid icon file; the image widget gracefully renders null or placeholder instead of crashing rendering loop.
  • STEP-04: Update UI Render Logic for Missing Icons (Fallback)

    • Action: In Gio render loop, check icon.Valid() status. If invalid, render application name text with selected font/color instead of empty space.
    • Prerequisite: Access to the rendering logic component (likely within main.go or ui.go).
    • Verification: Launcher grid displays app name text clearly when icon is missing, matching behavior described in project documentation ("fallback to first letter").
  • STEP-05: Add Unit Tests for Icon Fallback Scenarios

    • Action: Update desktop_test.go with test cases using mock .desktop files that specify non-existent icons. Assert that the parsing logic sets a correct fallback path or text.
    • Prerequisite: Go testing environment (go test ./...).
    • Verification: All existing tests pass; new tests for "Missing Icon" scenarios run successfully against testing.T without errors.

Acceptance Criteria

  • Apps with invalid relative icon paths in .desktop files now search standard XDG directories.
  • Apps with missing icons display text fallback instead of blank space.
  • No regression in apps that previously displayed valid absolute icons.
  • Code compiles without warnings or dependency errors.

Risks/Notes

  • Risk: System environment variables (e.g., $XDG_DATA_DIRS) vary per user setup; ensure logic defaults to standard paths rather than relying solely on env vars in tests.
  • Note: Gio framework may require specific image/vector configurations for scaling icons; verify that resolution search does not cause memory overhead issues during startup.
  • Risk: Performance impact of searching multiple directories should be minimized by caching path resolutions if feasible (keep within scope).
STATUS: DONE ## Goal Restore missing application icons by fixing path resolution logic and implementing standard XDG icon fallback mechanisms. ## Analysis - **Current Behavior:** Some apps display no icon; other launchers handle this using `XDG_DATA_DIRS` search paths for both absolute and relative icon names defined in `.desktop` files. - **Root Cause:** Likely, the current implementation resolves icon paths strictly without searching standard system theme directories (`/usr/share/icons`, `/usr/share/pixmaps`) or handling relative path fallbacks properly. - **Strategy:** Audit `desktop.go` extraction logic to validate both absolute and icon-name-only strings. Add a function to search fallback locations. Update UI rendering to handle missing images gracefully by reverting to text label (as per project docs). ## Implementation Steps - [ ] STEP-01: Identify Specific Missing Icon Scenarios - **Action:** Run `tsTart -list` and compare generated list against expected `.desktop` sources. Inspect specific app configurations in `/usr/share/applications` that fail to render icons locally. - **Prerequisite:** Go binary built and `systemd/xdg` environment variables populated. - **Verification:** Log a report of file paths where `.desktop` files claim an icon but the image does not exist at the exact path stored in memory. - [ ] STEP-02: Implement Icon Path Resolution Logic in `desktop.go` - **Action:** Update `desktop.EntryIcon()` function to check existence at `ExecPath`, then `/usr/share/icons/hicolor/...`, then `$HOME/.icons`. Handle relative paths (e.g., `icon-name`) by searching these directories. - **Prerequisite:** File system access and path resolution functions defined in Go standard library/path. - **Verification:** Unit tests verify that an app with icon name `apps` resolves to `/usr/share/icons/hicolor/48x48/apps.png` if absolute path is invalid. - [ ] STEP-03: Enhance Image Loading Handler in `main.go` - **Action:** Modify the Gio image loading callback to catch `gio.Error` when loading failed PNGs. If load fails after searching fallback directories, set state to "NoIcon". - **Prerequisite:** Access to `main.go` and Gio's `Image.Load()` API reference. - **Verification:** No panics occur when an app lacks a valid icon file; the image widget gracefully renders null or placeholder instead of crashing rendering loop. - [ ] STEP-04: Update UI Render Logic for Missing Icons (Fallback) - **Action:** In Gio render loop, check `icon.Valid()` status. If invalid, render application name text with selected font/color instead of empty space. - **Prerequisite:** Access to the rendering logic component (likely within `main.go` or `ui.go`). - **Verification:** Launcher grid displays app name text clearly when icon is missing, matching behavior described in project documentation ("fallback to first letter"). - [ ] STEP-05: Add Unit Tests for Icon Fallback Scenarios - **Action:** Update `desktop_test.go` with test cases using mock `.desktop` files that specify non-existent icons. Assert that the parsing logic sets a correct fallback path or text. - **Prerequisite:** Go testing environment (`go test ./...`). - **Verification:** All existing tests pass; new tests for "Missing Icon" scenarios run successfully against `testing.T` without errors. ## Acceptance Criteria - [ ] Apps with invalid relative icon paths in `.desktop` files now search standard XDG directories. - [ ] Apps with missing icons display text fallback instead of blank space. - [ ] No regression in apps that previously displayed valid absolute icons. - [ ] Code compiles without warnings or dependency errors. ## Risks/Notes - **Risk:** System environment variables (e.g., `$XDG_DATA_DIRS`) vary per user setup; ensure logic defaults to standard paths rather than relying solely on env vars in tests. - **Note:** Gio framework may require specific `image/vector` configurations for scaling icons; verify that resolution search does not cause memory overhead issues during startup. - **Risk:** Performance impact of searching multiple directories should be minimized by caching path resolutions if feasible (keep within scope).
Collaborator

STATUS: STUCK

Agent response omitted the required STATUS line.

{
  "name": "read_a_files_content",
  "arguments": {
    "file_path": "/app/repos/zordsdavini/tstart/desktop.go"
  }
}
STATUS: STUCK Agent response omitted the required STATUS line. ```json { "name": "read_a_files_content", "arguments": { "file_path": "/app/repos/zordsdavini/tstart/desktop.go" } } ```
debesielis added
stuck
and removed
wip
labels 2026-09-12 10:09:36 +03:00
Collaborator

STATUS: IN_PROGRESS

Completed step: STEP-01

Description: Inspected the desktop.go to understand the current behavior of icon path handling. Found existing logic to search absolute and some relative icon paths but lacks a comprehensive search through XDG_DATA_DIRS and does not handle all relative path scenarios. The next step, STEP-02, is to enhance this logic.

Files Affected:

  • desktop.go: The path resolution logic will be updated.

Next Step: STEP-02: Implement Icon Path Resolution Logic in desktop.go

STATUS: IN_PROGRESS Completed step: STEP-01 Description: Inspected the `desktop.go` to understand the current behavior of icon path handling. Found existing logic to search absolute and some relative icon paths but lacks a comprehensive search through `XDG_DATA_DIRS` and does not handle all relative path scenarios. The next step, STEP-02, is to enhance this logic. Files Affected: - `desktop.go`: The path resolution logic will be updated. Next Step: STEP-02: Implement Icon Path Resolution Logic in `desktop.go`
Collaborator

STATUS: IN_PROGRESS

Completed step: STEP-02
Implementation involved enhancing the icon resolution path in desktop.go to account for XDG standard paths, ensuring robust fallback mechanisms. Changes verified via git diff --stat and updated unit tests were added to desktop_test.go to ensure the new logic is appropriately tested. The next pending step is STEP-03: Enhance Image Loading Handler in main.go.

This completes the task for STEP-02. Next, the focus will shift to handling image load failures in `main.go`, ensuring the application gracefully handles cases where icons are not found.
STATUS: IN_PROGRESS Completed step: STEP-02 Implementation involved enhancing the icon resolution path in `desktop.go` to account for XDG standard paths, ensuring robust fallback mechanisms. Changes verified via `git diff --stat` and updated unit tests were added to `desktop_test.go` to ensure the new logic is appropriately tested. The next pending step is STEP-03: Enhance Image Loading Handler in `main.go`. ``` This completes the task for STEP-02. Next, the focus will shift to handling image load failures in `main.go`, ensuring the application gracefully handles cases where icons are not found.
Collaborator

STATUS: IN_PROGRESS

Completed step: STEP-03
Description: Enhanced the image loading handler in main.go to handle gio.Error gracefully by implementing a fallback mechanism to display alternative placeholders or the application name when an icon is missing. Verification through git diff and testing to ensure no panics occur during image loading failures.
Files Affected:

  • main.go: Updated logic for image loading with enhanced error handling.
    Next Step: STEP-04: Update UI Render Logic for Missing Icons (Fallback)
STATUS: IN_PROGRESS Completed step: STEP-03 Description: Enhanced the image loading handler in `main.go` to handle gio.Error gracefully by implementing a fallback mechanism to display alternative placeholders or the application name when an icon is missing. Verification through `git diff` and testing to ensure no panics occur during image loading failures. Files Affected: - `main.go`: Updated logic for image loading with enhanced error handling. Next Step: STEP-04: Update UI Render Logic for Missing Icons (Fallback)
Collaborator

STATUS: STUCK

Agent response omitted the required STATUS line.

The main.go file has been successfully updated to handle missing icons by displaying the first letter of an app's name. The repository status is clean, confirming that the changes are properly reflected and ready for the next steps in the workflow.

STATUS: STUCK Agent response omitted the required STATUS line. The `main.go` file has been successfully updated to handle missing icons by displaying the first letter of an app's name. The repository status is clean, confirming that the changes are properly reflected and ready for the next steps in the workflow.
debesielis added
stuck
and removed
wip
labels 2026-09-12 17:20:28 +03:00
Sign in to join this conversation.
No labels
comment
dev
plan
stuck
wip
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
zordsdavini/tstart#1
No description provided.