From 9371e8d1184618ddec20484533c937821266648e Mon Sep 17 00:00:00 2001 From: Stephen Cox Date: Fri, 1 Aug 2025 16:44:03 +0100 Subject: [PATCH] Fix resumed chat display to show 'You' instead of 'User' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves issue where resumed chats showed "User" in message headers while new chats should consistently show "You" for better UX. Changes: - Updated print_message() to display "You" instead of "User" for user messages - Updated corresponding unit tests to match new expected behavior - Maintains timestamps and all other formatting while fixing the inconsistency Fixes #12 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- nova/utils/formatting.py | 2 +- tests/unit/test_utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/utils/formatting.py b/nova/utils/formatting.py index 3161d59..7a6b6c7 100644 --- a/nova/utils/formatting.py +++ b/nova/utils/formatting.py @@ -13,7 +13,7 @@ def print_message(role: str, content: str, timestamp: str = None): if role.lower() == "user": color = "blue" icon = "👤" - display_role = role.title() + display_role = "You" elif role.lower() == "assistant": color = "green" icon = "🤖" diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 0f29374..937382d 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -159,7 +159,7 @@ def test_print_message_user(self, mock_console): mock_console.print.assert_called_once() # Verify the panel was created with correct styling panel_arg = mock_console.print.call_args[0][0] - assert "👤 User (12:34:56)" in str(panel_arg.title) + assert "👤 You (12:34:56)" in str(panel_arg.title) assert panel_arg.border_style == "blue" @patch("nova.utils.formatting.console") @@ -189,7 +189,7 @@ def test_print_message_no_timestamp(self, mock_console): mock_console.print.assert_called_once() panel_arg = mock_console.print.call_args[0][0] - assert "👤 User" in str(panel_arg.title) + assert "👤 You" in str(panel_arg.title) assert "(" not in str(panel_arg.title) # No timestamp @patch("nova.utils.formatting.console")