Skip to content

Commit 1783639

Browse files
betegonclaude
andcommitted
refactor(project): use header instead of log.warn for org fallback message
Show the org-fallback note as a clean header in the table output instead of a debug-style log.warn with timestamps and tags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9acfe35 commit 1783639

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/commands/project/list.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import {
4444
LIST_TARGET_POSITIONAL,
4545
targetPatternExplanation,
4646
} from "../../lib/list-command.js";
47-
import { logger } from "../../lib/logger.js";
4847
import {
4948
dispatchOrgScopedList,
5049
jsonTransformListResult,
@@ -59,8 +58,6 @@ import {
5958
import { getApiBaseUrl } from "../../lib/sentry-client.js";
6059
import type { SentryProject } from "../../types/index.js";
6160

62-
const log = logger.withTag("project-list");
63-
6461
/** Command key for pagination cursor storage */
6562
export const PAGINATION_KEY = "project-list";
6663

@@ -530,21 +527,20 @@ export async function handleProjectSearch(
530527
// Check if slug matches an org — user likely meant "project list <org>/"
531528
const matchingOrg = orgs.find((o) => o.slug === projectSlug);
532529
if (matchingOrg) {
533-
log.warn(
534-
`'${projectSlug}' is an organization, not a project. ` +
535-
`Listing all projects in '${projectSlug}'.`
536-
);
537530
const contextKey = buildContextKey(
538531
{ type: "org-all", org: projectSlug },
539532
flags,
540533
getApiBaseUrl()
541534
);
542-
return handleOrgAll({
535+
const result = await handleOrgAll({
543536
org: projectSlug,
544537
flags,
545538
contextKey,
546539
cursor: undefined,
547540
});
541+
const note = `'${projectSlug}' is an organization, not a project. Showing all projects in '${projectSlug}'.`;
542+
result.header = result.header ? `${note}\n${result.header}` : note;
543+
return result;
548544
}
549545

550546
// JSON mode returns empty array; human mode throws a helpful error

0 commit comments

Comments
 (0)