Remove the now-redundant /capture route
The home page owns the full capture flow, so the standalone /capture
page is no longer reachable. Drop the route, the Capture view, its
test, and the CSS that only its first screen used (card-body/title/
lead, btn-stack, drop-hint, and the dropzone drag feedback).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147qRctyhELxJgGs3nHizEM
diff --git a/lib/views/capture.rb b/lib/views/capture.rb
deleted file mode 100644
index c7f6e97..0000000
--- a/lib/views/capture.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-# frozen_string_literal: true
-
-require_relative "layout"
-require_relative "icons"
-require_relative "capture_form"
-
-module Domus
- module Views
- class Capture < Phlex::HTML
- include Icons
-
- def view_template
- doctype
- html(lang: "en") do
- head do
- meta(charset: "utf-8")
- meta(name: "viewport", content: "width=device-width, initial-scale=1")
- title { "Domus - Add image" }
- link(rel: "stylesheet", href: "/app.css")
- script(defer: true, src: "/capture.js")
- script(defer: true, src: "https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js")
- end
- body do
- render_page
- end
- end
- end
-
- private
-
- def render_page
- div(class: "page") do
- render_header
- render_main
- end
- end
-
- def render_header
- header(class: "topbar") do
- a(href: "/", class: "logo") do
- span(class: "logo-mark")
- plain "domus"
- end
- end
- end
-
- def render_main
- main(class: "content") do
- div(
- class: "card",
- "x-data": "captureApp()",
- "@dragover.prevent": "dragging = true",
- "@dragleave.prevent": "dragging = false",
- "@drop.prevent": "onDrop($event)",
- ":data-drag": "dragging ? 'over' : null"
- ) do
- div("x-show": "state === 'capture'", class: "card-body") do
- h2(class: "card-title") { plain "Add an image" }
- p(class: "card-lead") { plain "Take a photo or pick an image to keep." }
-
- div(class: "btn-stack") do
- button(
- type: "button",
- class: "btn btn-primary",
- "@click": "$refs.cameraInput.click()"
- ) do
- icon("camera")
- plain "Take a photo"
- end
-
- button(
- type: "button",
- class: "btn",
- "@click": "$refs.fileInput.click()"
- ) do
- icon("folder")
- plain "Browse files"
- end
- end
-
- p(class: "drop-hint") { plain "or drop a file onto this card" }
- end
-
- render CaptureForm.new
- end
- end
- end
- end
- end
-end
diff --git a/lib/web.rb b/lib/web.rb
index 15ff078..b93282b 100644
--- a/lib/web.rb
+++ b/lib/web.rb
@@ -3,7 +3,6 @@
require "roda"
require "fileutils"
require_relative "views/layout"
-require_relative "views/capture"
require_relative "views/home"
module Domus
@@ -41,12 +40,6 @@ module Domus
end
end
- r.on "capture" do
- r.get do
- Views::Capture.new.call
- end
- end
-
r.on "files" do
r.post do
save_file(r.params)
diff --git a/public/app.css b/public/app.css
index 3b7db60..0abd9a1 100644
--- a/public/app.css
+++ b/public/app.css
@@ -145,33 +145,7 @@ body {
overflow: hidden;
}
-.card-body {
- padding: var(--space-m);
-}
-
-.card-title {
- font-family: var(--font-serif);
- font-size: var(--step-1);
- font-weight: 600;
- letter-spacing: -0.012em;
- line-height: 1.12;
- margin: 0 0 var(--space-3xs) 0;
-}
-
-.card-lead {
- font-size: var(--step--1);
- color: var(--w-ink-2);
- margin: 0 0 var(--space-m) 0;
- line-height: 1.45;
-}
-
/* ---- buttons ---- */
-.btn-stack {
- display: flex;
- flex-direction: column;
- gap: var(--space-2xs);
-}
-
.btn {
display: inline-flex;
align-items: center;
@@ -205,14 +179,6 @@ body {
border-color: var(--w-accent-ink);
}
-.drop-hint {
- font-family: var(--font-mono);
- font-size: var(--step--2);
- color: var(--w-ink-3);
- text-align: center;
- margin-top: var(--space-s);
-}
-
/* ---- saved state ---- */
.preview-zone {
height: 210px;
@@ -337,12 +303,6 @@ body {
/* ---- svg icons ---- */
.icon { flex: none; }
-/* ---- dropzone drag feedback ---- */
-.card[data-drag="over"] {
- border-color: var(--w-accent);
- box-shadow: 0 0 0 3px var(--w-accent-soft), var(--shadow-float);
-}
-
@media (max-width: 480px) {
.content {
padding: var(--space-m) var(--space-s);
diff --git a/test/test_app.rb b/test/test_app.rb
index 9fa82b2..dc49d05 100644
--- a/test/test_app.rb
+++ b/test/test_app.rb
@@ -56,12 +56,6 @@ class TestApp < Minitest::Test
refute_includes body, 'href="/capture"'
end
- def test_capture_page
- get "/capture"
- assert_equal 200, last_response.status
- assert_includes last_response.body, "Add an image"
- end
-
def test_upload_image_saves_file_and_redirects
post "/files", "file" => upload("photo.png", "image/png", "fake-png-bytes")