Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f6bfdc2
feat: onboarding flow ready
nikitalokhmachev-ai May 29, 2025
9c0a7fb
fix: trailing arrow icon
nikitalokhmachev-ai May 29, 2025
c744a30
fix: no arrow next to get started
nikitalokhmachev-ai May 29, 2025
9bfc699
Merge remote-tracking branch 'origin/nikita-settings-page' into nikit…
nikitalokhmachev-ai May 30, 2025
565b703
fix: blocked status + another debugger is already attached
nikitalokhmachev-ai May 30, 2025
edb090e
feat: domains skip update
nikitalokhmachev-ai May 30, 2025
1436cc4
feat: onboarding flow ready
nikitalokhmachev-ai May 29, 2025
25e642c
fix: trailing arrow icon
nikitalokhmachev-ai May 29, 2025
4066bf6
fix: no arrow next to get started
nikitalokhmachev-ai May 29, 2025
ec4435f
fix: blocked status + another debugger is already attached
nikitalokhmachev-ai May 30, 2025
9925447
feat: domains skip update
nikitalokhmachev-ai May 30, 2025
41914b6
Merge branch 'nikita-onboarding-flow' of https://github.com/Monadical…
nikitalokhmachev-ai May 30, 2025
04dc373
Merge branch 'main' into nikita-onboarding-flow
Shrinks99 May 30, 2025
84fc07a
Use different forest image
Shrinks99 May 30, 2025
9a092b2
Remove custom orange button style
Shrinks99 May 30, 2025
ab73cf4
Change logo to SVG
Shrinks99 May 30, 2025
cc2392e
Fix accessibility for svg logo
Shrinks99 May 30, 2025
f6d1cec
Card CSS refactor
Shrinks99 Jun 3, 2025
8adab1c
Improve transition
Shrinks99 Jun 3, 2025
5f6cb61
update downloading image
Shrinks99 Jun 3, 2025
73b63ef
Add alt text for onboarding images
Shrinks99 Jun 3, 2025
4540376
Add "sharing warning" and "sharing" collages
Shrinks99 Jun 4, 2025
ea14f48
Semantic markup improvements
Shrinks99 Jun 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/argo-archive-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "@material/web/list/list-item.js";
import "@material/web/checkbox/checkbox.js";
import "@material/web/icon/icon.js";
import "@material/web/labs/card/elevated-card.js";
// @ts-expect-error
import filingDrawer from "assets/images/filing-drawer.avif";

import { getLocalOption } from "./localstorage";
Expand Down
1 change: 0 additions & 1 deletion src/argo-shared-archive-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import "@material/web/icon/icon.js";
import "@material/web/labs/card/elevated-card.js";
import "@material/web/button/filled-button.js";
import "@material/web/button/outlined-button.js";
// @ts-expect-error
import filingDrawer from "assets/images/filing-drawer.avif";

