Device name (jade_id) last character invisibly clipped in deep status bar on Jade Plus
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- embedded-iot
Research direction
Start in main/gui.c at make_status_bar() and render_text(), then check main/process.c for deduce_jade_id(). Reproduce the HOME_SCREEN_DEEP_STATUS_BAR layout on a Jade Plus build under QEMU or on hardware, and verify that the complete device name remains visible or is truncated predictably without an invisible wrapped line.
Written by the indexing model from the issue text.
Description
Describe the bug
On Jade Plus (HOME_SCREEN_DEEP_STATUS_BAR, 320x170 display), the device name shown in the status bar (e.g. Jade ABCDEF) can lose its last character silently. My unit displays only 5 of the 6 hex characters of the device id.
Root cause analysis (from source)
deduce_jade_id()inmain/process.calways generates"Jade "+ 6 uppercase hex chars (11 chars total), derived from the eFuse MAC.- In
make_status_bar()(main/gui.c), whenHOME_SCREEN_DEEP_STATUS_BARis set, the bar is split 65/35; the title lives in the bottom half of the right-hand 35% — roughly a 110px-wide, single-line-height box, rendered withGUI_TITLE_FONT(UBUNTU16_FONT). render_text()renders non-scroll text viadisplay_print_in_area(..., wrap=1). When the string is slightly wider than the box (which happens for ids made of wide glyphs, e.g. all A–F letters), the overflowing character(s) wrap to a second line.- The title box is only one line tall, so the wrapped second line is clipped and never visible. The last character silently disappears.
Whether the id fits depends on the specific glyph widths, so some units show 6 chars and others 5 — which makes the truncation easy to mistake for the actual id.
Expected behavior
The full device id is visible in the status bar (or is at least truncated in a visible/predictable way).
Possible fixes (happy to turn one of these into a PR)
- Widen the name area in the deep status bar split (e.g. 65/35 → 60/40), if the large logo leaves room; or
- Fall back to a narrower font for the status bar title when the string exceeds the box; or
- In
render_text(), when the padded box is less than two font-heights tall, truncate the string to the characters that fit instead of wrapping onto an invisible second line, e.g.:
} else { // without noise
_fg = node->is_selected ? data->selected_color : data->color;
// If the box only fits a single line, don't wrap overflow onto a
// second (clipped, invisible) line - print only the chars that fit.
const int box_w = cs->x2 - cs->x1;
const int box_h = cs->y2 - cs->y1;
char* const text = data->text;
size_t len = strlen(text);
char saved = '\0';
if (box_h < 2 * display_get_font_height()) {
while (len && display_get_string_width(text) > box_w) {
if (saved) {
text[len] = saved;
}
--len;
saved = text[len];
text[len] = '\0';
}
}
display_print_in_area(text, resolve_halign(0, data->halign), resolve_valign(0, data->valign), cs, 1);
if (saved) {
text[len] = saved; // restore
}
}
(Untested proposal — I can build and verify under QEMU / on hardware and submit a PR if one of these directions is acceptable.)
Environment
- Device: Jade Plus (retail), firmware 1.0.41
- Repro: any unit whose 6 id characters are wide glyphs (e.g. all letters A–F)
- Dominant language
- C
- Stars
- 497
- Forks
- 131
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Blockstream/Jade
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Blockstream/Jade#329 · 4 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Blockstream/Jade#317 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Blockstream/Jade#315 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Blockstream/Jade#313 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Blockstream/Jade#345 · 4 comments ·
All issues in Blockstream/Jade
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
hapostgres/pg_auto_failover#1190 ·
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·