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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "filesmith",
"version": "0.5.2",
"version": "0.5.3",
"description": "A desktop file toolkit: convert, compress, resize, upscale, remove backgrounds, and PDF tools.",
"author": "Max",
"license": "MIT",
Expand Down
35 changes: 1 addition & 34 deletions src/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,12 @@ import {
import { engineFor, tabAccepts, tabById, toolCardById, type TabId } from '@shared/tabs'
import { TitleBar } from './components/shell/TitleBar'
import { Sidebar } from './components/shell/Sidebar'
import { StatusBar } from './components/shell/StatusBar'
import { crumbsFor } from './components/shell/crumbs'
import { useSidebar } from './components/shell/useSidebar'
import { useRailPrefs } from './components/shell/useRailPrefs'
import { sidebarVerbs } from './components/shell/railPrefs'
import { statusSummary } from './components/shell/statusModel'
import { shortcutFor } from './components/shell/shortcuts'
import {
activeGroupFor,
headerCheck,
oneGroupIds,
toggleAllIds
} from './components/queue/selectAll'
import { activeGroupFor, headerCheck, toggleAllIds } from './components/queue/selectAll'
import { QueueTable } from './components/queue/QueueTable'
import { QueueToolbar } from './components/queue/QueueToolbar'
import { doneSamples, queueTotals, type RowActionKind } from './components/queue/rowModel'
Expand Down Expand Up @@ -152,7 +145,6 @@ export default function App(): JSX.Element {
const sidebar = useSidebar()
const rail = useRailPrefs()
// Ids of the last run per workspace, for "Converting 3 of 6" (spec 6.4).
const [batches, setBatches] = useState<Record<string, string[]>>({})
// Per-workspace column sort; null is insertion order (spec 4.2).
const [sorts, setSorts] = useState<Record<string, SortState | null>>({})
// Inspector tab: per-session view state, not persisted (spec 3.4).
Expand Down Expand Up @@ -473,7 +465,6 @@ export default function App(): JSX.Element {
* with (spec 4.3). A merge row retries with the same input list, because
* run() stores `mergeInputs` in its `runOptions`. */
function retry(ids: string[]): void {
const started: string[] = []
for (const id of ids) {
const it = cur.items.find((i) => i.id === id)
if (!it || (it.status !== 'failed' && it.status !== 'canceled')) continue
Expand All @@ -485,9 +476,7 @@ export default function App(): JSX.Element {
input: it.file.path,
options: opts
})
started.push(id)
}
if (started.length) setBatches((b) => ({ ...b, [qKey]: started }))
}

function onRowAction(id: string, kind: RowActionKind): void {
Expand Down Expand Up @@ -819,7 +808,6 @@ export default function App(): JSX.Element {
anchorId = src.id
}
dispatch({ type: 'markQueued', ids: [anchorId], options: { ...opts, mergeInputs: paths } })
setBatches((b) => ({ ...b, [qKey]: [anchorId] }))
void window.filesmith.runJob({
id: anchorId,
tool: 'pdf',
Expand Down Expand Up @@ -849,7 +837,6 @@ export default function App(): JSX.Element {
if (newSources.length) dispatch({ type: 'addSources', items: newSources, key: qKey })
if (!targets.length) return
dispatch({ type: 'markQueued', ids: targets.map((t) => t.id), options: opts })
setBatches((b) => ({ ...b, [qKey]: targets.map((t) => t.id) }))
for (const t of targets) {
void window.filesmith.runJob({ id: t.id, tool, input: t.path, options: opts })
}
Expand Down Expand Up @@ -1065,14 +1052,6 @@ export default function App(): JSX.Element {

const crumbs = crumbsFor(state.tab, card ?? null, activeGroup)
const verbLabel = card ? card.label : tab.label
const summary = statusSummary(
onToolsGrid || onCompleted || state.tab === 'settings' ? [] : cur.items,
batches[qKey] ?? null,
verbLabel,
genRun.running && genRun.message && !genRun.message.startsWith('Generating')
? genRun.message
: null
)
const showInspector = !onToolsGrid && !onCompleted && state.tab !== 'settings'

// Inspector head and Run label (spec 3.4, 4.1).
Expand Down Expand Up @@ -1328,18 +1307,6 @@ export default function App(): JSX.Element {
)}
</>
</div>
<StatusBar
summary={summary}
onFailedClick={() =>
dispatch({
type: 'selectIds',
ids: oneGroupIds(
cur.items,
cur.items.filter((i) => i.status === 'failed').map((i) => i.id)
)
})
}
/>
<ContextMenu menu={menu} onClose={closeMenu} />
<ConfirmDialog state={confirm} onClose={closeConfirm} />
</div>
Expand Down
45 changes: 0 additions & 45 deletions src/renderer/src/components/shell/StatusBar.tsx

This file was deleted.

56 changes: 0 additions & 56 deletions src/renderer/src/components/shell/statusModel.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/renderer/src/theme/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ svg.i10 {
white-space: nowrap;
}

/* App frame (spec 3): title bar, workbench, status bar. */
/* App frame (spec 3): title bar and workbench. */
.app {
display: grid;
grid-template-rows: 32px 1fr 24px;
grid-template-rows: 32px 1fr;
width: 100vw;
height: 100vh;
min-width: 0;
Expand Down
48 changes: 0 additions & 48 deletions src/renderer/src/theme/workbench.css
Original file line number Diff line number Diff line change
Expand Up @@ -742,54 +742,6 @@
box-shadow: inset 0 0 0 3px var(--inv-bg);
}

/* status bar */
.statusbar {
border-top: 1px solid var(--line);
display: flex;
align-items: stretch;
font: 12px var(--mono);
color: var(--fg2);
}
.sitem {
display: flex;
align-items: center;
gap: 8px;
padding: 0 12px;
line-height: 1;
border-right: 1px solid var(--line);
}
.sitem:hover {
background: var(--hover);
color: var(--fg1);
}
.mini {
width: 96px;
height: 2px;
background: var(--track);
position: relative;
overflow: hidden;
}
.mini i {
position: absolute;
left: 0;
top: 0;
bottom: 0;
background: var(--fg1);
}
.sright {
margin-left: auto;
display: flex;
}
.sright .sitem {
border-right: 0;
border-left: 1px solid var(--line);
}
.sitem.warn {
font-weight: 600;
color: var(--fg1);
}

/* preview */
.wipe {
margin: 16px;
height: 208px;
Expand Down
47 changes: 0 additions & 47 deletions test/shell-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import {
normalizeOrder,
sidebarVerbs
} from '../src/renderer/src/components/shell/railPrefs'
import { statusSummary, verbGerund } from '../src/renderer/src/components/shell/statusModel'
import { shortcutFor } from '../src/renderer/src/components/shell/shortcuts'
import type { KeyLike } from '../src/renderer/src/components/queue/tableKeys'
import { TABS, toolCardById, type TabId } from '@shared/tabs'
import type { QueueItem } from '../src/renderer/src/state'

describe('breadcrumb', () => {
it('shows the verb, then the active group as the current segment', () => {
Expand Down Expand Up @@ -72,51 +70,6 @@ describe('rail preferences', () => {
})
})

const row = (id: string, status: QueueItem['status'], percent = 0): QueueItem => ({
id,
file: { path: `C:/${id}.png`, name: `${id}.png`, ext: '.png', kind: 'image', size: 1 },
thumb: null,
status,
percent,
hasProgress: percent > 0
})

describe('status bar', () => {
const items = [
row('a', 'done'),
row('b', 'done'),
row('c', 'running', 62),
row('d', 'queued'),
row('e', 'queued'),
row('f', 'failed')
]
it('reports the batch in flight, done count and failures', () => {
const s = statusSummary(items, ['a', 'b', 'c', 'd', 'e', 'f'], 'Convert')
expect(s.running).toEqual({ label: 'Converting 3 of 6', pct: 60 })
expect(s.done).toBe('2 of 6 done')
expect(s.failed).toBe(1)
})
it('drops the running item once the batch settles or without a batch', () => {
const settled = items.map((i) =>
i.status === 'queued' || i.status === 'running' ? { ...i, status: 'done' as const } : i
)
expect(statusSummary(settled, ['a', 'b', 'c', 'd', 'e', 'f'], 'Convert').running).toBeNull()
expect(statusSummary(items, null, 'Convert').running).toBeNull()
})
it('renders nothing for an empty queue', () => {
expect(statusSummary([], null, 'Convert')).toEqual({
running: null,
message: null,
done: null,
failed: 0
})
})
it('names each verb', () => {
expect(verbGerund('Remove BG')).toBe('Removing backgrounds')
expect(verbGerund('Merge')).toBe('Processing')
})
})

describe('global shortcuts', () => {
const k = (key: string, o: Partial<Omit<KeyLike, 'key'>> = {}): KeyLike => ({
key,
Expand Down
Loading