fix: show session friendly name in resume message and status bar
/history/{session_id} now returns a 'name' field alongside messages.
resumeSession() uses data.name first, then the sessionNames map, then
raw ID as fallback — so named sessions display correctly even on page
load before the sessions panel has been opened.
'Resumed session X' message also now shows the friendly name.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,17 @@ def save(session_id: str, messages: list[dict]) -> None:
|
||||
path.write_text(json.dumps(data, indent=2))
|
||||
|
||||
|
||||
def get_name(session_id: str) -> str:
|
||||
"""Return the friendly name for a session, or '' if none set."""
|
||||
path = _path(session_id)
|
||||
if not path.exists():
|
||||
return ""
|
||||
try:
|
||||
return json.loads(path.read_text()).get("name", "")
|
||||
except Exception:
|
||||
return ""
|
||||
|
||||
|
||||
def rename(session_id: str, name: str) -> bool:
|
||||
"""Set (or clear) the friendly name on a session. Returns False if not found."""
|
||||
path = _path(session_id)
|
||||
|
||||
Reference in New Issue
Block a user