Skip to content

Commit bdda657

Browse files
committed
bug reports
1 parent e06093d commit bdda657

78 files changed

Lines changed: 8386 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/main/bugs-report.tsx

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
"use client";
2+
3+
import { useEffect, useState } from "react";
4+
import { Bug, Github, AlertCircle } from "lucide-react";
5+
import { useTranslations } from "next-intl";
6+
import { useResolvedLanguage } from "@/store";
7+
import { cn } from "@/lib/utils";
8+
9+
interface BugItem {
10+
title: string;
11+
phase: string;
12+
avoid: string;
13+
description: string;
14+
}
15+
16+
/**
17+
* BugsReport Component
18+
* Displays a list of known issues and their status, loaded from a localized markdown file.
19+
* Includes a link to report new issues on GitHub.
20+
*/
21+
export function BugsReport() {
22+
const t = useTranslations();
23+
const locale = useResolvedLanguage();
24+
const [bugs, setBugs] = useState<BugItem[]>([]);
25+
const [isLoading, setIsLoading] = useState(true);
26+
27+
useEffect(() => {
28+
// Determine which file to fetch based on locale
29+
const fileLocale = locale.startsWith("es") ? "es" : "en";
30+
31+
setIsLoading(true);
32+
fetch(`/data/known-bugs.${fileLocale}.md`)
33+
.then((res) => {
34+
if (!res.ok) throw new Error("Failed to load bugs");
35+
return res.text();
36+
})
37+
.then((text) => {
38+
const parsedBugs = parseMarkdown(text);
39+
setBugs(parsedBugs);
40+
})
41+
.catch((err) => {
42+
console.error("Error loading bugs:", err);
43+
// If localized version fails, try English as fallback
44+
if (fileLocale !== "en") {
45+
fetch("/data/known-bugs.en.md")
46+
.then(res => res.text())
47+
.then(text => setBugs(parseMarkdown(text)))
48+
.catch(e => console.error("Fallback error:", e));
49+
}
50+
})
51+
.finally(() => setIsLoading(false));
52+
}, [locale]);
53+
54+
/**
55+
* Parses the markdown content into a list of BugItem objects.
56+
* Expected format:
57+
* ### Title
58+
* - **Phase**: status
59+
* - **Avoid**: tip
60+
* - **Description**: details
61+
*/
62+
const parseMarkdown = (text: string): BugItem[] => {
63+
const sections = text.split("###").slice(1);
64+
return sections.map((section) => {
65+
const lines = section.split("\n");
66+
const title = lines[0].trim();
67+
68+
const getValue = (key: string) => {
69+
const line = lines.find(l => l.includes(`**${key}**:`) || l.includes(`**${key}**: `));
70+
if (!line) return "";
71+
return line.split(`**${key}**:`)[1]?.trim() || "";
72+
};
73+
74+
return {
75+
title,
76+
phase: getValue("Phase"),
77+
avoid: getValue("Avoid"),
78+
description: getValue("Description")
79+
};
80+
});
81+
};
82+
83+
if (!isLoading && bugs.length === 0) return null;
84+
85+
return (
86+
<section className="mt-12 p-8 bg-muted/20 dark:bg-white/5 border border-border rounded-2xl animate-in fade-in slide-in-from-bottom-2 duration-700">
87+
<div className="flex flex-col md:flex-row md:items-center justify-between gap-6 mb-8">
88+
<div>
89+
<h2 className="text-xl font-bold flex items-center gap-2.5">
90+
<Bug className="w-6 h-6 text-primary" />
91+
{t("knownBugsTitle")}
92+
</h2>
93+
<p className="text-sm text-text-secondary mt-1.5 max-w-lg">
94+
{t("knownBugsDesc")}
95+
</p>
96+
</div>
97+
<a
98+
href="https://github.com/InledGroup/office/issues"
99+
target="_blank"
100+
rel="noopener noreferrer"
101+
className="flex items-center justify-center gap-2.5 px-6 py-3 bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 rounded-xl hover:opacity-90 transition-all font-bold text-sm shadow-sm"
102+
>
103+
<Github className="w-5 h-5" />
104+
{t("reportOnGithub")}
105+
</a>
106+
</div>
107+
108+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5">
109+
{isLoading ? (
110+
Array.from({ length: 3 }).map((_, i) => (
111+
<div key={i} className="h-40 bg-muted/40 animate-pulse rounded-xl" />
112+
))
113+
) : (
114+
bugs.map((bug, i) => (
115+
<div key={i} className="p-5 bg-background border border-border rounded-xl shadow-sm hover:border-primary/40 transition-all group flex flex-col h-full">
116+
<h3 className="font-bold text-sm mb-4 flex items-start gap-2.5 leading-snug">
117+
<AlertCircle className="w-4 h-4 text-amber-500 shrink-0 mt-0.5" />
118+
{bug.title}
119+
</h3>
120+
121+
<div className="space-y-3.5 mt-auto">
122+
<div className="flex items-center gap-2 text-[11px]">
123+
<span className="font-bold text-text-secondary uppercase tracking-wider w-24 shrink-0">{t("bugPhase")}:</span>
124+
<span className={cn(
125+
"px-2.5 py-0.5 rounded-full font-bold",
126+
bug.phase.toLowerCase().includes("solucionado") || bug.phase.toLowerCase().includes("fixed")
127+
? "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400"
128+
: bug.phase.toLowerCase().includes("progreso") || bug.phase.toLowerCase().includes("progress") || bug.phase.toLowerCase().includes("investigando") || bug.phase.toLowerCase().includes("investigating")
129+
? "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400"
130+
: "bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"
131+
)}>
132+
{bug.phase}
133+
</span>
134+
</div>
135+
136+
<div className="flex items-start gap-2 text-[11px]">
137+
<span className="font-bold text-text-secondary uppercase tracking-wider w-24 shrink-0">{t("bugAvoid")}:</span>
138+
<p className="text-text-secondary font-medium leading-relaxed italic">
139+
"{bug.avoid}"
140+
</p>
141+
</div>
142+
143+
{bug.description && (
144+
<div className="pt-3 border-t border-border/40">
145+
<p className="text-[11px] text-text-secondary/80 leading-relaxed italic">
146+
{bug.description}
147+
</p>
148+
</div>
149+
)}
150+
</div>
151+
</div>
152+
))
153+
)}
154+
</div>
155+
</section>
156+
);
157+
}

