diff --git a/src/components/releasenotes/ReleaseNotesDialog.tsx b/src/components/releasenotes/ReleaseNotesDialog.tsx
index 5b7fda5..7986a19 100644
--- a/src/components/releasenotes/ReleaseNotesDialog.tsx
+++ b/src/components/releasenotes/ReleaseNotesDialog.tsx
@@ -5,15 +5,10 @@
* with the application bundle and always matches the running version.
* Markdown is rendered with the shared :mod:`MarkdownView` (``marked``
* + ``DOMPurify``).
- *
- * Opening the dialog records the current version as "seen" via
- * :func:`markReleaseSeen`, which clears the "NEW" badge surfaced by
- * the Welcome page.
*/
import { useEffect } from "react";
import { MarkdownView } from "../AIAssistant/MarkdownView";
-import { markReleaseSeen } from "../../utils/releaseNotes";
import changelogMd from "../../../CHANGELOG.md?raw";
/**
@@ -44,12 +39,10 @@ function stripEmptyUnreleased(md: string): string {
const releaseNotesMd = stripEmptyUnreleased(changelogMd);
interface Props {
- /** Current application version (e.g. ``"0.2.0"``). */
- appVersion: string;
onClose: () => void;
}
-export function ReleaseNotesDialog({ appVersion, onClose }: Props) {
+export function ReleaseNotesDialog({ onClose }: Props) {
// Esc closes the dialog (mirrors HelpDialog).
useEffect(() => {
const handler = (event: KeyboardEvent) => {
@@ -59,11 +52,6 @@ export function ReleaseNotesDialog({ appVersion, onClose }: Props) {
return () => window.removeEventListener("keydown", handler);
}, [onClose]);
- // Mark this version as seen as soon as the dialog is mounted.
- useEffect(() => {
- markReleaseSeen(appVersion);
- }, [appVersion]);
-
return (
void;
- /** Optional short text rendered as a coloured pill at the end of the
- * row label (e.g. ``"NEW"`` to highlight the release notes entry on
- * the first launch after an upgrade). */
- badge?: string;
}
/** Read/write helper for the "show welcome on startup" preference. */
@@ -110,7 +105,6 @@ export function WelcomeView({
onOpenReleaseNotes,
onOpenAIAssistant,
}: WelcomeViewProps) {
- const releaseNotesUnseen = useUnseenRelease(appVersion);
const startActions: QuickAction[] = [
{
iconUrl: getRootIconUrl("signal.svg"),
@@ -180,7 +174,6 @@ export function WelcomeView({
"Browse the full release notes and recent changes to DataLab-Web.",
),
onClick: onOpenReleaseNotes,
- badge: releaseNotesUnseen ? "NEW" : undefined,
},
];
@@ -310,14 +303,7 @@ function WelcomeActionRow({
/>
)}
-
- {action.label}
- {action.badge && (
-
- {action.badge}
-
- )}
-
+ {action.label}
{action.description && (
{action.description}
diff --git a/src/locales/fr.json b/src/locales/fr.json
index 097c0a2..21654e2 100644
--- a/src/locales/fr.json
+++ b/src/locales/fr.json
@@ -638,7 +638,6 @@
"n": "n",
"Name": "Nom",
"Nearest": "Plus proche",
- "New": "Nouveau",
"New axis": "Nouvel axe",
"New conversation": "Nouvelle conversation",
"New group": "Nouveau groupe",
diff --git a/src/styles.css b/src/styles.css
index 69461ef..b39f9bf 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -6296,21 +6296,6 @@ input {
color: var(--text);
}
-.welcome-action-badge {
- display: inline-block;
- margin-left: 8px;
- padding: 1px 6px;
- border-radius: 8px;
- background: var(--accent);
- color: #fff;
- font-size: 10px;
- font-weight: 700;
- letter-spacing: 0.5px;
- line-height: 1.4;
- vertical-align: middle;
- text-transform: uppercase;
-}
-
.welcome-action-description {
font-size: 12px;
color: var(--text-dim);
diff --git a/src/utils/releaseNotes.ts b/src/utils/releaseNotes.ts
deleted file mode 100644
index d89577c..0000000
--- a/src/utils/releaseNotes.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Helpers tracking whether the user has seen the release notes for the
- * currently running version of DataLab-Web.
- *
- * The version string is whatever is injected via
- * ``import.meta.env.VITE_APP_VERSION`` (see :mod:`HelpDialog`); the
- * "last seen" value is persisted in ``localStorage`` so the "NEW" hint
- * on the Welcome page only fires once per upgrade per browser profile.
- */
-
-import { useCallback, useEffect, useState } from "react";
-
-const LAST_SEEN_KEY = "datalab-web.releaseNotes.lastSeenVersion";
-
-/** Storage event name dispatched on the window when the "last seen"
- * value is updated within the same tab. ``storage`` events from the
- * Web Storage API only fire across tabs, so we synthesise our own for
- * intra-tab subscribers (e.g. the Welcome badge). */
-const CHANGE_EVENT = "datalab-web:releaseNotes:change";
-
-export function readLastSeenVersion(): string | null {
- try {
- return window.localStorage.getItem(LAST_SEEN_KEY);
- } catch {
- return null;
- }
-}
-
-export function markReleaseSeen(version: string): void {
- try {
- window.localStorage.setItem(LAST_SEEN_KEY, version);
- } catch {
- /* ignore quota / privacy mode errors */
- }
- window.dispatchEvent(new CustomEvent(CHANGE_EVENT));
-}
-
-export function hasUnseenRelease(currentVersion: string): boolean {
- // A missing or invalid version string should never produce a stuck
- // badge — treat it as "already seen".
- if (!currentVersion || currentVersion === "dev") return false;
- return readLastSeenVersion() !== currentVersion;
-}
-
-/** React hook exposing a reactive "is there a new release the user
- * hasn't acknowledged yet?" flag. Re-evaluates on mount and whenever
- * another component calls :func:`markReleaseSeen`. */
-export function useUnseenRelease(currentVersion: string): boolean {
- const compute = useCallback(
- () => hasUnseenRelease(currentVersion),
- [currentVersion],
- );
- const [unseen, setUnseen] = useState(compute);
- useEffect(() => {
- setUnseen(compute());
- const handler = () => setUnseen(compute());
- window.addEventListener(CHANGE_EVENT, handler);
- window.addEventListener("storage", handler);
- return () => {
- window.removeEventListener(CHANGE_EVENT, handler);
- window.removeEventListener("storage", handler);
- };
- }, [compute]);
- return unseen;
-}