Port of the vanilla refine-bar + output-actions block that every note
page had (see public/components/{encounter,dictation,soap,sickvisit,
wellvisit,hospital,chart}.html at commit be14578).
One shared OutputActions component renders under every generated
note's body with:
📋 Copy → navigator.clipboard
🔊 Read → POST /api/text-to-speech (audio/mpeg → Audio playback
with stop-on-second-click)
☁️ Export → POST /api/nextcloud/export (uses each page's exportLabel
as the filename prefix, exportType in the type field)
✏️ Refine → POST /api/refine — free-text instructions textarea,
sourceContext carries the original transcript so the
model can reference the source when following orders
📏 Shorter → POST /api/shorten
Busy/success/error state shown inline per-component — no native alerts.
Refine result replaces the existing output via onUpdate, matching
vanilla setOutputText() behavior.
Wired into all 7 note pages (Encounter, Dictation, SOAP, Sick Visit,
Well Visit, Hospital Course, Chart Review) with per-page exportLabel
/ exportType matching the vanilla data-label values.
|
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| .gitignore | ||
| components.json | ||
| eslint.config.js | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
React Compiler
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])