components/main/open-view.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { FilePickerCard } from "@/components/file-picker-card";
1111
import { DocumentIcon } from "@/components/document-icon";
1212
import { getDocConfig } from "@/lib/document-types";
1313
import { useAppStore } from "@/store";
14+
import { BugsReport } from "./bugs-report";
1415
import {
1516
getRecentFiles,
1617
openRecentFile,
@@ -285,6 +286,9 @@ export function OpenView() {
285286
</div>
286287
)}
287288
</section>
289+
290+
{/* Known Bugs & Issues Section */}
291+
<BugsReport />
288292
</div>
289293
);
290294
}

messages/en.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,11 @@
142142
"W2sXxa": "Search for templates (e.g. 'Resume', 'Report', 'Pitch')...",
143143
"sc2DN9": "Use Template",
144144
"F03jGl": "No templates found matching your criteria.",
145-
"jKKg2o": "Clear all filters"
145+
"jKKg2o": "Clear all filters",
146+
"knownBugsTitle": "Known Bugs & Issues",
147+
"knownBugsDesc": "Tracking our progress and helping you avoid common pitfalls",
148+
"reportOnGithub": "Report on GitHub",
149+
"bugPhase": "Phase",
150+
"bugAvoid": "How to avoid",
151+
"bugDescription": "Description"
146152
}

