Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/src/processors/query/timelineFeed.processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { JourneyGoal } from "../../types/journey/Journey.types.js";

export interface RelevantJourney {
username: string;
displayName?: string | null;
summary: string;
expertiseAreas: string[];
imageUrl?: string | null;
Expand Down Expand Up @@ -77,6 +78,7 @@ export function buildTimelineFeed(

return {
username: journey.username,
displayName: journey.displayName?.trim() || null,
summary: journey.summary,
expertiseAreas: journey.expertiseAreas,
imageUrl: journey.imageUrl,
Expand Down
3 changes: 3 additions & 0 deletions backend/src/services/journeyRetrieval.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { closeSession, getSession } from "./neo4j.service.js";

export interface RetrievedJourney {
username: string;
displayName?: string | null;
summary: string;
expertiseAreas: string[];
imageUrl: string | null;
Expand All @@ -27,6 +28,7 @@ export async function retrieveJourneys(

RETURN
u.username AS username,
u.displayName AS displayName,
u.summary AS summary,
u.expertiseAreas AS expertiseAreas,
u.imageUrl AS imageUrl,
Expand All @@ -40,6 +42,7 @@ export async function retrieveJourneys(

return result.records.map((record) => ({
username: record.get("username") as string,
displayName: (record.get("displayName") as string | null) ?? null,

summary:
(record.get("summary") as string) ?? "",
Expand Down
14 changes: 14 additions & 0 deletions backend/tests/displayName.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { buildTimelineFeed } from '../src/processors/query/timelineFeed.processor.js';
function feed(displayName?: string | null) {
return buildTimelineFeed({journeys:[{username:'test1',displayName,summary:'Example',expertiseAreas:[],imageUrl:null,reputationScore:0,experienceIds:['e1']}], experiences:[{id:'e1', title:'Project',goalIds:[],transitions:[],skills:[]}],goals:[]} as any)[0]!;
}
test('display name does not change stable journey username', () => {
const result=feed(' Rohinth ');
assert.equal(result.displayName,'Rohinth');
assert.equal(result.username,'test1');
});
test('legacy and empty display names remain absent', () => {
for (const name of [undefined,null,'',' ']) assert.equal(feed(name).displayName,null);
});
4 changes: 2 additions & 2 deletions frontend/app/results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ export default function ResultsPage() {
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 16 }}>
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 12 }}>
<View style={{ width: 44, height: 44, borderRadius: 22, backgroundColor: L.teal, alignItems: 'center', justifyContent: 'center' }}>
<Text style={{ fontSize: 18, color: '#FFFFFF', fontFamily: 'Manrope_700Bold' }}>{user.username.charAt(0).toUpperCase()}</Text>
<Text style={{ fontSize: 18, color: '#FFFFFF', fontFamily: 'Manrope_700Bold' }}>{(user.displayName?.trim() || user.username).charAt(0).toUpperCase()}</Text>
</View>
<Text style={{ fontFamily: 'Manrope_700Bold', fontSize: 16, color: UI.foreground }}>@{user.username}</Text>
<Text style={{ fontFamily: 'Manrope_700Bold', fontSize: 16, color: UI.foreground }}>{user.displayName?.trim() || `@${user.username}`}</Text>
</View>
{(user.reputationScore !== undefined && user.reputationScore > 0) && (
<PillBadge
Expand Down
1 change: 1 addition & 0 deletions frontend/types/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export interface JourneyMatch {
export interface UserTrajectory {
journeyMatch?: JourneyMatch | null;
username: string;
displayName?: string | null;
reputationScore: number;
timeline: TimelineEvent[];
ai_summary?: string;
Expand Down
Loading