Skip to content

Commit feaa1cf

Browse files
Extract Add metadata values with a regular expression (#20)
* feat(metadata): extract Add metadata values with a regular expression Bridge dialogs now resolve active states and callbacks while the Python call that opened them is pending. Assisted-by: Claude Opus 5.5 * refactor(welcome): remove the release notes NEW badge Assisted-by: Claude Opus 5.5
1 parent 2b8c7c5 commit feaa1cf

13 files changed

Lines changed: 517 additions & 137 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
1616
image-profile geometry, and is discarded on Cancel or Escape. For a single
1717
source, OK reuses a completed current preview once; stale, running and
1818
multi-selection previews fall back to normal processing.
19+
- **Add metadata:** _Edit > Metadata > Add metadata…_ can now extract the value from the formatted text with a regular expression, for example an exposure time or a shot number read from object titles. Objects without a match are left unchanged unless you ask for an error, a scale factor converts numeric values (e.g. milliseconds to seconds), and a live preview shows the resulting values. Keys may contain dots and hyphens, as used by plugin keys, and a **Known keys** list copies a key already present on the selected objects. Invalid settings are reported and the dialog reopens with your entries.
1920

2021
### Changed
2122

23+
- **Welcome page:** the "NEW" badge on the release notes entry has been removed.
2224
- **Histogram range editors:** generic parameter intervals now respect linked numeric constraints and read-only states. Brightness and contrast retains its specialized controls, including exact float64 window editing outside the source image's observed range.
2325
- **Guidata compatibility:** browser runtimes now require guidata 3.15 and use
2426
its native async DataSet backend and JSON Schema exporter. The former
2527
backend backport has been removed; a focused compatibility patch preserves
2628
the `FloatArrayItem` sizing and numeric-parity hints required by browser
2729
editors.
2830

31+
### Fixed
32+
33+
- **Plugin and macro dialogs:** fields enabled by another option, and values computed from other fields, now update while the dialog is open; they previously stayed frozen until the dialog was closed.
34+
2935
## [0.9.0] - 2026-08-11
3036

3137
### Added in 0.9.0

‎src/App.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5324,10 +5324,7 @@ export default function App() {
53245324
/>
53255325
)}
53265326
{releaseNotesOpen && (
5327-
<ReleaseNotesDialog
5328-
appVersion={(import.meta.env.VITE_APP_VERSION as string) ?? "dev"}
5329-
onClose={() => setReleaseNotesOpen(false)}
5330-
/>
5327+
<ReleaseNotesDialog onClose={() => setReleaseNotesOpen(false)} />
53315328
)}
53325329
{h5BrowserFiles !== null && (
53335330
<Suspense fallback={null}>

‎src/components/DialogBridge.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ export function DialogBridge() {
7171
? (currentValues) => runtime.resolveBridgeActive(currentValues)
7272
: undefined
7373
}
74+
resolveCallbacks={
75+
runtime
76+
? (itemName, currentValues) =>
77+
runtime.resolveBridgeCallbacks(itemName, currentValues)
78+
: undefined
79+
}
7480
/>
7581
);
7682
}

‎src/components/releasenotes/ReleaseNotesDialog.tsx‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,10 @@
55
* with the application bundle and always matches the running version.
66
* Markdown is rendered with the shared :mod:`MarkdownView` (``marked``
77
* + ``DOMPurify``).
8-
*
9-
* Opening the dialog records the current version as "seen" via
10-
* :func:`markReleaseSeen`, which clears the "NEW" badge surfaced by
11-
* the Welcome page.
128
*/
139

1410
import { useEffect } from "react";
1511
import { MarkdownView } from "../AIAssistant/MarkdownView";
16-
import { markReleaseSeen } from "../../utils/releaseNotes";
1712
import changelogMd from "../../../CHANGELOG.md?raw";
1813

1914
/**
@@ -44,12 +39,10 @@ function stripEmptyUnreleased(md: string): string {
4439
const releaseNotesMd = stripEmptyUnreleased(changelogMd);
4540

4641
interface Props {
47-
/** Current application version (e.g. ``"0.2.0"``). */
48-
appVersion: string;
4942
onClose: () => void;
5043
}
5144

52-
export function ReleaseNotesDialog({ appVersion, onClose }: Props) {
45+
export function ReleaseNotesDialog({ onClose }: Props) {
5346
// Esc closes the dialog (mirrors HelpDialog).
5447
useEffect(() => {
5548
const handler = (event: KeyboardEvent) => {
@@ -59,11 +52,6 @@ export function ReleaseNotesDialog({ appVersion, onClose }: Props) {
5952
return () => window.removeEventListener("keydown", handler);
6053
}, [onClose]);
6154

62-
// Mark this version as seen as soon as the dialog is mounted.
63-
useEffect(() => {
64-
markReleaseSeen(appVersion);
65-
}, [appVersion]);
66-
6755
return (
6856
<div
6957
className="overlay"

‎src/components/welcome/WelcomeView.tsx‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { getRootIconUrl } from "../../assets/rootIcons";
2222
import { getIoIconUrl } from "../../assets/ioIcons";
2323
import { getHelpIconUrl } from "../../assets/helpIcons";
2424
import { getH5IconUrl } from "../../assets/h5Icons";
25-
import { useUnseenRelease } from "../../utils/releaseNotes";
2625
import { t } from "../../i18n/translate";
2726

2827
type Kind = "signal" | "image";
@@ -71,10 +70,6 @@ interface QuickAction {
7170
* choose between Signal and Image. ``onKindSelect`` receives the
7271
* picked kind. */
7372
onKindSelect?: (kind: Kind) => void;
74-
/** Optional short text rendered as a coloured pill at the end of the
75-
* row label (e.g. ``"NEW"`` to highlight the release notes entry on
76-
* the first launch after an upgrade). */
77-
badge?: string;
7873
}
7974

8075
/** Read/write helper for the "show welcome on startup" preference. */
@@ -110,7 +105,6 @@ export function WelcomeView({
110105
onOpenReleaseNotes,
111106
onOpenAIAssistant,
112107
}: WelcomeViewProps) {
113-
const releaseNotesUnseen = useUnseenRelease(appVersion);
114108
const startActions: QuickAction[] = [
115109
{
116110
iconUrl: getRootIconUrl("signal.svg"),
@@ -180,7 +174,6 @@ export function WelcomeView({
180174
"Browse the full release notes and recent changes to DataLab-Web.",
181175
),
182176
onClick: onOpenReleaseNotes,
183-
badge: releaseNotesUnseen ? "NEW" : undefined,
184177
},
185178
];
186179

@@ -310,14 +303,7 @@ function WelcomeActionRow({
310303
/>
311304
)}
312305
<span className="welcome-action-text">
313-
<span className="welcome-action-label">
314-
{action.label}
315-
{action.badge && (
316-
<span className="welcome-action-badge" aria-label={t("New")}>
317-
{action.badge}
318-
</span>
319-
)}
320-
</span>
306+
<span className="welcome-action-label">{action.label}</span>
321307
{action.description && (
322308
<span className="welcome-action-description">
323309
{action.description}

‎src/locales/fr.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@
638638
"n": "n",
639639
"Name": "Nom",
640640
"Nearest": "Plus proche",
641-
"New": "Nouveau",
642641
"New axis": "Nouvel axe",
643642
"New conversation": "Nouvelle conversation",
644643
"New group": "Nouveau groupe",

0 commit comments

Comments
 (0)