增加好友排除反选功能

This commit is contained in:
xuncha
2026-02-17 01:59:37 +08:00
parent 6e434d37dc
commit 3b7590d8ce
4 changed files with 51 additions and 5 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "weflow", "name": "weflow",
"version": "1.5.4", "version": "2.0.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "weflow", "name": "weflow",
"version": "1.5.4", "version": "2.0.1",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"better-sqlite3": "^12.5.0", "better-sqlite3": "^12.5.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "weflow", "name": "weflow",
"version": "1.5.4", "version": "2.0.1",
"description": "WeFlow", "description": "WeFlow",
"main": "dist-electron/main.js", "main": "dist-electron/main.js",
"author": "cc", "author": "cc",

View File

@@ -482,13 +482,43 @@
margin-top: 16px; margin-top: 16px;
} }
.exclude-footer-left {
display: flex;
align-items: center;
gap: 12px;
}
.exclude-count { .exclude-count {
font-size: 12px; font-size: 12px;
color: var(--text-tertiary); color: var(--text-tertiary);
} }
.btn-text {
display: inline-flex;
align-items: center;
gap: 4px;
background: none;
border: none;
cursor: pointer;
font-size: 12px;
color: var(--text-secondary);
padding: 4px 8px;
border-radius: 6px;
transition: all 0.15s;
&:hover {
color: var(--primary);
background: var(--primary-light);
}
&:disabled {
opacity: 0.5;
cursor: not-allowed;
}
}
.exclude-actions { .exclude-actions {
display: flex; display: flex;
gap: 8px; gap: 8px;
} }
} }

View File

@@ -146,6 +146,17 @@ function AnalyticsPage() {
}) })
} }
const toggleInvertSelection = () => {
setDraftExcluded((prev) => {
const allUsernames = new Set(excludeCandidates.map(c => normalizeUsername(c.username)))
const inverted = new Set<string>()
for (const u of allUsernames) {
if (!prev.has(u)) inverted.add(u)
}
return inverted
})
}
const handleApplyExcluded = async () => { const handleApplyExcluded = async () => {
const payload = Array.from(draftExcluded) const payload = Array.from(draftExcluded)
setIsExcludeDialogOpen(false) setIsExcludeDialogOpen(false)
@@ -493,7 +504,12 @@ function AnalyticsPage() {
)} )}
</div> </div>
<div className="exclude-modal-footer"> <div className="exclude-modal-footer">
<span className="exclude-count"> {draftExcluded.size} </span> <div className="exclude-footer-left">
<span className="exclude-count"> {draftExcluded.size} </span>
<button className="btn btn-text" onClick={toggleInvertSelection} disabled={excludeLoading}>
</button>
</div>
<div className="exclude-actions"> <div className="exclude-actions">
<button className="btn btn-secondary" onClick={() => setIsExcludeDialogOpen(false)}> <button className="btn btn-secondary" onClick={() => setIsExcludeDialogOpen(false)}>