Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/portfolio-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Portfolio CI — syntax and frontend build

on:
push:
branches: [Paolo_minimax2.7, portfolio-refresh-2026-10]
pull_request:

jobs:
python-syntax:
name: Python syntax check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Compile backend and test sources
run: python -m compileall -q app tests

frontend-build:
name: React production build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ebay-ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: ebay-ui/package-lock.json
- run: npm ci
- run: npm run build
89 changes: 89 additions & 0 deletions ebay-ui/src/features/chat/ContactSellerCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { Box, Button, Link, Paper, Typography } from "@mui/material"
import OpenInNewIcon from "@mui/icons-material/OpenInNew"

interface ContactSellerResult {
success?: boolean
status?: string
contact_status?: string
contact_url?: string
seller_name?: string
message?: string
message_sent?: string
detail?: string
error?: string
}

// The API contact tool generates a link; the Playwright tool may submit a
// message. Treat these as different outcomes to avoid false "sent" claims.
export default function ContactSellerCard({ data }: { data: ContactSellerResult | null }) {
if (!data) return null

const submitted = data.contact_status === "message_sent"
const failed = data.status === "error" || data.success === false
const title = submitted
? "Messaggio inviato"
: failed
? "Contatto venditore non completato"
: "Contatta il venditore"

// Tool output must not become an arbitrary clickable URL in the UI.
const safeLink =
typeof data.contact_url === "string" &&
/^https:\/\/(www\.)?ebay\.it\//i.test(data.contact_url)
? data.contact_url
: null

const description =
data.detail ||
data.error ||
(submitted
? "Il browser ha riportato l'invio del messaggio."
: "Apri la messaggistica di eBay per continuare.")

return (
<Paper
elevation={0}
sx={{
border: "1px solid var(--border-color)",
borderLeft: "4px solid",
borderLeftColor: failed ? "error.main" : submitted ? "success.main" : "primary.main",
bgcolor: "var(--bg-primary)",
borderRadius: 2,
p: 2,
}}
>
<Typography fontWeight={800} sx={{ color: "var(--text-primary)" }}>
{title}
</Typography>
{data.seller_name && (
<Typography sx={{ mt: 0.5, fontSize: 12, color: "var(--text-secondary)" }}>
Venditore: {data.seller_name}
</Typography>
)}
<Typography sx={{ mt: 1, fontSize: 13, color: "var(--text-primary)", whiteSpace: "pre-wrap" }}>
{description}
</Typography>
{submitted && data.message_sent && (
<Box sx={{ mt: 1.5, p: 1.5, bgcolor: "var(--bg-secondary)", borderRadius: 1.5 }}>
<Typography sx={{ fontSize: 12, whiteSpace: "pre-wrap" }}>
{data.message_sent}
</Typography>
</Box>
)}
{!submitted && safeLink && (
<Button
component={Link}
href={safeLink}
target="_blank"
rel="noopener noreferrer"
variant="outlined"
size="small"
endIcon={<OpenInNewIcon />}
sx={{ mt: 1.5 }}
>
Apri messaggistica eBay
</Button>
)}
</Paper>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
TableHead,
TableRow,
Typography,
Chip,
Button,
IconButton,
Avatar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { Menu, MenuItem, ListItemIcon, ListItemText, IconButton } from "@mui/mat
import ContactMailIcon from "@mui/icons-material/ContactMail"
import CheckCircleIcon from "@mui/icons-material/CheckCircle"
import RadioButtonUncheckedIcon from "@mui/icons-material/RadioButtonUnchecked"
import CompareArrowsIcon from "@mui/icons-material/CompareArrows"

import SellerTrustGauge from "../../seller/component/SellerTrustGauge.tsx"
import SellerFeedbackPanel from "../../seller/component/SellerFeedbackPanel.tsx"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useState, useMemo, useEffect } from "react"
import { Box, Typography, Button } from "@mui/material"
import TrendingUpIcon from "@mui/icons-material/TrendingUp"
import GppGoodIcon from "@mui/icons-material/GppGood"
import ListIcon from "@mui/icons-material/List"
import CompareArrowsIcon from "@mui/icons-material/CompareArrows"
Expand Down
Loading
Loading