Update frontend UI/UX

This commit is contained in:
2026-10-20 04:59:08 +01:00
parent 59f5acb7bc
commit e2093b0df6
17 changed files with 163 additions and 11 deletions
+9 -2
View File
@@ -12,9 +12,15 @@ export const ComputerRefHrefPrefix = "#computer-";
*/
export const TakeOverRefHrefPrefix = "#take-over-";
/**
* The link target a bot ref (`botRef`) becomes, e.g. `#bot-3`. The chat
* renders these as links to that bot's conversation.
*/
export const BotRefHrefPrefix = "#bot-";
/**
* Turns every computer ref (`[computer:3]`) and take-over ref
* (`[take-over:3:browser]`) in a message into a markdown link, so it
* (`[take-over:3:browser]`) and bot ref (`[bot:3]`) in a message into a markdown link, so it
* survives markdown rendering as a link the chat can swap for a button.
*/
export default function linkComputerRefs({ text }: { text: string }) {
@@ -26,5 +32,6 @@ export default function linkComputerRefs({ text }: { text: string }) {
.replace(
/\[take-over:(\d+):([a-z]+)\](?!\()/g,
(_, id: string, mode: string) => `[take over](${TakeOverRefHrefPrefix}${id}-${mode})`,
);
)
.replace(/\[bot:(\d+)\](?!\()/g, (_, id: string) => `[bot ${id}](${BotRefHrefPrefix}${id})`);
}