Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 1 addition & 7 deletions subtrack/src/tui/screens/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ export function ConfigScreen() {
</Text>
</Box>

<Box
borderStyle="round"
borderColor="gray"
paddingX={1}
paddingY={1}
flexDirection="column"
>
<Box flexDirection="column">
{CONFIG_KEYS.map((k, i) => (
<Box key={k}>
<Box width={4}>
Expand Down
15 changes: 2 additions & 13 deletions subtrack/src/tui/screens/delete.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { Box, Text, useInput, useWindowSize } from "ink"
import { Box, Text, useInput } from "ink"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore a width cap for the details card.

Removing cardWidth here means the card now grows to the longest value row. A long subscription name or tag list will push this screen past the terminal width instead of staying contained in the app frame. Please keep a terminal-aware max width or add truncation/wrapping on the value cells before merging.

Also applies to: 72-95

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@subtrack/src/tui/screens/delete.tsx` at line 1, The delete TUI details card
no longer has a width cap, so long values can stretch the screen beyond the
terminal frame. Update the card rendering in the delete screen component to
restore a terminal-aware max width on the main card or apply truncation/wrapping
to the value cells, using the delete screen’s card/layout code and the row/value
rendering logic that builds the details table. Keep the card contained so long
subscription names or tag lists do not expand the UI horizontally.

import { useMemo, useState, useEffect } from "react"
import { getSubscription, deleteSubscription } from "../../db.ts"
import { useTui, useSetFormActive } from "../context/app-context.tsx"
import { SIDEBAR_WIDTH } from "../types.ts"
import { formatPrice } from "../../price.ts"

export function DeleteScreen() {
const { state, dispatch } = useTui()
const { columns: termCols } = useWindowSize()
const [error, setError] = useState<string | null>(null)
const setFormActive = useSetFormActive()

Expand Down Expand Up @@ -52,8 +50,6 @@ export function DeleteScreen() {
)
}

const cardWidth = Math.min(50, Math.max(30, termCols - SIDEBAR_WIDTH - 8))

return (
<Box flexGrow={1} alignItems="center" justifyContent="center" flexDirection="column">
{error && (
Expand All @@ -73,14 +69,7 @@ export function DeleteScreen() {
</Box>

{/* Subscription details */}
<Box
borderStyle="round"
borderColor="gray"
paddingX={2}
paddingY={1}
flexDirection="column"
width={cardWidth}
>
<Box paddingX={2} paddingY={1} flexDirection="column">
<Box>
<Box width={14}><Text dimColor>Name:</Text></Box>
<Text bold>{sub.name}</Text>
Expand Down
8 changes: 1 addition & 7 deletions subtrack/src/tui/screens/detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,7 @@ export function DetailScreen() {
<Box marginTop={1}><Text dimColor>{"─".repeat(Math.min(50, Math.max(termCols - 12, 20)))}</Text></Box>
<Box marginTop={1} flexDirection="column">
<Text dimColor>Notes:</Text>
<Box
borderStyle="single"
borderColor="gray"
paddingX={1}
paddingY={1}
marginTop={1}
>
<Box paddingLeft={2} marginTop={1}>
<Text wrap="wrap">{sub.notes}</Text>
</Box>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion subtrack/src/tui/screens/subscription-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export function SubscriptionForm({ initial, onSave, onCancel, title }: Props) {
</Box>

{/* Key hints */}
<Box borderStyle="single" borderColor="gray" paddingX={1}>
<Box paddingLeft={1}>
<Text dimColor>
{step === "confirm"
? " y confirm n cancel"
Expand Down