Compare commits

..
3 Commits
Author SHA1 Message Date
arswarogandClaude Opus 4.7 f979451944 chat/widget: отображение статуса подключения бота
Заменяет захардкоженное "Ready to help" на живой индикатор.
Статус берётся из поля status ответа GET /v1/status, капитализируется
и показывается справа от имени бота. Polling каждые 30с, пауза при
скрытой вкладке, recheck по клику, tooltip с API URL.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-08-08 15:48:02 +03:00
arswarog 6e8096a5df chat/widget: отображение использованых источников 2026-08-08 15:46:56 +03:00
arswarog bee00d8d60 chat: подключение к бекенду 2026-08-08 15:46:52 +03:00
2 changed files with 2 additions and 19 deletions
+1 -18
View File
@@ -20,23 +20,6 @@ export interface IChatMessage {
sources?: IChatSource[]; sources?: IChatSource[];
} }
function stripNumericPrefixes(p: string): string {
return p
.split('/')
.map((seg) => seg.replace(/^\d+-/, ''))
.join('/');
}
export function sourceToUrl(file: string, anchor: string): string { export function sourceToUrl(file: string, anchor: string): string {
let p = file.replace(/^docs\//, '').replace(/\.md$/, ''); return `/${file}${anchor ? `#${anchor}` : ''}`;
p = stripNumericPrefixes(p);
return `/docs/${p}${anchor ? `#${anchor}` : ''}`;
}
export function sourceToPath(file: string): string {
const p = file.replace(/^docs\//, '').replace(/\.md$/, '');
return stripNumericPrefixes(p);
} }
+1 -1
View File
@@ -32,7 +32,7 @@ export function Message({ role, content, sources }: MessageProps): ReactNode {
to={sourceToUrl(src.file, src.anchor)} to={sourceToUrl(src.file, src.anchor)}
className={b('sourceLink')} className={b('sourceLink')}
> >
{src.heading || sourceToPath(src.file)} {src.heading}
</Link> </Link>
))} ))}
</div> </div>