messages/es.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,11 @@
142142
"W2sXxa": "Buscar plantillas (ej. 'Currículum', 'Informe', 'Presentación')...",
143143
"sc2DN9": "Usar plantilla",
144144
"F03jGl": "No se encontraron plantillas que coincidan con tus criterios.",
145-
"jKKg2o": "Limpiar todos los filtros"
145+
"jKKg2o": "Limpiar todos los filtros",
146+
"knownBugsTitle": "Errores Conocidos y Problemas",
147+
"knownBugsDesc": "Rastreamos nuestro progreso y te ayudamos a evitar problemas comunes",
148+
"reportOnGithub": "Reportar en GitHub",
149+
"bugPhase": "Fase",
150+
"bugAvoid": "Cómo evitar",
151+
"bugDescription": "Descripción"
146152
}

pnpm-workspace.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
allowBuilds:
2+
'@parcel/watcher': set this to true or false
3+
'@swc/core': set this to true or false
4+
core-js: set this to true or false
5+
electron: set this to true or false
6+
electron-winstaller: set this to true or false
7+
sharp: set this to true or false
8+
unrs-resolver: set this to true or false

public/data/known-bugs.en.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### Cannot save files as PDFs from templates
2+
- **Phase**: Investigating
3+
- **Avoid**: Export to HTML or Word and use IlovePDF to convert to PDF
4+
- **Description**: ..
5+
6+
### Infinite loading when pasting images from external sites
7+
- **Phase**: Fixed
8+
- **Avoid**: This is due to native browser restrictions called CORS. It is unavoidable if we want to maintain product privacy. To work around this, download the image you want to paste and upload it from the editor dialog.
9+
10+
- **Description**: The image loads indefinitely.
11+
12+
### Problems with custom fonts when exporting to PDF
13+
- **Phase**: Pending
14+
- **Avoid**: No solution at this time; we are working on it.
15+
16+
- **Description**: The solution would be to import the fonts from Google Fonts.

public/data/known-bugs.es.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### No se pueden guardar como PDF archivos a partir de plantillas
2+
- **Phase**: Investigando
3+
- **Avoid**: Exporta en HTML o Word y usa IlovePDF para convertir a PDF
4+
- **Description**: ..
5+
6+
### Carga infinita al pegar imagenes de sitios externos
7+
- **Phase**: Solucionado
8+
- **Avoid**: Esto se debe a restricciones nativas del navegador llamadas CORS. Es inevitable si queremos seguir manteniendo la privacidad de los productos. Para solucionarlo, descargue la imagen que desdea pegar y súbala desde el diálogo del editor .
9+
- **Description**: Se queda cargando de manera infinita la imagen.
10+
11+
### Problemas con fuentes personalizadas en exportación a PDF
12+
- **Phase**: Pendiente
13+
- **Avoid**: No tiene solución por ahora, estamos trabajando en ello.
14+
- **Description**: La solución consistiría en importar las fuentes de Google Fonts.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2013 Lovell Fuller and others.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
'use strict';
5+
6+
const url = require('url');
7+
const tunnelAgent = require('tunnel-agent');
8+
9+
const is = require('./is');
10+
11+
const proxies = [
12+
'HTTPS_PROXY',
13+
'https_proxy',
14+
'HTTP_PROXY',
15+
'http_proxy',
16+
'npm_config_https_proxy',
17+
'npm_config_proxy'
18+
];
19+
20+
function env (key) {
21+
return process.env[key];
22+
}
23+
24+
module.exports = function (log) {
25+
try {
26+
const proxy = new url.URL(proxies.map(env).find(is.string));
27+
const tunnel = proxy.protocol === 'https:'
28+
? tunnelAgent.httpsOverHttps
29+
: tunnelAgent.httpsOverHttp;
30+
const proxyAuth = proxy.username && proxy.password
31+
? `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`
32+
: null;
33+
log(`Via proxy ${proxy.protocol}//${proxy.hostname}:${proxy.port} ${proxyAuth ? 'with' : 'no'} credentials`);
34+
return tunnel({
35+
proxy: {
36+
port: Number(proxy.port),
37+
host: proxy.hostname,
38+
proxyAuth
39+
}
40+
});
41+
} catch (err) {
42+
return null;
43+
}
44+
};

0 commit comments

Comments
 (0)