(3b7edd7) Show priority as a glyph, and bump to 0.2.0
A bare digit in a listing is easy to skip over. Levels render as a two-segment meter that empties as the level rises: ●● 1, ●◐ 2, ●○ 3, ◐○ 4, ○○ 5, with ·· for unset and ?? for a value outside the range. Only ●, ◐, ○ and · are used, because they are what frig draws for its status indicators and so are known to be in the terminal font. The first cut of this used the quadrant circles ◕ and ◔, which are in a quarter as many fonts, so terminals substituted them from a fallback that drew them oversized and the column came out ragged. Two cells of a three-level ramp gives five steps of ink, 2, 1.5, 1, 0.5, 0, without leaving that safe set. Tests pin the safe set, the equal width and the monotonic emptying. The mark carries the level on its own, because colour cannot. Output is colourless whenever it is piped, which is how the opencode tools and every script read it, and NO_COLOR turns it off in a terminal too. Colour only accentuates: brightred, red, orange, cyan, grey, skipping green because green means title. The number counts up while the meter empties, since 1 is the most urgent. That is the convention, but it reads as a bug unless written down, so it is in AGENTS.md and in the legend. Both the ramp and the legend come from priority_mark, and `ls --help` prints the legend, since nothing in a listing explains a mark. brightred is indexed like grey, for the same reason: it is the spelling that renders. Minor bump: two new flags, a new metadata field and a changed ls row, covering dca0b61 and this ticket. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
ddbd45e332
commit
2503f9aee9
+8
-1
@@ -1,6 +1,12 @@
|
||||
use clap::Parser;
|
||||
|
||||
use crate::util::PRIORITY_RANGE;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use crate::util::{PRIORITY_RANGE, priority_legend};
|
||||
|
||||
/// clap wants a `&str` with a long enough lifetime, and the legend is built from
|
||||
/// the same ramp the listing uses rather than spelled out a second time.
|
||||
static PRIORITY_LEGEND: LazyLock<String> = LazyLock::new(priority_legend);
|
||||
|
||||
/// Reject a level outside the range at parse time, so no command has to.
|
||||
fn priority_level(raw: &str) -> Result<u8, String> {
|
||||
@@ -72,6 +78,7 @@ pub enum Command {
|
||||
},
|
||||
|
||||
/// List tickets, optionally filtered by status
|
||||
#[command(after_help = PRIORITY_LEGEND.as_str())]
|
||||
Ls {
|
||||
/// Filter by status (backlog, committed, reviewing, done)
|
||||
status: Option<String>,
|
||||
|
||||
Reference in New Issue
Block a user