diff --git a/apps/mobile/src/features/pull-requests/PullRequestFiles.tsx b/apps/mobile/src/features/pull-requests/PullRequestFiles.tsx
index a380a468ff6c7..0f287bb862f4a 100644
--- a/apps/mobile/src/features/pull-requests/PullRequestFiles.tsx
+++ b/apps/mobile/src/features/pull-requests/PullRequestFiles.tsx
@@ -31,6 +31,7 @@ import {
} from "./usePullRequestDiff";
import { usePullRequestFileFilter } from "./usePullRequestFileFilter";
import { usePullRequestFilesViewed } from "./usePullRequestFilesViewed";
+import { usePullRequestReviewDraft } from "./usePullRequestReviewDraft";
import { requestPullRequestFileJump } from "./pullRequestFileJump";
import { fileDirectory, groupByDirectory } from "./pullRequestFileSections";
import type { MessageResolver } from "../../i18n/messages";
@@ -52,7 +53,13 @@ function useChangedFiles(params: PullRequestDiffParams) {
).changeRequest;
const diff = usePullRequestDiff(params, terminology);
const viewed = usePullRequestFilesViewed(params, pr);
- const filter = usePullRequestFileFilter(diff.parsed);
+ const reviewDraft = usePullRequestReviewDraft(params);
+ const filter = usePullRequestFileFilter(
+ diff.parsed,
+ viewed,
+ undefined,
+ reviewDraft.draft.comments.map((comment) => comment.path),
+ );
const parsed = filter.parsed;
return {
diff,
@@ -76,9 +83,10 @@ function describeFiles(
{ filter, viewed }: ChangedFiles,
resolve: MessageResolver,
) {
+ const hiding = filter.hiddenCount > 0 || filter.hiddenViewedCount > 0;
const count = parsed.fileCount;
return [
- filter.hiddenCount
+ hiding
? resolve(
msg("{count, plural, one {{count} visible file} other {{count} visible files}}", {
count,
@@ -89,13 +97,20 @@ function describeFiles(
count,
}),
),
- viewed.supported
- ? resolve(
- msg("{count, plural, one {{count} viewed} other {{count} viewed}}", {
- count: parsed.files.filter((file) => viewed.isViewed(file.path)).length,
- }),
- )
- : null,
+ !viewed.supported
+ ? null
+ : filter.hideViewedFiles
+ ? resolve(
+ msg(
+ "{count, plural, one {{count} viewed file hidden} other {{count} viewed files hidden}}",
+ { count: filter.hiddenViewedCount },
+ ),
+ )
+ : resolve(
+ msg("{count, plural, one {{count} viewed} other {{count} viewed}}", {
+ count: filter.viewedCount,
+ }),
+ ),
filter.hideTestFiles
? resolve(
msg("{count, plural, one {{count} test file hidden} other {{count} test files hidden}}", {
@@ -192,14 +207,26 @@ function FileFilterMenu({ filter }: { readonly filter: ChangedFiles["filter"] })
image: "line.3.horizontal.decrease",
state: filter.hideTestFiles ? "on" : "off",
},
+ ...(filter.canHideViewedFiles
+ ? [
+ {
+ id: "hide-viewed",
+ title: gt("Hide viewed files"),
+ image: "eye.slash",
+ state: filter.hideViewedFiles ? ("on" as const) : ("off" as const),
+ },
+ ]
+ : []),
]}
- onPressAction={filter.toggle}
+ onPressAction={({ nativeEvent }) =>
+ nativeEvent.event === "hide-viewed" ? filter.toggleViewedFiles() : filter.toggle()
+ }
>
@@ -209,6 +236,22 @@ function FileFilterMenu({ filter }: { readonly filter: ChangedFiles["filter"] })
function NoVisibleFiles({ files }: { readonly files: ChangedFiles }) {
const { diff, filter, parsed } = files;
const gt = useGT();
+ if (parsed.kind === "files" && parsed.files.length === 0 && filter.hiddenViewedCount > 0) {
+ return (
+
+ }
+ variant="plain"
+ />
+ );
+ }
if (parsed.kind === "files") {
return parsed.files.length === 0 && filter.hiddenCount > 0 ? (
pullRequestDiffPathMatches(linkAnchor.digest, file.path))
?.path
: undefined;
+ const viewed = usePullRequestFilesViewed(route.params, commit ? null : detail.data);
+ const reviewDraft = usePullRequestReviewDraft(route.params);
+ const [pickedPath, setJumpPath] = useState(null);
const filter = usePullRequestFileFilter(
result.parsed,
- linkPath ?? (route.params.focus ? route.params.path : undefined),
+ viewed,
+ linkPath ?? (route.params.path || undefined),
+ [
+ ...reviewDraft.draft.comments.map((comment) => comment.path),
+ ...(pickedPath ? [pickedPath] : []),
+ ],
);
const { refresh: refreshDetail } = detail;
useFocusEffect(refreshDetail);
const { loadMore } = result;
const parsed = filter.parsed;
- const reviewDraft = usePullRequestReviewDraft(route.params);
- const viewed = usePullRequestFilesViewed(route.params, commit ? null : detail.data);
const [commitViewedPaths, setCommitViewedPaths] = useState>(() => new Set());
const permissions = usePullRequestPermissions(route.params, detail.data);
const scopeKey = pullRequestReviewKey(route.params);
@@ -1105,7 +1111,6 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) {
code: row.content ?? "",
});
};
- const [pickedPath, setJumpPath] = useState(null);
const jumpPath = pickedPath ?? linkPath ?? route.params.path;
const requestedFile =
result.parsed.kind === "files"
@@ -1163,18 +1168,25 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) {
.map((file) => file.id);
const [visibleFileId, setVisibleFileId] = useState(null);
const nativeView = useRef(null);
- // The filter the current jump was made under. Hiding or showing test files replaces the rows,
- // so a jump made under the other filter has to run again. Native applies the entry
+ // The filters the current jump was made under. Hiding or showing files replaces the rows,
+ // so a jump made under other filters has to run again. Native applies the entry
// destination before its first viewport, so the first one counts as made.
- const jumpedUnder = useRef(targetFile ? filter.hideTestFiles : null);
+ const filterChoice = {
+ hideTestFiles: filter.hideTestFiles,
+ // Viewed marks can arrive after the first draw, so track what is hidden, not the setting.
+ hiddenViewedCount: filter.hiddenViewedCount,
+ };
+ const jumpedUnder = useRef(targetFile ? filterChoice : null);
const hasTestFiles =
result.parsed.kind === "files" &&
result.parsed.files.some((file) => isTestChangedFile(file.path));
const jumpStarted = () =>
- jumpedUnder.current !== null && (!hasTestFiles || jumpedUnder.current === filter.hideTestFiles);
+ jumpedUnder.current !== null &&
+ (!hasTestFiles || jumpedUnder.current.hideTestFiles === filter.hideTestFiles) &&
+ jumpedUnder.current.hiddenViewedCount === filter.hiddenViewedCount;
const scrollToFile = (fileId: string) => {
if (!nativeView.current) return;
- jumpedUnder.current = filter.hideTestFiles;
+ jumpedUnder.current = filterChoice;
void nativeView.current.scrollToFile(fileId, false).catch(() => {
jumpedUnder.current = null;
});
@@ -1224,7 +1236,7 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) {
nativeView,
jumpStarted,
setJumpStarted: (started) => {
- jumpedUnder.current = started ? filter.hideTestFiles : null;
+ jumpedUnder.current = started ? filterChoice : null;
},
onDebug: bridge.onDebug,
loadMore,
@@ -1237,11 +1249,18 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) {
);
};
const visibleFile = data.files.find((file) => file.id === visibleFileId) ?? targetFile;
- const toggleTestFiles = () => {
+ const keepVisibleFile = () => {
setJumpPath(visibleFile?.path ?? route.params.path);
setSelectedRowId(null);
+ };
+ const toggleTestFiles = () => {
+ keepVisibleFile();
filter.toggle();
};
+ const toggleViewedFiles = () => {
+ keepVisibleFile();
+ filter.toggleViewedFiles();
+ };
const title = commit ? gt("Commit changes") : gt("Changes");
const seekingFile = !targetFile && result.nextCursor !== null;
const loadingDiff = (result.isPending && !data.rows.length) || (seekingFile && !result.error);
@@ -1292,6 +1311,17 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) {
selected: filter.hideTestFiles,
onPress: toggleTestFiles,
},
+ ...(filter.canHideViewedFiles
+ ? [
+ {
+ id: "hide-viewed",
+ title: gt("Hide viewed files"),
+ icon: "eye.slash",
+ selected: filter.hideViewedFiles,
+ onPress: toggleViewedFiles,
+ },
+ ]
+ : []),
...(selectedRow && selectedFile && canCommentOnDiff
? [
{
@@ -1329,6 +1359,15 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) {
count: filter.hiddenCount,
})}`
: ""
+ }${
+ filter.hiddenViewedCount
+ ? ` · ${gt(
+ "{count, plural, one {{count} viewed hidden} other {{count} viewed hidden}}",
+ {
+ count: filter.hiddenViewedCount,
+ },
+ )}`
+ : ""
}`}
onBack={() => navigation.goBack()}
menus={verticalControls ? undefined : [diffMenu]}
@@ -1440,6 +1479,25 @@ function PullRequestFileRouteContent({ route }: PullRequestFileRouteProps) {
contentResetKey={`pull-request:${route.params.environmentId}:${route.params.repository}:${route.params.number}:${commit ?? "all"}`}
/>
+ ) : filter.hiddenViewedCount > 0 &&
+ !data.rows.length &&
+ !result.isPending &&
+ !result.error &&
+ !seekingFile ? (
+
+
+ }
+ variant="plain"
+ />
+
) : filter.hiddenCount > 0 &&
!data.rows.length &&
!result.isPending &&
diff --git a/apps/mobile/src/features/pull-requests/pullRequestFileFilters.test.ts b/apps/mobile/src/features/pull-requests/pullRequestFileFilters.test.ts
index bafdea51a8002..3e8775c9fadef 100644
--- a/apps/mobile/src/features/pull-requests/pullRequestFileFilters.test.ts
+++ b/apps/mobile/src/features/pull-requests/pullRequestFileFilters.test.ts
@@ -1,7 +1,12 @@
import { describe, expect, it } from "vite-plus/test";
import { buildNativeReviewDiffData } from "../review/nativeReviewDiffAdapter";
import { buildReviewParsedDiff } from "../review/reviewModel";
-import { filterPullRequestTestFiles, shownPatchIndices } from "./pullRequestFileFilters";
+import {
+ filterPullRequestTestFiles,
+ filterPullRequestViewedFiles,
+ shownPatchIndices,
+ viewedFilePaths,
+} from "./pullRequestFileFilters";
function patch(path: string) {
return `diff --git a/${path} b/${path}\n--- a/${path}\n+++ b/${path}\n@@ -1 +1 @@\n-old\n+new\n`;
@@ -42,6 +47,31 @@ describe("mobile PR test file filter", () => {
expect(visible.files[1]).toBe(parsed.files[2]);
});
+ it("hides viewed files except those kept on screen", () => {
+ const parsed = buildReviewParsedDiff(
+ ["src/read.ts", "src/opened.ts", "src/drafted.ts", "src/unread.ts"].map(patch).join("\n"),
+ "pr",
+ );
+ const paths = viewedFilePaths(
+ parsed,
+ (path) => path !== "src/unread.ts",
+ (path) => path === "src/opened.ts" || path === "src/drafted.ts",
+ );
+ expect(paths).toEqual({
+ viewed: ["src/read.ts", "src/opened.ts", "src/drafted.ts"],
+ hidden: ["src/read.ts"],
+ });
+ const visible = filterPullRequestViewedFiles(parsed, new Set(paths.hidden));
+ if (parsed.kind !== "files" || visible.kind !== "files") throw new Error("Expected files");
+ expect(visible.files.map((file) => file.path)).toEqual([
+ "src/opened.ts",
+ "src/drafted.ts",
+ "src/unread.ts",
+ ]);
+ expect(visible.fileCount).toBe(3);
+ expect(filterPullRequestViewedFiles(parsed, new Set())).toBe(parsed);
+ });
+
it("uses the current path when a file is renamed out of a test directory", () => {
const parsed = buildReviewParsedDiff(
"diff --git a/tests/helper.ts b/src/helper.ts\nsimilarity index 100%\nrename from tests/helper.ts\nrename to src/helper.ts\n",
diff --git a/apps/mobile/src/features/pull-requests/pullRequestFileFilters.ts b/apps/mobile/src/features/pull-requests/pullRequestFileFilters.ts
index 9a0a5f08cc71a..05ef2f2b7c24d 100644
--- a/apps/mobile/src/features/pull-requests/pullRequestFileFilters.ts
+++ b/apps/mobile/src/features/pull-requests/pullRequestFileFilters.ts
@@ -1,15 +1,9 @@
import { isTestChangedFile } from "@t3tools/shared/changedFileKind";
import type { ReviewParsedDiff } from "../review/reviewModel";
-export function filterPullRequestTestFiles(
- parsed: ReviewParsedDiff,
- hideTestFiles: boolean,
- includePath?: string,
-): ReviewParsedDiff {
- if (!hideTestFiles || parsed.kind !== "files") return parsed;
- const files = parsed.files.filter(
- (file) => file.path === includePath || !isTestChangedFile(file.path),
- );
+function keepFiles(parsed: ReviewParsedDiff, keep: (path: string) => boolean): ReviewParsedDiff {
+ if (parsed.kind !== "files") return parsed;
+ const files = parsed.files.filter((file) => keep(file.path));
if (files.length === parsed.files.length) return parsed;
return {
...parsed,
@@ -20,6 +14,33 @@ export function filterPullRequestTestFiles(
};
}
+export function filterPullRequestTestFiles(
+ parsed: ReviewParsedDiff,
+ hideTestFiles: boolean,
+ includePath?: string,
+): ReviewParsedDiff {
+ if (!hideTestFiles) return parsed;
+ return keepFiles(parsed, (path) => path === includePath || !isTestChangedFile(path));
+}
+
+/** Viewed files among `parsed`, and those the filter hides: every one not kept on screen. */
+export function viewedFilePaths(
+ parsed: ReviewParsedDiff,
+ isViewed: (path: string) => boolean,
+ isKept: (path: string) => boolean,
+) {
+ const viewed =
+ parsed.kind === "files" ? parsed.files.map((file) => file.path).filter(isViewed) : [];
+ return { viewed, hidden: viewed.filter((path) => !isKept(path)) };
+}
+
+export function filterPullRequestViewedFiles(
+ parsed: ReviewParsedDiff,
+ hiddenPaths: ReadonlySet,
+): ReviewParsedDiff {
+ return keepFiles(parsed, (path) => !hiddenPaths.has(path));
+}
+
/** Patches to load around `index` (or from the top): the next three files the review will show. */
export function shownPatchIndices(
files: ReadonlyArray<{ readonly path: string }>,
diff --git a/apps/mobile/src/features/pull-requests/usePullRequestFileFilter.ts b/apps/mobile/src/features/pull-requests/usePullRequestFileFilter.ts
index ed14dd3b3a6e8..e823133cb2a58 100644
--- a/apps/mobile/src/features/pull-requests/usePullRequestFileFilter.ts
+++ b/apps/mobile/src/features/pull-requests/usePullRequestFileFilter.ts
@@ -4,7 +4,12 @@ import { useMemo } from "react";
import type { ReviewParsedDiff } from "../review/reviewModel";
import { mobilePreferencesAtom, saveMobilePreferences } from "../../state/preferences";
import { useAtomCommand } from "../../state/use-atom-command";
-import { filterPullRequestTestFiles } from "./pullRequestFileFilters";
+import {
+ filterPullRequestTestFiles,
+ filterPullRequestViewedFiles,
+ viewedFilePaths,
+} from "./pullRequestFileFilters";
+import type { usePullRequestFilesViewed } from "./usePullRequestFilesViewed";
export function useHideTestFilesPreference() {
const preferences = useAtomValue(mobilePreferencesAtom);
@@ -22,14 +27,59 @@ export function useHideTestFilesPreference() {
};
}
-export function usePullRequestFileFilter(parsed: ReviewParsedDiff, includePath?: string) {
- const preference = useHideTestFilesPreference();
- const { hideTestFiles } = preference;
- const visible = useMemo(
+const PATH_SEPARATOR = "\0";
+
+export function usePullRequestFileFilter(
+ parsed: ReviewParsedDiff,
+ viewed: ReturnType,
+ includePath?: string,
+ keptPaths: readonly string[] = [],
+) {
+ const testFilesPreference = useHideTestFilesPreference();
+ const { hideTestFiles } = testFilesPreference;
+ const preferences = useAtomValue(mobilePreferencesAtom);
+ const savePreferences = useAtomCommand(saveMobilePreferences);
+ const hideViewedFiles =
+ viewed.supported &&
+ AsyncResult.isSuccess(preferences) &&
+ preferences.value.pullRequestHideViewedFiles === true;
+ const withoutTests = useMemo(
() => filterPullRequestTestFiles(parsed, hideTestFiles, includePath),
[parsed, hideTestFiles, includePath],
);
+ const { viewed: viewedPaths, hidden } = viewedFilePaths(
+ withoutTests,
+ (path) => viewed.supported && viewed.isViewed(path),
+ // Files marked here stay until the screen closes, so marking one never pulls it out from under you.
+ (path) => path === includePath || keptPaths.includes(path) || viewed.toggledHere(path),
+ );
+ const hiddenViewedPaths = hideViewedFiles ? hidden : [];
+ // A string key keeps the same diff object while the hidden set holds, so native rows aren't rebuilt.
+ const hiddenViewedKey = hiddenViewedPaths.join(PATH_SEPARATOR);
+ const visible = useMemo(
+ () =>
+ hiddenViewedKey
+ ? filterPullRequestViewedFiles(withoutTests, new Set(hiddenViewedKey.split(PATH_SEPARATOR)))
+ : withoutTests,
+ [withoutTests, hiddenViewedKey],
+ );
const hiddenCount =
- parsed.kind === "files" && visible.kind === "files" ? parsed.fileCount - visible.fileCount : 0;
- return { ...preference, parsed: visible, hiddenCount };
+ parsed.kind === "files" && withoutTests.kind === "files"
+ ? parsed.fileCount - withoutTests.fileCount
+ : 0;
+ return {
+ ...testFilesPreference,
+ parsed: visible,
+ hiddenCount,
+ hideViewedFiles,
+ viewedCount: viewedPaths.length,
+ hiddenViewedCount: hiddenViewedPaths.length,
+ canHideViewedFiles: viewed.supported && (viewedPaths.length > 0 || hideViewedFiles),
+ toggleViewedFiles: () => {
+ void savePreferences({ pullRequestHideViewedFiles: !hideViewedFiles });
+ },
+ showViewedFiles: () => {
+ void savePreferences({ pullRequestHideViewedFiles: false });
+ },
+ };
}
diff --git a/apps/mobile/src/features/pull-requests/usePullRequestFilesViewed.ts b/apps/mobile/src/features/pull-requests/usePullRequestFilesViewed.ts
index ad10739fefa96..208d54f81e499 100644
--- a/apps/mobile/src/features/pull-requests/usePullRequestFilesViewed.ts
+++ b/apps/mobile/src/features/pull-requests/usePullRequestFilesViewed.ts
@@ -33,6 +33,9 @@ export function usePullRequestFilesViewed(params: PullRequestParams, pr: PullReq
const reads = useAtomValue(readsAtom);
const write = useAtomCommand(composerPullRequests.setFilesViewed, { reportFailure: false });
const [state, setState] = useState({ key: scopeKey, presses: {}, error: null });
+ // Kept apart from `presses`, which a failed write clears, so a file marked here stays listed.
+ const [marked, setMarked] = useState({ key: scopeKey, paths: new Set() });
+ const markedPaths = marked.key === scopeKey ? marked.paths : null;
const presses = state.key === scopeKey ? state.presses : {};
const error = state.key === scopeKey ? state.error : null;
const overlay = viewedOverlay(presses, reads);
@@ -47,6 +50,10 @@ export function usePullRequestFilesViewed(params: PullRequestParams, pr: PullReq
if (!supported || !allowed || !query.data) return;
const viewed = !isViewed(path);
const version = (presses[path]?.version ?? 0) + 1;
+ setMarked((current) => ({
+ key: scopeKey,
+ paths: new Set(current.key === scopeKey ? current.paths : []).add(path),
+ }));
update((current) => ({
...current,
error: null,
@@ -86,6 +93,7 @@ export function usePullRequestFilesViewed(params: PullRequestParams, pr: PullReq
supported,
canToggle: supported && allowed && Boolean(query.data),
isViewed,
+ toggledHere: (path: string) => markedPaths?.has(path) === true,
toggle,
error: error ?? query.error,
truncated: query.data?.truncated,
diff --git a/apps/mobile/src/features/review/ReviewSheet.tsx b/apps/mobile/src/features/review/ReviewSheet.tsx
index 7142394011e5e..235d8128dd0a7 100644
--- a/apps/mobile/src/features/review/ReviewSheet.tsx
+++ b/apps/mobile/src/features/review/ReviewSheet.tsx
@@ -59,7 +59,7 @@ import { resolveSelectedReviewFileId } from "./reviewPaneSelection";
import { buildReviewSectionMenu } from "./review-section-menu";
import { reportShowcaseSceneRendered } from "../showcase/showcaseRenderSignal";
import { useSelectWorkspaceDetail } from "../layout/workspace/useSelectWorkspaceDetail";
-import type { usePullRequestFileFilter } from "../pull-requests/usePullRequestFileFilter";
+import type { useHideTestFilesPreference } from "../pull-requests/usePullRequestFileFilter";
function ReviewHeader(
props: Parameters[0] & {
@@ -68,7 +68,7 @@ function ReviewHeader(
readonly showChangedFilesToggle: boolean;
readonly selectedRepositoryKey: string | null;
readonly onSelectRepository: (key: string | null) => void;
- readonly fileFilter: ReturnType;
+ readonly fileFilter: ReturnType;
readonly onSelectSection: (sectionId: string) => void;
readonly onReturnToThread: () => void;
},
diff --git a/apps/mobile/src/i18n/translations/de.json b/apps/mobile/src/i18n/translations/de.json
index 8777f08e663ce..92f9a34574093 100644
--- a/apps/mobile/src/i18n/translations/de.json
+++ b/apps/mobile/src/i18n/translations/de.json
@@ -2652,6 +2652,7 @@
"4bc1f12855e979de": "Generiert",
"01656e6237ddc437": "Doku",
"e1d19bd1b90ef329": "{count, plural, one {{count} sichtbare Datei} other {{count} sichtbare Dateien}}",
+ "872bf68b2e05f055": "{count, plural, one {{count} angesehene Datei ausgeblendet} other {{count} angesehene Dateien ausgeblendet}}",
"322f9f6712e4a3a7": "{count, plural, one {{count} angesehen} other {{count} angesehen}}",
"ccd5fc4db08374d7": "{count, plural, one {{count} Testdatei ausgeblendet} other {{count} Testdateien ausgeblendet}}",
"cb1e1e72fc3d2382": "Testdateien eingeschlossen",
@@ -2659,7 +2660,12 @@
"e6fef106eeaa76ce": "Diff für {path} anzeigen, {additions} Hinzufügungen, {deletions} Löschungen",
"a52407bfe5da5df2": "Dateien prüfen",
"a7764874320578a8": "Testdateien ausblenden",
+ "f538b8016f5ca2f3": "Angesehene Dateien ausblenden",
"186b7ac75ed4674c": "Review-Dateien filtern",
+ "be348514e8486295": "Noch keine nicht angesehenen Dateien geladen",
+ "6b7765835778dc77": "Alle Dateien sind ausgeblendet",
+ "bd2cfcb7be24cd38": "Angesehene Dateien sind in diesem Review ausgeblendet.",
+ "6ae1484aa5bd2bc8": "Angesehene Dateien anzeigen",
"5f6124336821ef3c": "Noch keine Nicht-Testdateien geladen",
"6d63711bee3ce542": "Nur Testdateien geändert",
"7cb130d96321fe5a": "Testdateien sind in diesem Review ausgeblendet.",
@@ -2863,6 +2869,7 @@
"3724ff240986c6da": "Änderungen committen",
"d85877d9ef77c50c": "Änderungen",
"ebb089d626dfaa7c": "Änderungen werden geladen",
+ "15db3431c35d4927": "{count, plural, one {{count} angesehen ausgeblendet} other {{count} angesehen ausgeblendet}}",
"4050f873dc790f8f": "Diff-Optionen",
"81cf438219f0a618": "Zeilenumbruch",
"8ec7e405049af1f7": "Entwurf in diese Zeile verschieben",
diff --git a/apps/mobile/src/i18n/translations/en.json b/apps/mobile/src/i18n/translations/en.json
index dfe3a473fe248..3b1c0c1d3d936 100644
--- a/apps/mobile/src/i18n/translations/en.json
+++ b/apps/mobile/src/i18n/translations/en.json
@@ -2652,6 +2652,7 @@
"4bc1f12855e979de": "Generated",
"01656e6237ddc437": "Docs",
"e1d19bd1b90ef329": "{count, plural, one {{count} visible file} other {{count} visible files}}",
+ "872bf68b2e05f055": "{count, plural, one {{count} viewed file hidden} other {{count} viewed files hidden}}",
"322f9f6712e4a3a7": "{count, plural, one {{count} viewed} other {{count} viewed}}",
"ccd5fc4db08374d7": "{count, plural, one {{count} test file hidden} other {{count} test files hidden}}",
"cb1e1e72fc3d2382": "Test files included",
@@ -2659,7 +2660,12 @@
"e6fef106eeaa76ce": "View diff for {path}, {additions} additions, {deletions} deletions",
"a52407bfe5da5df2": "Review files",
"a7764874320578a8": "Hide test files",
+ "f538b8016f5ca2f3": "Hide viewed files",
"186b7ac75ed4674c": "Filter review files",
+ "be348514e8486295": "No unviewed files loaded yet",
+ "6b7765835778dc77": "All files are hidden",
+ "bd2cfcb7be24cd38": "Viewed files are hidden from this review.",
+ "6ae1484aa5bd2bc8": "Show viewed files",
"5f6124336821ef3c": "No non-test files loaded yet",
"6d63711bee3ce542": "Only test files changed",
"7cb130d96321fe5a": "Test files are hidden from this review.",
@@ -2863,6 +2869,7 @@
"3724ff240986c6da": "Commit changes",
"d85877d9ef77c50c": "Changes",
"ebb089d626dfaa7c": "Loading changes",
+ "15db3431c35d4927": "{count, plural, one {{count} viewed hidden} other {{count} viewed hidden}}",
"4050f873dc790f8f": "Diff options",
"81cf438219f0a618": "Word wrap",
"8ec7e405049af1f7": "Move draft to this line",
diff --git a/apps/mobile/src/i18n/translations/es.json b/apps/mobile/src/i18n/translations/es.json
index 05f58a63227d3..2905a6adb2a00 100644
--- a/apps/mobile/src/i18n/translations/es.json
+++ b/apps/mobile/src/i18n/translations/es.json
@@ -2648,6 +2648,7 @@
"4bc1f12855e979de": "Generados",
"01656e6237ddc437": "Documentación",
"e1d19bd1b90ef329": "{count, plural, one {{count} archivo visible} other {{count} archivos visibles}}",
+ "872bf68b2e05f055": "{count, plural, one {{count} archivo visto oculto} other {{count} archivos vistos ocultos}}",
"322f9f6712e4a3a7": "{count, plural, one {{count} visto} other {{count} vistos}}",
"ccd5fc4db08374d7": "{count, plural, one {{count} archivo de prueba oculto} other {{count} archivos de prueba ocultos}}",
"cb1e1e72fc3d2382": "Archivos de pruebas incluidos",
@@ -2655,7 +2656,12 @@
"e6fef106eeaa76ce": "Ver diff de {path}, {additions} adiciones, {deletions} eliminaciones",
"a52407bfe5da5df2": "Revisar archivos",
"a7764874320578a8": "Ocultar archivos de prueba",
+ "f538b8016f5ca2f3": "Ocultar archivos vistos",
"186b7ac75ed4674c": "Filtrar archivos de la revisión",
+ "be348514e8486295": "Aún no se han cargado archivos sin ver",
+ "6b7765835778dc77": "Todos los archivos están ocultos",
+ "bd2cfcb7be24cd38": "Los archivos vistos están ocultos en esta revisión.",
+ "6ae1484aa5bd2bc8": "Mostrar archivos vistos",
"5f6124336821ef3c": "Aún no se han cargado archivos que no sean de pruebas",
"6d63711bee3ce542": "Solo cambiaron archivos de pruebas",
"7cb130d96321fe5a": "Los archivos de pruebas están ocultos en esta revisión.",
@@ -2859,6 +2865,7 @@
"3724ff240986c6da": "Hacer commit de los cambios",
"d85877d9ef77c50c": "Cambios",
"ebb089d626dfaa7c": "Cargando cambios",
+ "15db3431c35d4927": "{count, plural, one {{count} visto oculto} other {{count} vistos ocultos}}",
"4050f873dc790f8f": "Opciones del diff",
"81cf438219f0a618": "Ajuste de línea",
"8ec7e405049af1f7": "Mover el borrador a esta línea",
diff --git a/apps/mobile/src/i18n/translations/fr.json b/apps/mobile/src/i18n/translations/fr.json
index f661c315215c0..0aa0272df1180 100644
--- a/apps/mobile/src/i18n/translations/fr.json
+++ b/apps/mobile/src/i18n/translations/fr.json
@@ -2648,6 +2648,7 @@
"4bc1f12855e979de": "Générés",
"01656e6237ddc437": "Docs",
"e1d19bd1b90ef329": "{count, plural, one {{count} fichier visible} other {{count} fichiers visibles}}",
+ "872bf68b2e05f055": "{count, plural, one {{count} fichier consulté masqué} other {{count} fichiers consultés masqués}}",
"322f9f6712e4a3a7": "{count, plural, one {{count} consulté} other {{count} consultés}}",
"ccd5fc4db08374d7": "{count, plural, one {{count} fichier de test masqué} other {{count} fichiers de test masqués}}",
"cb1e1e72fc3d2382": "Fichiers de test inclus",
@@ -2655,7 +2656,12 @@
"e6fef106eeaa76ce": "Voir le diff de {path}, {additions} ajouts, {deletions} suppressions",
"a52407bfe5da5df2": "Fichiers de la revue",
"a7764874320578a8": "Masquer les fichiers de test",
+ "f538b8016f5ca2f3": "Masquer les fichiers consultés",
"186b7ac75ed4674c": "Filtrer les fichiers de la revue",
+ "be348514e8486295": "Aucun fichier non consulté chargé pour l’instant",
+ "6b7765835778dc77": "Tous les fichiers sont masqués",
+ "bd2cfcb7be24cd38": "Les fichiers consultés sont masqués dans cette revue.",
+ "6ae1484aa5bd2bc8": "Afficher les fichiers consultés",
"5f6124336821ef3c": "Aucun fichier hors test chargé pour l’instant",
"6d63711bee3ce542": "Seuls des fichiers de test ont changé",
"7cb130d96321fe5a": "Les fichiers de test sont masqués dans cette revue.",
@@ -2859,6 +2865,7 @@
"3724ff240986c6da": "Commiter les modifications",
"d85877d9ef77c50c": "Modifications",
"ebb089d626dfaa7c": "Chargement des modifications",
+ "15db3431c35d4927": "{count, plural, one {{count} consulté masqué} other {{count} consultés masqués}}",
"4050f873dc790f8f": "Options du diff",
"81cf438219f0a618": "Retour à la ligne",
"8ec7e405049af1f7": "Déplacer le brouillon sur cette ligne",
diff --git a/apps/mobile/src/i18n/translations/ja.json b/apps/mobile/src/i18n/translations/ja.json
index 56616809052d3..13e06fe2d680e 100644
--- a/apps/mobile/src/i18n/translations/ja.json
+++ b/apps/mobile/src/i18n/translations/ja.json
@@ -2645,6 +2645,7 @@
"4bc1f12855e979de": "生成ファイル",
"01656e6237ddc437": "ドキュメント",
"e1d19bd1b90ef329": "{count, plural, other {表示中のファイル {count} 個}}",
+ "872bf68b2e05f055": "{count, plural, other {{count} 個の確認済みファイルを非表示}}",
"322f9f6712e4a3a7": "{count, plural, other {{count} 件を確認済み}}",
"ccd5fc4db08374d7": "{count, plural, other {{count} 個のテストファイルを非表示}}",
"cb1e1e72fc3d2382": "テストファイルを含む",
@@ -2652,7 +2653,12 @@
"e6fef106eeaa76ce": "{path} の差分を表示、{additions} 行追加、{deletions} 行削除",
"a52407bfe5da5df2": "ファイルをレビュー",
"a7764874320578a8": "テストファイルを非表示",
+ "f538b8016f5ca2f3": "確認済みファイルを非表示",
"186b7ac75ed4674c": "レビューするファイルを絞り込む",
+ "be348514e8486295": "未確認のファイルはまだ読み込まれていません",
+ "6b7765835778dc77": "すべてのファイルが非表示です",
+ "bd2cfcb7be24cd38": "このレビューでは確認済みファイルは非表示です。",
+ "6ae1484aa5bd2bc8": "確認済みファイルを表示",
"5f6124336821ef3c": "テスト以外のファイルはまだ読み込まれていません",
"6d63711bee3ce542": "変更されたのはテストファイルのみです",
"7cb130d96321fe5a": "このレビューではテストファイルは非表示です。",
@@ -2856,6 +2862,7 @@
"3724ff240986c6da": "変更をコミット",
"d85877d9ef77c50c": "変更",
"ebb089d626dfaa7c": "変更を読み込んでいます",
+ "15db3431c35d4927": "{count, plural, other {確認済み {count} 件を非表示}}",
"4050f873dc790f8f": "差分のオプション",
"81cf438219f0a618": "折り返し",
"8ec7e405049af1f7": "下書きをこの行に移動",
diff --git a/apps/mobile/src/i18n/translations/ko.json b/apps/mobile/src/i18n/translations/ko.json
index 443285f8664c4..9ecf220dd249c 100644
--- a/apps/mobile/src/i18n/translations/ko.json
+++ b/apps/mobile/src/i18n/translations/ko.json
@@ -2649,6 +2649,7 @@
"4bc1f12855e979de": "생성됨",
"01656e6237ddc437": "문서",
"e1d19bd1b90ef329": "{count, plural, other {표시된 파일 {count}개}}",
+ "872bf68b2e05f055": "{count, plural, other {확인한 파일 {count}개 숨겨짐}}",
"322f9f6712e4a3a7": "{count, plural, other {{count}개 확인함}}",
"ccd5fc4db08374d7": "{count, plural, other {테스트 파일 {count}개 숨겨짐}}",
"cb1e1e72fc3d2382": "테스트 파일 포함",
@@ -2656,7 +2657,12 @@
"e6fef106eeaa76ce": "{path} 변경 사항 보기, 추가 {additions}줄, 삭제 {deletions}줄",
"a52407bfe5da5df2": "파일 검토",
"a7764874320578a8": "테스트 파일 숨기기",
+ "f538b8016f5ca2f3": "확인한 파일 숨기기",
"186b7ac75ed4674c": "검토 파일 필터",
+ "be348514e8486295": "아직 불러온 미확인 파일이 없습니다",
+ "6b7765835778dc77": "모든 파일이 숨겨져 있습니다",
+ "bd2cfcb7be24cd38": "이 검토에서는 확인한 파일이 숨겨져 있습니다.",
+ "6ae1484aa5bd2bc8": "확인한 파일 표시",
"5f6124336821ef3c": "아직 불러온 테스트 외 파일이 없습니다",
"6d63711bee3ce542": "테스트 파일만 변경됨",
"7cb130d96321fe5a": "이 검토에서는 테스트 파일이 숨겨져 있습니다.",
@@ -2860,6 +2866,7 @@
"3724ff240986c6da": "변경 사항 커밋",
"d85877d9ef77c50c": "변경 사항",
"ebb089d626dfaa7c": "변경 사항 불러오는 중",
+ "15db3431c35d4927": "{count, plural, other {확인함 {count}개 숨김}}",
"4050f873dc790f8f": "변경 사항 옵션",
"81cf438219f0a618": "자동 줄 바꿈",
"8ec7e405049af1f7": "초안을 이 줄로 이동",
diff --git a/apps/mobile/src/i18n/translations/pt-BR.json b/apps/mobile/src/i18n/translations/pt-BR.json
index 33793cc553d34..64fea4807f755 100644
--- a/apps/mobile/src/i18n/translations/pt-BR.json
+++ b/apps/mobile/src/i18n/translations/pt-BR.json
@@ -2648,6 +2648,7 @@
"4bc1f12855e979de": "Gerados",
"01656e6237ddc437": "Docs",
"e1d19bd1b90ef329": "{count, plural, one {{count} arquivo visível} other {{count} arquivos visíveis}}",
+ "872bf68b2e05f055": "{count, plural, one {{count} arquivo visto oculto} other {{count} arquivos vistos ocultos}}",
"322f9f6712e4a3a7": "{count, plural, one {{count} visto} other {{count} vistos}}",
"ccd5fc4db08374d7": "{count, plural, one {{count} arquivo de teste oculto} other {{count} arquivos de teste ocultos}}",
"cb1e1e72fc3d2382": "Arquivos de teste incluídos",
@@ -2655,7 +2656,12 @@
"e6fef106eeaa76ce": "Ver diff de {path}, {additions} adições, {deletions} exclusões",
"a52407bfe5da5df2": "Revisar arquivos",
"a7764874320578a8": "Ocultar arquivos de teste",
+ "f538b8016f5ca2f3": "Ocultar arquivos vistos",
"186b7ac75ed4674c": "Filtrar arquivos da revisão",
+ "be348514e8486295": "Nenhum arquivo não visto carregado ainda",
+ "6b7765835778dc77": "Todos os arquivos estão ocultos",
+ "bd2cfcb7be24cd38": "Os arquivos vistos estão ocultos nesta revisão.",
+ "6ae1484aa5bd2bc8": "Mostrar arquivos vistos",
"5f6124336821ef3c": "Nenhum arquivo que não seja de teste carregado ainda",
"6d63711bee3ce542": "Só arquivos de teste foram alterados",
"7cb130d96321fe5a": "Os arquivos de teste estão ocultos nesta revisão.",
@@ -2859,6 +2865,7 @@
"3724ff240986c6da": "Fazer commit das alterações",
"d85877d9ef77c50c": "Alterações",
"ebb089d626dfaa7c": "Carregando alterações",
+ "15db3431c35d4927": "{count, plural, one {{count} visto oculto} other {{count} vistos ocultos}}",
"4050f873dc790f8f": "Opções do diff",
"81cf438219f0a618": "Quebra de linha",
"8ec7e405049af1f7": "Mover rascunho para esta linha",
diff --git a/apps/mobile/src/i18n/translations/ru.json b/apps/mobile/src/i18n/translations/ru.json
index d0e2d9577a9ab..8c1fa80f9925f 100644
--- a/apps/mobile/src/i18n/translations/ru.json
+++ b/apps/mobile/src/i18n/translations/ru.json
@@ -2700,6 +2700,7 @@
"4bc1f12855e979de": "Сгенерированные",
"01656e6237ddc437": "Документация",
"e1d19bd1b90ef329": "{count, plural, one {{count} видимый файл} few {{count} видимых файла} many {{count} видимых файлов} other {{count} видимого файла}}",
+ "872bf68b2e05f055": "{count, plural, one {{count} просмотренный файл скрыт} few {{count} просмотренных файла скрыто} many {{count} просмотренных файлов скрыто} other {{count} просмотренного файла скрыто}}",
"322f9f6712e4a3a7": "{count, plural, one {Просмотрено: {count}} few {Просмотрено: {count}} many {Просмотрено: {count}} other {Просмотрено: {count}}}",
"ccd5fc4db08374d7": "{count, plural, one {{count} тестовый файл скрыт} few {{count} тестовых файла скрыто} many {{count} тестовых файлов скрыто} other {{count} тестового файла скрыто}}",
"cb1e1e72fc3d2382": "Тестовые файлы включены",
@@ -2707,7 +2708,12 @@
"e6fef106eeaa76ce": "Открыть дифф {path}, добавлений: {additions}, удалений: {deletions}",
"a52407bfe5da5df2": "Файлы для ревью",
"a7764874320578a8": "Скрыть тестовые файлы",
+ "f538b8016f5ca2f3": "Скрыть просмотренные файлы",
"186b7ac75ed4674c": "Фильтр файлов для ревью",
+ "be348514e8486295": "Непросмотренные файлы ещё не загружены",
+ "6b7765835778dc77": "Все файлы скрыты",
+ "bd2cfcb7be24cd38": "Просмотренные файлы скрыты из этого ревью.",
+ "6ae1484aa5bd2bc8": "Показать просмотренные файлы",
"5f6124336821ef3c": "Нетестовые файлы ещё не загружены",
"6d63711bee3ce542": "Изменились только тестовые файлы",
"7cb130d96321fe5a": "Тестовые файлы скрыты из этого ревью.",
@@ -2911,6 +2917,7 @@
"3724ff240986c6da": "Закоммитить изменения",
"d85877d9ef77c50c": "Изменения",
"ebb089d626dfaa7c": "Загрузка изменений",
+ "15db3431c35d4927": "{count, plural, one {{count} просмотренный скрыт} few {{count} просмотренных скрыто} many {{count} просмотренных скрыто} other {{count} просмотренного скрыто}}",
"4050f873dc790f8f": "Параметры диффа",
"81cf438219f0a618": "Перенос строк",
"8ec7e405049af1f7": "Перенести черновик на эту строку",
diff --git a/apps/mobile/src/i18n/translations/sv.json b/apps/mobile/src/i18n/translations/sv.json
index 7fd2f945cc033..f26c9aebf3c07 100644
--- a/apps/mobile/src/i18n/translations/sv.json
+++ b/apps/mobile/src/i18n/translations/sv.json
@@ -2652,6 +2652,7 @@
"4bc1f12855e979de": "Genererat",
"01656e6237ddc437": "Dokumentation",
"e1d19bd1b90ef329": "{count, plural, one {{count} synlig fil} other {{count} synliga filer}}",
+ "872bf68b2e05f055": "{count, plural, one {{count} visad fil dold} other {{count} visade filer dolda}}",
"322f9f6712e4a3a7": "{count, plural, one {{count} visad} other {{count} visade}}",
"ccd5fc4db08374d7": "{count, plural, one {{count} testfil dold} other {{count} testfiler dolda}}",
"cb1e1e72fc3d2382": "Testfiler inkluderade",
@@ -2659,7 +2660,12 @@
"e6fef106eeaa76ce": "Visa diff för {path}, {additions} tillägg, {deletions} borttagningar",
"a52407bfe5da5df2": "Granska filer",
"a7764874320578a8": "Dölj testfiler",
+ "f538b8016f5ca2f3": "Dölj visade filer",
"186b7ac75ed4674c": "Filtrera granskningsfiler",
+ "be348514e8486295": "Inga ovisade filer har lästs in än",
+ "6b7765835778dc77": "Alla filer är dolda",
+ "bd2cfcb7be24cd38": "Visade filer är dolda i den här granskningen.",
+ "6ae1484aa5bd2bc8": "Visa visade filer",
"5f6124336821ef3c": "Inga filer utöver testfiler har lästs in än",
"6d63711bee3ce542": "Endast testfiler har ändrats",
"7cb130d96321fe5a": "Testfiler är dolda i den här granskningen.",
@@ -2863,6 +2869,7 @@
"3724ff240986c6da": "Committa ändringar",
"d85877d9ef77c50c": "Ändringar",
"ebb089d626dfaa7c": "Läser in ändringar",
+ "15db3431c35d4927": "{count, plural, one {{count} visad dold} other {{count} visade dolda}}",
"4050f873dc790f8f": "Diff-alternativ",
"81cf438219f0a618": "Radbrytning",
"8ec7e405049af1f7": "Flytta utkastet till den här raden",
diff --git a/apps/mobile/src/i18n/translations/zh.json b/apps/mobile/src/i18n/translations/zh.json
index 54c72efe3b4fb..c8a58af7dd2a5 100644
--- a/apps/mobile/src/i18n/translations/zh.json
+++ b/apps/mobile/src/i18n/translations/zh.json
@@ -2649,6 +2649,7 @@
"4bc1f12855e979de": "生成文件",
"01656e6237ddc437": "文档",
"e1d19bd1b90ef329": "{count, plural, other {{count} 个可见文件}}",
+ "872bf68b2e05f055": "{count, plural, other {已隐藏 {count} 个已查看文件}}",
"322f9f6712e4a3a7": "{count, plural, other {已查看 {count} 个}}",
"ccd5fc4db08374d7": "{count, plural, other {已隐藏 {count} 个测试文件}}",
"cb1e1e72fc3d2382": "包含测试文件",
@@ -2656,7 +2657,12 @@
"e6fef106eeaa76ce": "查看 {path} 的差异,新增 {additions} 行,删除 {deletions} 行",
"a52407bfe5da5df2": "审查文件",
"a7764874320578a8": "隐藏测试文件",
+ "f538b8016f5ca2f3": "隐藏已查看文件",
"186b7ac75ed4674c": "筛选审查文件",
+ "be348514e8486295": "尚未加载未查看的文件",
+ "6b7765835778dc77": "所有文件都已隐藏",
+ "bd2cfcb7be24cd38": "已查看的文件已在此审查中隐藏。",
+ "6ae1484aa5bd2bc8": "显示已查看文件",
"5f6124336821ef3c": "尚未加载非测试文件",
"6d63711bee3ce542": "仅测试文件有更改",
"7cb130d96321fe5a": "测试文件已在此审查中隐藏。",
@@ -2860,6 +2866,7 @@
"3724ff240986c6da": "提交更改",
"d85877d9ef77c50c": "改动",
"ebb089d626dfaa7c": "正在加载更改",
+ "15db3431c35d4927": "{count, plural, other {已隐藏 {count} 个已查看}}",
"4050f873dc790f8f": "差异选项",
"81cf438219f0a618": "自动换行",
"8ec7e405049af1f7": "将草稿移到此行",
diff --git a/apps/mobile/src/persistence/mobile-preferences.ts b/apps/mobile/src/persistence/mobile-preferences.ts
index 71d095b0b4fb5..faca7b1c707a9 100644
--- a/apps/mobile/src/persistence/mobile-preferences.ts
+++ b/apps/mobile/src/persistence/mobile-preferences.ts
@@ -139,6 +139,7 @@ export interface Preferences {
/** Whether pull requests or issues last held the tab bar slot they share. */
readonly sharedSlotTab?: "pullRequests" | "issues";
readonly pullRequestHideTestFiles?: boolean;
+ readonly pullRequestHideViewedFiles?: boolean;
/** Which hidden-by-default PR activity is shown: bot comments and resolved or dismissed ones. */
readonly pullRequestActivityVisibility?: PullRequestActivityVisibility;
readonly pullRequestMergeMethod?: PullRequestMergeMethod;
@@ -233,6 +234,7 @@ function sanitizePreferences(parsed: Preferences): Preferences {
hiddenNavigationTabs?: readonly string[];
sharedSlotTab?: "pullRequests" | "issues";
pullRequestHideTestFiles?: boolean;
+ pullRequestHideViewedFiles?: boolean;
pullRequestActivityVisibility?: PullRequestActivityVisibility;
pullRequestMergeMethod?: PullRequestMergeMethod;
liveActivitiesEnabled?: boolean;
@@ -292,6 +294,10 @@ function sanitizePreferences(parsed: Preferences): Preferences {
preferences.pullRequestHideTestFiles = parsed.pullRequestHideTestFiles;
}
+ if (typeof parsed.pullRequestHideViewedFiles === "boolean") {
+ preferences.pullRequestHideViewedFiles = parsed.pullRequestHideViewedFiles;
+ }
+
if (isPullRequestActivityVisibility(parsed.pullRequestActivityVisibility)) {
preferences.pullRequestActivityVisibility = parsed.pullRequestActivityVisibility;
}