Skip to content

Show state next to location in public Courses UI - #1194

Draft
rustynwac wants to merge 1 commit into
mainfrom
claude/triage-1193-nnopob
Draft

Show state next to location in public Courses UI#1194
rustynwac wants to merge 1 commit into
mainfrom
claude/triage-1193-nnopob

Conversation

@rustynwac

@rustynwac rustynwac commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

The public Courses listing (rendered via CoursePreviewSmallRow) shows a single location string next to the map-pin icon. Because a Course's location.placeName is a required field, the previous helper always returned placeName on its own and the state value was effectively never displayed. This change appends the location's two-letter state abbreviation to the displayed text when it is set (e.g. Bellingham Ski Shop, WA), for both the placeName and city branches. When no state is present, the display is unchanged.

Related Issues

Fixes #1193

Key Changes

  • src/components/CoursePreviewSmallRow.tsx: Reworked the getLocationText() helper so that when location.state is present it appends , {state} to whichever of placeName/city is shown. Behavior is unchanged when there is no state (no trailing comma/space), when only a state is set, and when there is no location.

How to test

  1. Run the public Courses embed (A3 course list) for a tenant with course data.
  2. A course whose location has a placeName and a state shows {placeName}, {state} (e.g. Bellingham Ski Shop, WA).
  3. A course with a city and a state (no placeName) shows {city}, {state}.
  4. A course with a placeName but no state shows just {placeName} (no trailing comma/space).
  5. A course with only a state shows the state alone; a course with no location renders no location line.
  6. pnpm tsc and pnpm lint both pass.

Screenshots / Demo video

N/A — text-only location tweak (appends the state abbreviation to the existing location line; no styling or icon changes).

Migration Explanation

N/A — no schema changes.

Future enhancements / Questions

  • Could optionally display the full spelled-out state name instead of the abbreviation, but that is out of scope here.

🤖 Generated with Claude Code


Generated by Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Append ", {state}" to the course location text when the location's
state is set, covering both the placeName and city branches of the
location helper. When no state is present the display is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N6dNLcBLhKetQwKErRNefe
@github-actions

Copy link
Copy Markdown
Contributor

Preview deployment: https://claudextriage-1193-nnopob.preview.avy-fx.org

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.

Show State next to Location in Courses public UI

2 participants