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
3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ dist
dist-ssr
*.local

# Vite cache
.vite

# Logs
logs
*.log
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ui/FileDropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function FileDropzone({
>
<input
type="file"
accept=".xlsx,.xls"
accept=".xlsx,.xlsm,.xltx,.xltm"
onChange={handleFileInput}
disabled={disabled}
className="sr-only"
Expand All @@ -142,7 +142,7 @@ export function FileDropzone({
<p className="dropzone-text">
{isDragging ? 'Drop your file here' : 'Drag and drop your Excel file'}
</p>
<p className="dropzone-subtext">or click to browse • XLSX, XLS supported</p>
<p className="dropzone-subtext">or click to browse • XLSX supported</p>

{isDragging && (
<motion.div
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ export interface FileInfo {
file: File;
name: string;
size: string;
type: 'xlsx' | 'xls';
type: 'xlsx' | 'xlsm' | 'xltx' | 'xltm';
}
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,16 @@ packages = ["src/rosetta"]
exclude = ["src/rosetta/api", "src/rosetta/api/*"]

[tool.hatch.build.targets.sdist]
exclude = ["src/rosetta/api", "src/rosetta/api/*"]
exclude = [
"src/rosetta/api",
"src/rosetta/api/*",
"frontend",
"frontend/**",
"tests",
"tests/**",
".github",
".github/**",
]

[tool.black]
line-length = 100
Expand Down
3 changes: 2 additions & 1 deletion src/rosetta/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
load_dotenv()

# Limits
MAX_FILE_SIZE = 10 * 1024 * 1024 # 10MB
# Keep in sync with frontend validation/copy (50MB).
MAX_FILE_SIZE = 50 * 1024 * 1024 # 50MB
MAX_CELLS = 5000

app = FastAPI(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ class TestFileSizeLimits:
"""Tests for file size validation."""

def test_large_file_returns_400(self, client):
"""Files over 10MB should be rejected."""
# Create a file larger than 10MB
large_content = b"x" * (11 * 1024 * 1024)
"""Files over 50MB should be rejected."""
# Create a file larger than 50MB
large_content = b"x" * (51 * 1024 * 1024)

response = client.post(
"/translate",
Expand Down