我在這張表上有一個表。分析它並幫我對其採取行動。
資料為:[DESCRIBE THE COLUMNS, e.g. "Column A date, B region, C revenue, D units"]
我想理解什麼:[YOUR QUESTION, e.g. "which region is growing fastest and where revenue per unit is dropping"]
做四件事:
1. 以簡易英文總結前 3 項趨勢,各附上支持數字。
2. 添加新欄計算 [METRIC, e.g. "revenue per unit"],在一行中解釋公式。
3. 標示看起來像錯誤或離群值的任何行。
4. 建議一個會顯示主要趨勢的圖表,及要使用的欄。
趕上已埋沒的電子郵件線程並在一個步驟中回應(Microsoft 365 Copilot in Outlook)。
提示詞 2 fields to fill
總結此信線及起草我的回覆。
首先摘要:什麼被決定、什麼仍開放、誰在等誰,及任何提及的日期——最多 5 項。
然後從我(、)起草回覆:[WHAT MY REPLY NEEDS TO DO, e.g. "confirm the Thursday deadline and ask Marcus for the credentials"]。
保留回覆 120 字以內、直接、無填充。不編造線中不在的任何事實。
我錯過了這次會議。使用對話記錄和錄製補償我。
給我:
1. 一個 3 句摘要:主題、主要決定、最大開放問題。
2. 表格形式的行動項目——所有人 | 工作 | 截止日期(若未說日期則使用「TBD」)。
3. 關於 [MY NAME or MY TEAM, e.g. "the data team" or "the migration"] 特定曾說過的任何內容。
4. 一項被辯論但未解決的事物。
不編造未提及的所有人或日期。
describe('calculateDiscount', () => {
it('applies the percentage discount to a normal price', () => {
expect(calculateDiscount(100, 20)).toBe(80);
});
it('returns the original price when discount is 0', () => {
expect(calculateDiscount(100, 0)).toBe(100);
});
it('throws when the discount is over 100%', () => {
expect(() => calculateDiscount(100, 120)).toThrow('Invalid discount');
});
it('rounds to 2 decimals to avoid floating-point drift', () => {
// 19.99 * 0.1 would otherwise yield 1.7991000000000002
expect(calculateDiscount(19.99, 10)).toBe(17.99);
});
});
提交:
fix: default user list to empty array to prevent render crash
The component rendered before the fetch resolved, so `data.map`
threw on undefined. Defaulting state to [] makes the first render
safe and removes the white-screen error on slow connections.
PR 描述:
修復使用者頁面上當 API 慢時的間斷崩潰。清單現在顯示空狀態而非拋出。
- 預設 `data` 狀態至 `[]` 而非 `undefined`
- 為失敗請求添加明確錯誤狀態
如何測試:將網路節流至「Slow 3G」並載入 /users——頁面應顯示空狀態,然後清單,無主控台錯誤。