Skip to content

Commit 0b73ac4

Browse files
authored
docs(projects): warn that Linear's API rejects emoji for --icon (#147)
* docs(projects): warn that Linear's API rejects emoji for --icon Linear's GraphQL schema docstring claims project icons accept emoji or icon names, but the upstream server-side validator rejects emoji at runtime with a confusing INVALID_INPUT error. Update --icon help text on both `projects create` and `projects update` to recommend named icons (e.g. "Computer", "Database") and call out the schema/runtime mismatch so users — especially LLM consumers — don't get misled. Add regression tests that assert both help screens contain the warning. Closes #146 * docs(projects): document emoji shortcodes as a valid --icon format Follow-up investigation found Linear's API does accept emoji — but only as colon-wrapped shortcodes (`:repeat:`, `:computer:`), not as raw unicode characters (🔁). Two formats work: - Emoji shortcodes: `:repeat:`, `:rocket:`, `:computer:` - Named icons: `Computer`, `Database` Update --icon help to call out both formats and explicitly warn that raw unicode emoji are rejected. Update regression tests to assert the new wording.
1 parent d025801 commit 0b73ac4

2 files changed

Lines changed: 56 additions & 2 deletions

File tree

crates/lineark/src/commands/projects.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub enum ProjectsAction {
7575
/// Markdown content for the project.
7676
#[arg(long)]
7777
content: Option<String>,
78-
/// Project icon (emoji or icon name).
78+
/// Project icon: an emoji shortcode like ":repeat:" (NOT raw unicode 🔁) or a Linear named icon like "Computer". Linear's API rejects raw unicode emoji.
7979
#[arg(long)]
8080
icon: Option<String>,
8181
/// Project color (hex color code).
@@ -131,7 +131,7 @@ pub enum ProjectsAction {
131131
/// Project status name or UUID.
132132
#[arg(long)]
133133
status: Option<String>,
134-
/// Project icon (emoji or icon name).
134+
/// Project icon: an emoji shortcode like ":repeat:" (NOT raw unicode 🔁) or a Linear named icon like "Computer". Linear's API rejects raw unicode emoji.
135135
#[arg(long)]
136136
icon: Option<String>,
137137
/// Project color (hex color code).

crates/lineark/tests/offline.rs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,60 @@ fn projects_create_help_shows_flags() {
522522
.stdout(predicate::str::contains("--color"));
523523
}
524524

525+
/// Regression test for #146: `--icon` help text must document the two
526+
/// formats Linear's API actually accepts — emoji *shortcodes* (`:repeat:`)
527+
/// and named icons (`Computer`) — and warn that raw unicode emoji (`🔁`)
528+
/// are rejected at runtime despite the GraphQL schema docstring claiming
529+
/// otherwise. Without this, users (especially LLM consumers) reach for
530+
/// raw unicode and hit a confusing `INVALID_INPUT` error from the
531+
/// upstream validator.
532+
#[test]
533+
fn projects_create_help_icon_documents_accepted_formats() {
534+
lineark()
535+
.args(["projects", "create", "--help"])
536+
.assert()
537+
.success()
538+
.stdout(predicate::str::contains(":repeat:"))
539+
.stdout(predicate::str::contains("Computer"))
540+
.stdout(predicate::str::contains("rejects raw unicode emoji"));
541+
}
542+
543+
#[test]
544+
fn projects_update_help_shows_flags() {
545+
lineark()
546+
.args(["projects", "update", "--help"])
547+
.assert()
548+
.success()
549+
.stdout(predicate::str::contains("--name"))
550+
.stdout(predicate::str::contains("--description"))
551+
.stdout(predicate::str::contains("--content"))
552+
.stdout(predicate::str::contains("--lead"))
553+
.stdout(predicate::str::contains("--clear-lead"))
554+
.stdout(predicate::str::contains("--members"))
555+
.stdout(predicate::str::contains("--team"))
556+
.stdout(predicate::str::contains("--start-date"))
557+
.stdout(predicate::str::contains("--clear-start-date"))
558+
.stdout(predicate::str::contains("--target-date"))
559+
.stdout(predicate::str::contains("--clear-target-date"))
560+
.stdout(predicate::str::contains("--priority"))
561+
.stdout(predicate::str::contains("--status"))
562+
.stdout(predicate::str::contains("--icon"))
563+
.stdout(predicate::str::contains("--color"))
564+
.stdout(predicate::str::contains("--labels"));
565+
}
566+
567+
/// Regression test for #146 — same documentation must appear on `update` help.
568+
#[test]
569+
fn projects_update_help_icon_documents_accepted_formats() {
570+
lineark()
571+
.args(["projects", "update", "--help"])
572+
.assert()
573+
.success()
574+
.stdout(predicate::str::contains(":repeat:"))
575+
.stdout(predicate::str::contains("Computer"))
576+
.stdout(predicate::str::contains("rejects raw unicode emoji"));
577+
}
578+
525579
#[test]
526580
fn projects_list_help_shows_led_by_me_flag() {
527581
lineark()

0 commit comments

Comments
 (0)