mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
* fix(agent): show held calls in full, name option renames, stop replies on trash Approvers saw cut previews of what was sent, option renames hid the rows they change, and trashing an agent left its running reply going. * fix(agent): let a removed member's running reply finish Removal now only blocks the member's next send or approval, so an accidental removal doesn't leave a partial result that won't resume.
69 lines
1.9 KiB
Vue
69 lines
1.9 KiB
Vue
<template>
|
|
<div v-if="input" class="chat-tool-input">
|
|
<div v-if="rows" class="chat-tool-input__values" tabindex="0">
|
|
<table
|
|
class="chat-tool-input__table"
|
|
:aria-label="$t('toolPresentation.input')"
|
|
>
|
|
<tbody>
|
|
<tr v-for="[key, value] in rows" :key="key">
|
|
<th scope="row">{{ key }}</th>
|
|
<td>
|
|
<pre>{{
|
|
typeof value === 'string'
|
|
? value
|
|
: JSON.stringify(value, null, 2)
|
|
}}</pre>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<pre
|
|
v-else
|
|
class="chat-tool-input__values"
|
|
tabindex="0"
|
|
:aria-label="$t('toolPresentation.input')"
|
|
><code>{{ JSON.stringify(input.values, null, 2) }}</code></pre>
|
|
<p v-if="input.truncated" class="chat-tool-input__note">
|
|
{{
|
|
[
|
|
$t('toolPresentation.inputTruncated'),
|
|
...omissions.map(([key, count]) => $t(key, { count }, count)),
|
|
].join(' ')
|
|
}}
|
|
</p>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { computed } from 'vue'
|
|
|
|
/** A tool's input preview, with a note when the backend shortened it. */
|
|
const props = defineProps({
|
|
/**
|
|
* `{values, truncated}`, and what was left out (`omittedValues`,
|
|
* `omittedCharacters`) when known, as `toolActivity` resolves it.
|
|
*/
|
|
input: { type: Object, default: null },
|
|
})
|
|
|
|
/** What a held input too large to store left out, as translation keys and counts. */
|
|
const omissions = computed(() =>
|
|
[
|
|
['toolPresentation.inputOmittedValues', props.input?.omittedValues],
|
|
['toolPresentation.inputOmittedCharacters', props.input?.omittedCharacters],
|
|
].filter(([, count]) => count)
|
|
)
|
|
|
|
const rows = computed(() => {
|
|
const values = props.input?.values
|
|
return values &&
|
|
typeof values === 'object' &&
|
|
!Array.isArray(values) &&
|
|
Object.keys(values).length
|
|
? Object.entries(values)
|
|
: null
|
|
})
|
|
</script>
|