Skip to content

ref: Inline getTitleFromLocation helper function#115441

Open
ryan953 wants to merge 2 commits into
masterfrom
claude/inline-get-title-function-szls2
Open

ref: Inline getTitleFromLocation helper function#115441
ryan953 wants to merge 2 commits into
masterfrom
claude/inline-get-title-function-szls2

Conversation

@ryan953
Copy link
Copy Markdown
Member

@ryan953 ryan953 commented May 12, 2026

Description

This PR removes the getTitleFromLocation helper function and inlines its implementation at call sites. The function was a simple wrapper around decodeScalar(location.query?.[key]) that added minimal value.

Changes

  • Removed getTitleFromLocation from static/app/views/explore/contexts/pageParamsContext/title.tsx (entire file deleted)
  • Removed getTitleFromLocation from static/app/views/explore/queryParams/savedQuery.ts
  • Updated 7 files to inline the decodeScalar call directly:
    • useAnalytics.tsx
    • useSaveMultiQuery.tsx
    • metrics/content.tsx
    • metrics/hooks/useSaveMetricsMultiQuery.tsx
    • multiQueryMode/index.tsx
    • replays/list/replayQueryParamsProvider.tsx
    • spans/spansQueryParams.tsx
    • logs/logsQueryParams.tsx

All call sites now use decodeScalar(location.query?.[key]) or decodeScalar(location.query.title) directly, making the code more straightforward and reducing unnecessary indirection.

Test Plan

Existing tests should continue to pass. This is a straightforward refactoring that doesn't change any behavior—it only removes a thin wrapper function.

https://claude.ai/code/session_01Ku9kxsErPUgdjanXCu9rh2

@ryan953 ryan953 requested review from a team as code owners May 12, 2026 22:05
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.50%

@ryan953 ryan953 changed the title Inline getTitleFromLocation helper function ref: Inline getTitleFromLocation helper function May 12, 2026
Copy link
Copy Markdown
Member

@priscilawebdev priscilawebdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🧹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants