Skip to content

feat(list): surface favorited projects first in railway list - #1166

Merged
fcx-railway merged 2 commits into
masterfrom
feat/list-favorites
Sep 2, 2026
Merged

feat(list): surface favorited projects first in railway list#1166
fcx-railway merged 2 commits into
masterfrom
feat/list-favorites

Conversation

@fcx-railway

@fcx-railway fcx-railway commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Favorited projects render first in railway list, marked with a star, and carry an is_favorite
flag in --json. Dashboard parity

CleanShot 2026-09-02 at 18 32 40@2x

Two queries joined client-side — projectFavorites hangs off Query and takes one workspace, so
it can't live inside UserProjects. Lookups run concurrently, bounded at 6.

A favorites failure never breaks railway list or changes its output. The field needs a user
principal and is refused for workspace- and project-scoped tokens, and can be gated off by a
rollout flag. Every failure collapses to "no favorites" for that workspace, independently, and
silently — on a project token the refusal is the expected outcome on every run.

Verified live rather than argued; the test account has favorites in one of three workspaces, so one
run covers both branches:

Workspace Favorites Result
Railway 4 starred, sorted first, aligned
Raildev 0 byte-identical to pre-favorites output

⚠️ For reviewers: the backend is deployed (mono#37618, confirmed by introspecting prod), but
that's only the subgraph exposure. The auth hardening (isUserAuthenticated) is in mono#37601,
still open
— so a workspace-scoped token may currently succeed here rather than be refused.
This code is correct either way; it never depends on a refusal.

src/gql/schema.json gains only the one field, not a full re-introspection — verified structurally
that nothing outside Query.fields changed.

Tests 1331 → 1336 (+5); same 2 pre-existing iac failures (need node, absent locally)
Gates build, fmt, lint-fix, clippy -D warnings — all exit 0
Review Codex, 2 roundtrips; 1 MEDIUM found and fixed; closed clean

Full evidence: https://gist.github.com/fcx-railway/4bc9cda9cd96bd3b72581f0d61c3192b

Favoriting/unfavoriting is out of scope — per Mahmoud, railway api is the escape hatch.


🤖 Generated with Claude Code

fcx-railway and others added 2 commits September 2, 2026 18:10
Dashboard parity: favorites render at the top of their workspace, marked
with a star, and carry an `is_favorite` flag in `--json`.

Favorites are fetched with a second query and joined client-side rather
than being added as a field on `Project`. `projectFavorites` hangs off
`Query` and takes one workspace, so it cannot be selected inside the
existing `UserProjects` document; the listing walks every workspace, so
the lookups run concurrently with a bound.

Every favorites failure degrades to "no favorites" instead of
propagating. The field requires a user principal and is refused for the
workspace- and project-scoped tokens `railway list` must keep serving,
and it can additionally be gated off by a feature flag — so a caller
that cannot read favorites gets exactly the listing it got before.

`src/gql/schema.json` gains only the one `projectFavorites` field rather
than a full re-introspection, which would have dragged unrelated
upstream drift into the diff.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Padding every non-favorite to the star's width shifted the whole
listing two columns right — including for callers the favorites field
refuses, whose output must not change at all. Reserve the marker's
width only in a workspace that actually has a favorite to show, so a
mixed workspace still aligns into one column while a workspace with
none renders exactly as it did before favorites existed.

Found by Codex in review. Also picks up rustfmt on the test fixture
added in the previous commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@fcx-railway fcx-railway added the release/minor Author minor release label Sep 2, 2026
@fcx-railway
fcx-railway merged commit a2f8bb5 into master Sep 2, 2026
7 of 8 checks passed
@fcx-railway
fcx-railway deleted the feat/list-favorites branch September 2, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/minor Author minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant