Per-session icon: decide whether it is wanted #10

Open
opened 2026-08-19 23:56:02 +00:00 by dusan · 0 comments
Owner

Context

A sidebar row's icon comes from the session's type:
SessionKind::icon_name in crates/terminalko-config/src/session.rs maps local,
ssh, container and root to utilities-terminal-symbolic,
network-server-symbolic, package-x-generic-symbolic and
security-high-symbolic. rebuild_sidebar uses it for both the sidebar item and
the tab page.

The gap, and a correction

The original plan listed a per-session icon key. It was never added — there is
no unused key in the schema; an earlier note claiming otherwise was wrong.

So this is a feature request rather than a loose end: let a session carry its own
icon, so a row can say this is the database one at a glance rather than only
this is a container.

Whether it is worth doing

Weigh it against what already distinguishes rows: the name, the accent colour
(nine choices), the type icon, and — since the foreground-process work — a
subtitle naming what is running. A per-session icon may be redundant, and an icon
chooser is a surprising amount of UI. Deciding not to do this is a perfectly
good outcome; if so, close this and say why in docs/spec/session-sidebar.md so
it is not proposed again.

Approach, if it is wanted

  • add icon (type s, default empty) to
    data/me.dusansimic.terminalko.session.gschema.xml, plus an accessor pair on
    Session returning Option<String>;
  • sidebar_item and the tab page prefer it and fall back to the type icon;
  • the editor needs a way to choose one. A free-text entry for an icon name is
    honest and cheap but assumes the user knows icon names; a grid of a couple of
    dozen symbolic icons that ship with adwaita-icon-theme is friendlier and more
    work. Pick one and say why in the spec;
  • an icon name that the theme does not have must fall back rather than show a
    broken-image glyph — check with gtk::IconTheme::has_icon.

Acceptance criteria

  • A session with its own icon shows it in the sidebar and on its tab page; one
    without shows its type icon.
  • An icon name that does not exist falls back to the type icon.
  • The choice survives a restart, and is included by Duplicate (issue #8) if that
    has landed.
  • docs/spec/session-sidebar.md records the decision either way.

Notes

  • BSD-2 rules in CONTRIBUTING.md apply.
## Context A sidebar row's icon comes from the session's **type**: `SessionKind::icon_name` in `crates/terminalko-config/src/session.rs` maps local, ssh, container and root to `utilities-terminal-symbolic`, `network-server-symbolic`, `package-x-generic-symbolic` and `security-high-symbolic`. `rebuild_sidebar` uses it for both the sidebar item and the tab page. ## The gap, and a correction The original plan listed a per-session `icon` key. It was never added — there is **no unused key in the schema**; an earlier note claiming otherwise was wrong. So this is a feature request rather than a loose end: let a session carry its own icon, so a row can say *this is the database one* at a glance rather than only *this is a container*. ## Whether it is worth doing Weigh it against what already distinguishes rows: the name, the accent colour (nine choices), the type icon, and — since the foreground-process work — a subtitle naming what is running. A per-session icon may be redundant, and an icon chooser is a surprising amount of UI. Deciding *not* to do this is a perfectly good outcome; if so, close this and say why in `docs/spec/session-sidebar.md` so it is not proposed again. ## Approach, if it is wanted * add `icon` (type `s`, default empty) to `data/me.dusansimic.terminalko.session.gschema.xml`, plus an accessor pair on `Session` returning `Option<String>`; * `sidebar_item` and the tab page prefer it and fall back to the type icon; * the editor needs a way to choose one. A free-text entry for an icon name is honest and cheap but assumes the user knows icon names; a grid of a couple of dozen symbolic icons that ship with adwaita-icon-theme is friendlier and more work. Pick one and say why in the spec; * an icon name that the theme does not have must fall back rather than show a broken-image glyph — check with `gtk::IconTheme::has_icon`. ## Acceptance criteria - A session with its own icon shows it in the sidebar and on its tab page; one without shows its type icon. - An icon name that does not exist falls back to the type icon. - The choice survives a restart, and is included by *Duplicate* (issue #8) if that has landed. - `docs/spec/session-sidebar.md` records the decision either way. ## Notes - BSD-2 rules in `CONTRIBUTING.md` apply.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
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
dusan/terminalko#10
No description provided.