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
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,30 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- **Send held files to the folder they came closest to.** When two or more files in Organize are
held for review and all came closest to the same Smart Folder, the uncategorized bar names that
folder and offers one button to send them all there. A file whose closest folder only ties the
next one is left out of the offer. Nothing moves until you move them, and the routing bar is
unchanged.
- **Ask about your files after a move.** The finished screen has an "Ask about your files" button
that opens Chat, which answers from your library and names the files it used.
- **MCP setup for other apps.** Settings → MCP Server can copy the server address and token for apps
that ask for an address and a header rather than a config file.

### Changed

- **Match scores read as words.** Review cards and the sample run say "Strong match", "Good match"
or "Check this" instead of a bare percentage, which read as an accuracy rate. The words follow
what the app does with the score (the auto-organize default and the routing bar), and the
percentage stays as the tooltip.
- **Renaming is easier to find.** The Discover button that opened "Naming strategy" now says how
files will be named ("File names: Subject, then date"), and the naming pickers list each
convention in words rather than by its id.
- **"Watch smart folders" is now "Keep Smart Folders up to date".** Its description says it watches
where files go, not where they come from, and names the ways files come in.

## [5.4.0] - 2026-11-16

### Added
Expand Down
17 changes: 15 additions & 2 deletions docs/MCP_SERVER.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ do not need to reinstall clients, but each one needs the new token (copy its con
`http://127.0.0.1:53827/mcp`. If that port is already taken, the server binds an OS-assigned
ephemeral port (`listen(0)`) and Settings shows the actual port. It starts with StratoSort while
the box is ticked; untick it to stop the server and keep it off.
3. Click **Copy Claude Desktop config** (or **Copy Cursor config** / **Copy Zed config**).
4. Paste it into your client's config file. Restart the client.
3. Click **Copy Claude Desktop config** (or **Copy Cursor config** / **Copy Zed config**). For an
app that asks for a server address and a header instead of a config file (Loci, for one), click
**Copy address and token (other apps)**.
4. Paste it into your client's config file, or the address and header into the app's server form.
Restart the client.
5. The client now sees four StratoSort tools: `search_documents`, `chat_with_documents`,
`get_document_summary`, `list_smart_folders`.

Expand Down Expand Up @@ -93,6 +96,16 @@ follow this shape:

**Zed** (`~/.config/zed/settings.json`): same shape under `context_servers`.

**Other apps** (a server form rather than a config file): plain text with the address, the header,
and the transport.

```text
StratoSort MCP server
Address: http://127.0.0.1:53827/mcp
Header: Authorization: Bearer <YOUR-TOKEN>
Transport: Streamable HTTP
```

The Settings panel always generates the snippet with your actual port and token filled in — copy
from there rather than from this doc.

Expand Down
4 changes: 3 additions & 1 deletion src/main/ipc/validationSchemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,9 @@ if (!z) {
mcpDisable: ipcVoidPayloadSchema,
mcpStatus: ipcVoidPayloadSchema,
mcpRotateToken: ipcVoidPayloadSchema,
mcpGetConfigSnippet: z.object({ client: z.enum(['claudeDesktop', 'cursor', 'zed']) }).strict(),
mcpGetConfigSnippet: z
.object({ client: z.enum(['claudeDesktop', 'cursor', 'zed', 'other']) })
.strict(),
mcpTestConnection: ipcVoidPayloadSchema,

// AI Provider IPC schemas (T7-T8 multi-provider AI work)
Expand Down
9 changes: 9 additions & 0 deletions src/main/transports/mcp/configSnippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ function generateSnippet(client, { port, token }) {
null,
2
);
case 'other':
// For an app that asks for a server address and a header rather than a
// config file (Loci's "Add a server: a web address", for one).
return [
'StratoSort MCP server',
`Address: ${url}`,
`Header: Authorization: ${auth}`,
'Transport: Streamable HTTP'
].join('\n');
default:
throw new Error(`Unknown MCP client: ${client}`);
}
Expand Down
11 changes: 6 additions & 5 deletions src/renderer/components/discover/NamingSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import Select from '../ui/Select';
import { Text } from '../ui/Typography';
import { normalizeSeparator } from '../../../shared/namingConventions';
import { NAMING_CONVENTIONS, NAMING_CONVENTION_LABELS } from '../../../shared/validationConstants';

const NamingSettings = memo(function NamingSettings({
namingConvention,
Expand Down Expand Up @@ -37,11 +38,11 @@ const NamingSettings = memo(function NamingSettings({
onChange={handleConventionChange}
aria-label="Naming convention"
>
<option value="subject-date">subject-date</option>
<option value="date-subject">date-subject</option>
<option value="project-subject-date">project-subject-date</option>
<option value="category-subject">category-subject</option>
<option value="keep-original">keep-original</option>
{NAMING_CONVENTIONS.map((id) => (
<option key={id} value={id}>
{NAMING_CONVENTION_LABELS[id] || id}
</option>
))}
</Select>

<Select
Expand Down
27 changes: 22 additions & 5 deletions src/renderer/components/discover/SampleRunDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@ import { Text } from '../ui/Typography';
import { Inline } from '../layout';
import { selectRedactPaths } from '../../store/selectors';
import { formatDisplayFileName } from '../../utils/pathDisplay';
import { describeMatchStrength } from '../../utils/confidenceColors';

// Badge variant for each match strength (describeMatchStrength).
const MATCH_BADGE = Object.freeze({ high: 'success', medium: 'info', low: 'warning' });

/** The match score in words; the percentage is the tooltip. */
function MatchBadge({ score }) {
const strength = describeMatchStrength(score * 100);
if (!strength) return null;
return (
<span className="shrink-0 ml-auto" title={strength.title}>
<StatusBadge variant={MATCH_BADGE[strength.level]} size="sm">
{strength.label}
</StatusBadge>
</span>
);
}

MatchBadge.propTypes = {
score: PropTypes.number.isRequired
};

const plural = (n, word) => `${n} ${word}${n === 1 ? '' : 's'}`;

Expand Down Expand Up @@ -144,11 +165,7 @@ function SampleRunDialog({
<Text variant="small" className="font-medium text-system-gray-900 truncate">
{row.analyzed ? row.folder || 'Uncategorized' : 'Not analyzed'}
</Text>
{row.score !== null && (
<StatusBadge variant="info" size="sm" className="shrink-0 ml-auto">
{`${Math.round(row.score * 100)}% confidence`}
</StatusBadge>
)}
{row.score !== null && <MatchBadge score={row.score} />}
</div>
<Text variant="tiny" className="text-system-gray-600 mt-0.5">
{row.reason}
Expand Down
38 changes: 18 additions & 20 deletions src/renderer/components/organize/ReadyFileItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ import {
isDefaultCategoryName
} from '../../../shared/categoryFolderMatching';
import { describeRouting } from '../../phases/organize/organizeDestination';
import { describeMatchStrength } from '../../utils/confidenceColors';

// Dot and bar color for each match strength (describeMatchStrength).
const MATCH_TONE = Object.freeze({
high: 'bg-stratosort-success',
medium: 'bg-stratosort-blue',
low: 'bg-system-gray-400'
});

function ReadyFileItem({
file,
Expand Down Expand Up @@ -87,6 +95,7 @@ function ReadyFileItem({
: confidenceValue > 1
? Math.round(confidenceValue)
: Math.round(confidenceValue * 100);
const matchStrength = describeMatchStrength(computedConfidence);
// Engine-ranked folders first (primary, then alternatives), limited to
// folders the user can pick; the rest follow under "All folders".
const rankedNames = useMemo(() => {
Expand Down Expand Up @@ -355,32 +364,21 @@ function ReadyFileItem({
{analysis && (
<div className="mt-auto flex flex-wrap items-center justify-between gap-x-3 gap-y-2 px-4 py-3 bg-system-gray-50/50 border-t border-system-gray-100 rounded-b-xl">
{/* Confidence */}
{showConfidence ? (
<div className="flex items-center gap-compact">
{showConfidence && matchStrength ? (
<div className="flex items-center gap-compact" title={matchStrength.title}>
<div className="flex items-center gap-1.5">
<div
className={`w-2 h-2 rounded-full ${
computedConfidence >= 80
? 'bg-stratosort-success'
: computedConfidence >= 50
? 'bg-stratosort-warning'
: 'bg-system-gray-400'
}`}
/>
<div className={`w-2 h-2 rounded-full ${MATCH_TONE[matchStrength.level]}`} />
<Text variant="tiny" className="font-medium text-system-gray-600">
{computedConfidence}% confidence
{matchStrength.label}
</Text>
</div>
{/* Mini progress bar */}
<div className="w-16 h-1.5 bg-system-gray-200 rounded-full overflow-hidden">
<div
className="w-16 h-1.5 bg-system-gray-200 rounded-full overflow-hidden"
aria-hidden="true"
>
<div
className={`h-full rounded-full transition-[width,background-color] ${
computedConfidence >= 80
? 'bg-stratosort-success'
: computedConfidence >= 50
? 'bg-stratosort-warning'
: 'bg-system-gray-400'
}`}
className={`h-full rounded-full transition-[width,background-color] ${MATCH_TONE[matchStrength.level]}`}
style={{ width: `${computedConfidence}%` }}
/>
</div>
Expand Down
46 changes: 40 additions & 6 deletions src/renderer/components/organize/UncategorizedActionsBar.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import PropTypes from 'prop-types';
import { FolderPlus, RefreshCw, Lightbulb } from 'lucide-react';
import { FolderPlus, FolderInput, RefreshCw, Lightbulb } from 'lucide-react';
import { Button } from '../ui';
import { Text } from '../ui/Typography';
import Card from '../ui/Card';
import { AddSmartFolderModal } from '../setup';
import { createLogger } from '../../../shared/logger';
import { smartFoldersIpc } from '../../services/ipc';
import { mapErrorToNotification } from '../../utils/errorMapping';
import { findRecurringTheme } from './uncategorizedThemes';
import { findClosestFolderGroup, findRecurringTheme } from './uncategorizedThemes';

const logger = createLogger('UncategorizedActionsBar');

Expand Down Expand Up @@ -76,6 +76,7 @@ function UncategorizedActionsBar({
existingFolders,
onFolderCreated,
onReanalyze,
onAssignFolder,
isAnalyzing = false,
addNotification
}) {
Expand All @@ -84,7 +85,7 @@ function UncategorizedActionsBar({
const earlierFiles = useEarlierUncategorizedFiles();

// Derive uncategorized files + pattern suggestions in one pass.
const { uncategorizedFiles, suggestion } = useMemo(() => {
const { uncategorizedFiles, suggestion, closest } = useMemo(() => {
// Prefer the grid's own resolution (user choice, engine ranking, then
// name matching) so this bar never counts a file the card shows placed.
const matcher =
Expand All @@ -109,13 +110,21 @@ function UncategorizedActionsBar({
combined && earlierCount < combined.files.length
? { ...combined, earlierCount }
: findRecurringTheme(uncategorized);
return { uncategorizedFiles: uncategorized, suggestion: theme };
return {
uncategorizedFiles: uncategorized,
suggestion: theme,
// Held files that all came closest to the same existing folder: often
// the right folder, just below the confidence bar. Files on this screen
// only, since only those can be given a folder here.
closest: findClosestFolderGroup(uncategorized, resolveDestination, existingFolders)
};
}, [
unprocessedFiles,
earlierFiles,
findSmartFolderForFile,
findSmartFolderForCategory,
resolveDestination
resolveDestination,
existingFolders
]);

const openCreateModal = useCallback((seedName = '') => {
Expand Down Expand Up @@ -177,6 +186,13 @@ function UncategorizedActionsBar({
if (paths.length > 0) onReanalyze(paths);
}, [uncategorizedFiles, onReanalyze, addNotification]);

const canAssignClosest = Boolean(closest) && typeof onAssignFolder === 'function';
const handleAssignClosest = useCallback(() => {
if (!closest || typeof onAssignFolder !== 'function') return;
const paths = closest.files.map((file) => file?.path).filter(Boolean);
if (paths.length > 0) onAssignFolder(paths, closest.folder.name);
}, [closest, onAssignFolder]);

if (uncategorizedFiles.length === 0) return null;

return (
Expand All @@ -191,6 +207,16 @@ function UncategorizedActionsBar({
{uncategorizedFiles.length}{' '}
{uncategorizedFiles.length === 1 ? 'file is' : 'files are'} uncategorized
</Text>
{canAssignClosest && (
<Text variant="tiny" className="text-system-gray-600 mt-1 flex items-center gap-1">
<FolderInput className="w-3.5 h-3.5 text-stratosort-blue inline-shrink-0" />
<span>
{closest.files.length} came closest to{' '}
<strong className="text-system-gray-800">{closest.folder.name}</strong>. Send them
there if that is where they belong.
</span>
</Text>
)}
{suggestion ? (
<Text variant="tiny" className="text-system-gray-600 mt-1 flex items-center gap-1">
<Lightbulb className="w-3.5 h-3.5 text-stratosort-blue inline-shrink-0" />
Expand All @@ -213,9 +239,15 @@ function UncategorizedActionsBar({
</div>

<div className="flex flex-wrap items-center gap-compact">
{canAssignClosest && (
<Button variant="primary" size="sm" onClick={handleAssignClosest}>
<FolderInput className="w-4 h-4 mr-1.5" />
Send {closest.files.length} to {closest.folder.name}
</Button>
)}
{suggestion && (
<Button
variant="primary"
variant={canAssignClosest ? 'secondary' : 'primary'}
size="sm"
onClick={() => openCreateModal(suggestion.displayName)}
>
Expand Down Expand Up @@ -273,6 +305,8 @@ UncategorizedActionsBar.propTypes = {
onFolderCreated: PropTypes.func,
// Analyzes the given paths again (the analysis run's reanalyzeFiles).
onReanalyze: PropTypes.func,
// Gives the given paths a Smart Folder (by name), as a bulk folder change does.
onAssignFolder: PropTypes.func,
isAnalyzing: PropTypes.bool,
addNotification: PropTypes.func
};
Expand Down
Loading
Loading