feat(gui): Feedback quick fixes (#331)

* refactor(gui): Simplify FeedbackDialog component and enhance feedback submission process

- Consolidated state management for feedback input using a custom hook.
- Improved user interface for feedback submission by including clearer instructions
- Removed redundant code and improved overall component structure for better maintainability.

* refactor(gui): Enhance FeedbackDialog layout and add mail link

* feat(gui): Add error handling in feedback submission

* feat(docs): Add brand identity to docs

* feat(docs): Add Send Feedback page

* feat(tauri): build base for log export feature

* feat(tauri): update save_txt_files to use HashMap for file content

* feat(gui): Implement log export functionality

* fix(gui): adjust feedback dialog link to show docs page with instructions for mail feedback

* fix(gui): minor style adjustments to export logs button

* feat(gui, tauri): enhance log export functionality to include zip file naming

* fix(docs): clarify docs section about exporting logs

* feat(gui): initialize selected swap in SwapSelectDropDown with most recent swap

* fix(gui): parse logs correctly for saving to log file

* fix(gui): ensure to use the most recent swap info by using a specialized hook

* fmr

---------

Co-authored-by: Binarybaron <binarybaron@protonmail.com>
This commit is contained in:
b-enedict 2025-05-27 12:55:20 +02:00 committed by GitHub
parent 60d2ee9f7e
commit 854b14939e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 1043 additions and 355 deletions

View file

@ -0,0 +1,35 @@
import { getLogsOfSwap, saveLogFiles } from 'renderer/rpc'
import PromiseInvokeButton from 'renderer/components/PromiseInvokeButton'
import { store } from 'renderer/store/storeRenderer'
import { ButtonProps } from '@material-ui/core'
import { logsToRawString } from 'utils/parseUtils'
interface ExportLogsButtonProps extends ButtonProps {
swap_id: string
}
export default function ExportLogsButton({ swap_id, ...buttonProps }: ExportLogsButtonProps) {
async function handleExportLogs() {
const swapLogs = await getLogsOfSwap(swap_id, false)
const daemonLogs = store.getState().rpc?.logs
const logContent = {
swap_logs: logsToRawString(swapLogs.logs),
daemon_logs: logsToRawString(daemonLogs),
}
await saveLogFiles(
`swap_${swap_id}_logs.zip`,
logContent
)
}
return (
<PromiseInvokeButton
onInvoke={handleExportLogs}
{...buttonProps}
>
Export Logs
</PromiseInvokeButton>
)
}

View file

@ -21,6 +21,7 @@ import {
import { isTestnet } from "store/config";
import { getBitcoinTxExplorerUrl } from "utils/conversionUtils";
import SwapLogFileOpenButton from "./SwapLogFileOpenButton";
import ExportLogsButton from "./ExportLogsButton";
const useStyles = makeStyles((theme) => ({
outer: {
@ -128,6 +129,8 @@ export default function HistoryRowExpanded({
variant="outlined"
size="small"
/>
<ExportLogsButton swap_id={swap.swap_id} variant="outlined"
size="small"/>
</Box>
</Box>
);