import { getLocalOption, setSharedArchives } from "./localstorage";
Expand Down
1 change: 1 addition & 0 deletions src/assets/brand/packrat-lockup-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/downloading.avif
Binary file not shown.
Binary file added src/assets/images/forest.avif
Binary file not shown.
Binary file added src/assets/images/sharing-warning.avif
Binary file not shown.
Binary file added src/assets/images/sharing.avif
Binary file not shown.
56 changes: 55 additions & 1 deletion src/ext/bg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ function sidepanelHandler(port) {
// @ts-expect-error - TS2339 - Property 'port' does not exist on type 'BrowserRecorder'.
self.recorders[tabId].port = port;
self.recorders[tabId].doUpdateStatus();
} else if (isRecordingEnabled) {
// Send the current recording state even if no recorder exists for this tab
port.postMessage({
type: "status",
recording: false, // No recorder for this tab
autorun,
// @ts-expect-error
collId: defaultCollId,
});
}
port.postMessage(await listAllMsg(collLoader));
break;
Expand Down Expand Up @@ -353,8 +362,18 @@ chrome.tabs.onUpdated.addListener((tabId, changeInfo) => {

if (changeInfo.url && !isValidUrl(changeInfo.url, skipDomains)) {
stopRecorder(tabId);

// Ensure debugger is detached when navigating to a skipped domain
try {
chrome.debugger.detach({ tabId }, () => {
// Debugger detached, ignore any errors as it might already be detached
});
} catch (e) {
// Ignore errors - debugger might already be detached
}

delete self.recorders[tabId];
// let the side-panel know the canRecord/UI state changed
// let the side-panel know the 'canRecord'/UI state changed
// @ts-expect-error
if (sidepanelPort) {
sidepanelPort.postMessage({ type: "update" });
Expand Down Expand Up @@ -440,6 +459,9 @@ async function startRecorder(tabId, opts) {
let err = null;
// @ts-expect-error - TS7034 - Variable 'sidepanelPort' implicitly has type 'any' in some locations where its type cannot be determined.
if (sidepanelPort) {
// Set the port on the recorder so it can send status updates
// @ts-expect-error
self.recorders[tabId].port = sidepanelPort;
sidepanelPort.postMessage({ type: "update" });
}
const { waitForTabUpdate } = opts;
Expand All @@ -449,9 +471,28 @@ async function startRecorder(tabId, opts) {
try {
self.recorders[tabId].setCollId(opts.collId);
await self.recorders[tabId].attach();

// Send status update after successful attach
// @ts-expect-error
if (sidepanelPort && self.recorders[tabId]) {
self.recorders[tabId].doUpdateStatus();
}
} catch (e) {
console.warn(e);
err = e;

// Clean up on error
// @ts-expect-error
if (err?.message?.includes("already attached")) {
// Try to detach and delete the recorder
try {
chrome.debugger.detach({ tabId }, () => {
delete self.recorders[tabId];
});
} catch (detachErr) {
console.warn("Failed to detach debugger:", detachErr);
}
}
Comment on lines +485 to +495

Choose a reason for hiding this comment

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

Suggestion: The error handling only cleans up when the error message includes "already attached", but other errors should also trigger cleanup to prevent resource leaks. The recorder should be deleted for any error during attachment. [possible issue, importance: 8]

Suggested change
// @ts-expect-error
if (err?.message?.includes("already attached")) {
// Try to detach and delete the recorder
try {
chrome.debugger.detach({ tabId }, () => {
delete self.recorders[tabId];
});
} catch (detachErr) {
console.warn("Failed to detach debugger:", detachErr);
}
}
// Clean up on error
try {
if (err?.message?.includes("already attached")) {
// Try to detach the debugger first for "already attached" errors
chrome.debugger.detach({ tabId }, () => {
console.log("Detached debugger after 'already attached' error");
});
}
// Delete the recorder for any error
delete self.recorders[tabId];
} catch (detachErr) {
console.warn("Failed to detach debugger:", detachErr);
}

}
return err;
}
Expand All @@ -462,6 +503,19 @@ async function startRecorder(tabId, opts) {
function stopRecorder(tabId) {
if (self.recorders[tabId]) {
self.recorders[tabId].detach();

// Ensure the sidepanel is notified about the stop
// @ts-expect-error - TS7034 - Variable 'sidepanelPort' implicitly has type 'any' in some locations where its type cannot be determined.
if (sidepanelPort) {
sidepanelPort.postMessage({
type: "status",
recording: false,
autorun,
// @ts-expect-error - defaultCollId implicitly has an 'any' type.
collId: defaultCollId,
});
}

return true;
}

Expand Down
3 changes: 3 additions & 0 deletions src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
declare module "*.svg";
declare module "*.png";
declare module "*.avif"
declare module "*.jpg";
declare module "*.html";
declare module "*.scss";
declare module "*.sass";
Expand Down
Loading
Loading