fix: never greet the user by the assistant's default name (UF-055)
Home and the sidebar read the user's name from the identity row, which the sidecar fills with the assistant's identity named Waggle. Both now use the profile name, with the identity name as a fallback that skips the default.
This commit is contained in:
18
apps/web/src/lib/user-name.test.ts
Normal file
18
apps/web/src/lib/user-name.test.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { pickUserName } from './user-name';
|
||||
|
||||
describe('pickUserName (UF-055)', () => {
|
||||
it('prefers the name in the profile', () => {
|
||||
expect(pickUserName('Ana', 'Waggle')).toBe('Ana');
|
||||
expect(pickUserName(' Ana ', 'Marko')).toBe('Ana');
|
||||
});
|
||||
|
||||
it('falls back to a real identity name', () => {
|
||||
expect(pickUserName('', 'Marko')).toBe('Marko');
|
||||
});
|
||||
|
||||
it('never returns the assistant default name as the user', () => {
|
||||
expect(pickUserName(null, 'Waggle')).toBeNull();
|
||||
expect(pickUserName(undefined, undefined)).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user