Skip to content

Polish source health command center - #24

Merged
maniczko merged 1 commit into
mainfrom
codex/issue-12-p2-ops-007-feed-health-command-center
May 25, 2026
Merged

Polish source health command center#24
maniczko merged 1 commit into
mainfrom
codex/issue-12-p2-ops-007-feed-health-command-center

Conversation

@maniczko

Copy link
Copy Markdown
Owner

Summary

  • Split source health cards into two explicit axes: sync/source health and reading readiness.
  • Added visible next-action guidance derived only from existing source-health fields.
  • Reworked source actions into state-aware supported controls: sync, pause/resume, mute/unmute, snooze/unsnooze, regroup.
  • Documented the source health command-center UI standard.

Validation

  • npm ci
  • npm run test:unit:web -- source-health source-health-card
  • npm run test:unit:web -- source-health source-health-card source-health-actions
  • npm run build
  • npm run test:unit:web
  • python scripts/check_api.py
  • RSSMASTER_PLAYWRIGHT_MODULE=C:\Users\user\Desktop\RSSmaster\output\playwright-runtime\node_modules\playwright npm run check:sources
  • node output\playwright\source-health-command-center-runner.mjs

Evidence

  • Targeted screenshot: output/playwright/source-health-command-center.png
  • Targeted report: output/playwright/source-health-command-center.json
  • Standard sources smoke: output/playwright/sources-a11y-smoke.json

Closes #12

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the source health monitoring UI by introducing a dedicated SourceHealthActions component and redesigning the SourceHealthCard to distinguish between synchronization health and reading readiness. It also implements a 'Next Action' recommendation system and updates the documentation to reflect these UI patterns. Feedback includes addressing potential hydration mismatches caused by using new Date() in the component body, replacing magic numbers for time durations with named constants, and removing redundant logic in the indicator deduplication set.

style,
indicatorLimit = 4,
}: SourceHealthCardProps) {
const now = new Date();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Initializing now with new Date() directly in the component body can lead to hydration mismatches in SSR environments. If the server and client render times differ slightly, the relative date strings generated by formatRelativeDate might not match exactly between the server-rendered HTML and the client's first render, causing React to throw a hydration warning. Consider using a hook to ensure the value is stable or only calculated on the client after mount.

Comment on lines +87 to +98
snoozed_until: isSnoozed ? null : new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
})
}
>
{isSnoozed ? "Usuń drzemkę" : "Wstrzymaj 1d"}
</WorkspaceButton>
<WorkspaceButton
aria-label={isPaused ? `Wznów źródło: ${entry.title}` : `Pauza 7 dni: ${entry.title}`}
disabled={workspaceBusy}
onClick={() =>
void onControlUpdate(entry.channel_id, {
paused_until: isPaused ? null : new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Avoid using magic numbers for time durations (e.g., 24 * 60 * 60 * 1000). Defining constants for these durations (like ONE_DAY_MS or SEVEN_DAYS_MS) would improve readability and make the code easier to maintain.

Comment on lines +178 to +186
const controlGroupName = source.control?.groupName;
const indicatorDedupe = new Set(
[
source.control?.tier,
source.control?.groupName,
controlGroupName,
"bez grupy",
].filter(Boolean),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The indicatorDedupe set construction contains redundant entries. source.control?.groupName and controlGroupName refer to the same value, and both are included in the array. You can simplify this by removing the intermediate variable and the duplicate entry.

  const indicatorDedupe = new Set(
    [
      source.control?.tier,
      source.control?.groupName,
      "bez grupy",
    ].filter(Boolean),
  );

@maniczko
maniczko merged commit d7738a0 into main May 25, 2026
1 check passed
@maniczko
maniczko deleted the codex/issue-12-p2-ops-007-feed-health-command-center branch May 25, 2026 15:28

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a706c1b233

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +49 to +50
const isPaused = Boolean(entry.control.paused_until);
const isSnoozed = Boolean(entry.control.snoozed_until);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Determine timer state from future timestamps

isPaused/isSnoozed are derived from string presence, so any historical paused_until or snoozed_until value is treated as active. In this codebase, suppression logic only considers timers active when they are in the future (> now), so expired timers remain persisted but should not flip the UI into resume/unsnooze mode. With the current check, cards can show Wznów/Usuń drzemkę for already-expired timers and hide the expected one-click Pauza 7d/Wstrzymaj 1d actions.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2-OPS-007] Polish feed health command center readability

1 participant