Skip to content

fix(cards): give a link-titled card a readable name at once - #81

Merged
kvaps merged 1 commit into
mainfrom
fix/link-title-async
Jul 27, 2026
Merged

fix(cards): give a link-titled card a readable name at once#81
kvaps merged 1 commit into
mainfrom
fix/link-title-async

Conversation

@kvaps

@kvaps kvaps commented Jul 27, 2026

Copy link
Copy Markdown
Member

Problem

Creating a card from a pasted GitHub link left the raw URL on screen, and people reloaded the page to get a readable name. Reported as: «когда пользователь копирует ссылку в название карточки она превращается в осмысленное название не сразу, а после перезагрузки страницы».

Two causes stacked up:

  1. The create blocked on a GitHub round trip to fetch the item's title, so the optimistic card showed the URL for the whole request.
  2. The client's optimistic card rendered exactly what was typed — the URL — until the response landed.

Fix

The create no longer waits on GitHub. It answers immediately under the same readable Pull: owner/repo#N fallback the server already used for unresolvable links, and a background pass fetches the real title and renames the card (measured on a dev board: fallback at once, real title ~1s later).

Two guards keep that honest:

  • A person's words win: the background rename re-reads the card and only replaces the untouched fallback, so a card retitled meanwhile (by a human or an agent over MCP) is left alone.
  • The creating tab actually sees it: watch frames echo-suppress against the originating client, which would have hidden the rename from the very person who created the card — until a reload, exactly as reported. Server-side work on nobody's behalf is now marked board.Unattributed, and the watch layer broadcasts it to everyone.

The client mirrors the same label (optimisticTitle, the TS twin of board.Link.FallbackTitle) in every optimistic card — Me zones, Team grid, weekly plan and both subtask forms — so the raw URL never shows, not even for the length of the create.

The background work is detached from the request (context.WithoutCancel + a 30s timeout), and its launch point is a swappable spawn so tests run it inline.

Testing

  • TestCreateCardFromGitHubURL — create answers under the fallback, the background pass renames to the real title.
  • TestCreateCardFromURLKeepsUserRename — a card retitled before the resolve lands keeps the person's wording; no rename call is made.
  • TestUnattributedWorkIsNotEchoSuppressed — unattributed work carries no origin, so nothing is echo-suppressed.
  • TestAPICreateCardFromGitHubURL — end-to-end over HTTP: instant fallback, then the resolved title.
  • 4 new web tests for optimisticTitle (PR URL, issue URL, owner/repo#N shorthand, and leaving the user's own wording alone).
  • Verified live on a dev board with both a public and a private repo link; full Go + web suites and golangci-lint pass.

Creating a card from a pasted GitHub link left the raw URL on screen:
the create blocked on a GitHub round trip to fetch the item's title, so
the optimistic card sat there as a URL for seconds — long enough that
people reloaded the page to get a readable name.

The create no longer waits on GitHub. It answers immediately under the
same readable 'Pull: owner/repo#N' fallback the server already used for
unresolvable links, and a background pass fetches the real title and
renames the card. Two guards keep that honest: a card retitled by a
person (or an agent) meanwhile is left alone, and the rename is marked
unattributed so its watch frame reaches the creating tab too instead of
being echo-suppressed into invisibility.

The client mirrors the same label in its optimistic card, so the raw
URL never shows even for the length of the create.

Assisted-By: Claude
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps
kvaps marked this pull request as ready for review July 27, 2026 12:06
@kvaps
kvaps merged commit be69b71 into main Jul 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant