Skip to content

PR744: UI Sharing Settings#744

Open
FFFxueGawaine wants to merge 1 commit into
Open-Less:betafrom
FFFxueGawaine:PR777
Open

PR744: UI Sharing Settings#744
FFFxueGawaine wants to merge 1 commit into
Open-Less:betafrom
FFFxueGawaine:PR777

Conversation

@FFFxueGawaine

@FFFxueGawaine FFFxueGawaine commented Jun 24, 2026

Copy link
Copy Markdown

User description

Summary

  • Add the overview share image demo flow with local SVG/PNG generation and platform copy actions.
  • Add estimated time reduction text to the Today duration metric.
  • Include the newly added front-end meeting/recording-related updates in PR PR744: UI Sharing Settings #744.

Front-end focus

  • Main visible change: show estimated time saved in the duration section.
  • Share modal supports saving the generated image and copying prepared image/text for social platforms.

Test

  • npm run build

PR Type

Bug fix, Enhancement, Tests


Description

  • Change history retention to unlimited and add migration

  • Update recording pruning when text history unbounded

  • Add share modal with SVG generation and time saved metric

  • Update i18n strings and descriptions for unlimited and duration


Diagram Walkthrough

flowchart LR
  A["Backend: history.rs, paths.rs, preferences.rs, types.rs"] --> B["Change default history retention to 0 (unlimited)"]
  A --> C["Add migration for legacy 7-day default"]
  A --> D["Update recording pruning fallback"]
  E["Frontend: Overview.tsx"] --> F["Add share modal with SVG image generation"]
  E --> G["Add estimated time saved metric"]
  H["Frontend: DataStorageSection.tsx"] --> I["Remove hard caps, handle unlimited input"]
  J["i18n: all languages"] --> K["Add unlimited, duration hours, updated descriptions"]
  L["Frontend: types.ts, mock-data.ts, test"] --> M["Update default value and comments"]
Loading

File Walkthrough

Relevant files
Bug fix
2 files
history.rs
Remove HISTORY_CAP and update retention logic                       
+8/-10   
paths.rs
Add fallback retention for recordings                                       
+4/-2     
Enhancement
4 files
preferences.rs
Add history retention migration and tests                               
+56/-6   
types.rs
Change default history retention to 0 and add migration flag
+22/-6   
Overview.tsx
Add share modal and estimated time saved metric                   
+772/-5 
DataStorageSection.tsx
Remove hard caps and handle unlimited input                           
+10/-12 
Documentation
6 files
en.ts
Add unlimited and duration format translations                     
+8/-4     
ja.ts
Update Japanese translations                                                         
+9/-5     
ko.ts
Update Korean translations                                                             
+9/-5     
zh-CN.ts
Update Chinese translations                                                           
+9/-5     
zh-TW.ts
Update Traditional Chinese translations                                   
+9/-5     
types.ts
Update comments for unlimited retention                                   
+3/-3     
Tests
2 files
mock-data.ts
Update default history retention to 0                                       
+1/-1     
stylePrefs.test.ts
Update test expected value                                                             
+1/-1     

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 7e83986)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

744 - Partially compliant

Compliant requirements:

  • Add overview share image demo flow with local SVG/PNG generation and platform copy actions
  • Add estimated time reduction text to the Today duration metric
  • Include newly added front-end meeting/recording-related updates from PR PR744: UI Sharing Settings #744
  • Share modal supports saving generated image and copying prepared image/text for social platforms

Non-compliant requirements:

  • Main visible change: show estimated time saved in the duration section – partially implemented; the efficiencyTinyText function uses a random case statement, which may not reliably display the estimated time saved every time

Requires further human verification:

  • The random cycling of the efficiency metric display should be verified against the intended UX (likely a leftover debugging artifact)
⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

The efficiencyTinyText function uses new Date().getDate() % 3 to randomly choose between three different descriptions of the efficiency metric (e.g., "预计节省 X 小时", "嘴比手快 X 倍", "少敲 X 字"). This non-deterministic behavior is likely a debugging remnant and will cause inconsistent user experience. The function should always display the primary estimated-time-saved information instead of cycling unpredictably.

function efficiencyTinyText(metrics: OverviewMetrics): string {
  if (metrics.charsToday <= 0) return '暂无效率估算';
  switch (new Date().getDate() % 3) {
    case 0:
      return `预计节省 ${formatSavedHours(metrics.savedMs)}`;
    case 1:
      return metrics.speedRatio > 0 ? `嘴比手快 ${metrics.speedRatio.toFixed(1)} 倍` : `少敲 ${metrics.charsToday.toLocaleString()} 字`;
    default:
      return `少敲 ${metrics.charsToday.toLocaleString()} 字`;
  }
Unbounded History Growth

Previously, append_with_retention applied a hard cap of 200 entries when max_entries was None. This PR removes that fallback entirely, so if max_entries is None (the default for a fresh install), the history list can grow without limit. While the "unlimited" design is intentional, there is no safeguard against extreme accumulation that could degrade load time or storage. Consider adding a generous upper bound (e.g., 10,000 entries) or a performance warning.

            .unwrap_or(true)
    });
}
if let Some(max_entries) = max_entries {
    let cap = (max_entries as usize).max(1);
    if sessions.len() > cap {
        sessions.truncate(cap);
    }
}

@FFFxueGawaine FFFxueGawaine changed the title PR777: add share image and meeting updates PR744: UI Sharing Settings Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 17630fa

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 7e83986

@appergb appergb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Blocking issues before merge: (1) this PR changes history retention semantics from the existing bounded default (7 days / default count cap) to unlimited retention and no count cap when historyMaxEntries is null. That is a product/privacy/storage behavior change far larger than the sharing UI and can make history.json and Overview rendering grow without bound. It should be split or gated with an explicit migration decision. (2) The new sharing modal has many hard-coded Chinese strings instead of i18n keys, despite this repo maintaining en/ja/ko/zh-CN/zh-TW strings. (3) Only PR-Agent has run; full platform CI is missing.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants