Skip to content

Add daily-sites extension - #18763

Merged
raycastbot merged 14 commits into
raycast:mainfrom
dubsdotla:ext/daily-sites
May 9, 2025
Merged

raycastbot merged 14 commits into
raycast:mainfrom
dubsdotla:ext/daily-sites

Conversation

@dubsdotla

@dubsdotla dubsdotla commented Apr 24, 2025 •

Copy link
Copy Markdown
Contributor

Daily Sites - Site Launcher

Description

Daily Sites lets you collect frequently used websites, filter them by name, URL, and category, and easily open them in your default web browser.

launcher

Setup

The first time you open the extension you will be asked to choose an XML folder, this defaults to your Documents folder. This folder is used by the “Export Sites” and “Import Sites” commands. It’s where exported XML files are saved and the default import directory.

Features

Site Launcher

  • Browse your full collection of saved sites
  • Filter by name, URL or category
  • Open any site in your default web browser
  • Manage Sites entry provides:
    • Add Site
    • Import Sites
    • Export Sites
    • Delete All Sites

Add Site

  • Add a new website to your collection
  • Require only a name and URL (category optional)

Export Sites

  • Export your entire collection to an XML file
  • Use for backups or manual editing outside Raycast

Import Sites

  • Import sites from a previously exported XML file
  • Automatically merge only new entries (skips duplicates)

Usage

As the name implies, Daily Sites was created to make it easier for you to access websites that you view on a daily basis. A prime example of this is technology news sites which may be updated multiple times a day.

We can create a series of sites with the category “News” and then every time you want to browse your tech news sites, you can either type “news” or select the “News” category from the Category dropdown menu.

daily-sites-4
daily-sites-5
daily-sites-2

Author

Developed by Derek William Scott (@dubsdotla on GitHub).

License

Distributed under the MIT License.

Screencast

Kapture.2025-04-28.at.18.15.08.mp4

Checklist

- Fixed issue with addsite.tsx where the form validation errors were always visible for a new site. Now they only only appear if the Name and/or URL textfields are blank when clicking Add.
- Initial Commit
@raycastbot

ghost commented Apr 24, 2025

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

You can expect an initial review within five business days.

Once the PR is approved and merged, the extension will be available on our Store.

@raycastbot raycastbot added the new extension Label for PRs with new extensions label Apr 24, 2025
- Fixed code style issues
- Fixed errors that arose when running "npx ray build -e dist" that were due to unnecessary imports and incorrect syntax
@dubsdotla
dubsdotla marked this pull request as ready for review April 24, 2025 20:04

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

This PR adds a new Daily Sites extension for managing and quickly accessing frequently visited websites, featuring site management, categorization, and import/export capabilities.

  • README.md needs more detailed documentation about features, usage instructions, and examples to help users understand the extension's capabilities
  • Extension requires a metadata folder with screenshots since it includes view commands in package.json
  • Consider adding URL validation in addsite.tsx to ensure proper URL format before saving
  • Consider using showFailureToast from @raycast/utils in try-catch blocks instead of manual showToast calls for error handling
  • XML parsing in utils.ts could benefit from more robust error handling and input validation to prevent potential security issues

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

13 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile

{
"name": "dailysites",
"title": "Daily Sites",
"subtitle": "Daily Sites",

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: The subtitle 'Daily Sites' is redundant with the title. Consider using a more descriptive subtitle that differentiates the command

Comment thread extensions/daily-sites/src/addsite.tsx Outdated
Comment on lines +57 to +64
// persist
const existing = await loadSites();
const updated = initialValues
? existing.map((s) => (s.url === initialValues.url ? newSite : s))
: [...existing, newSite];

await saveSites(updated);
await showToast(Toast.Style.Success, initialValues ? "Site updated" : "Site added");

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logic: loadSites and saveSites operations should be wrapped in try-catch to handle potential storage errors

Suggested change
// persist
const existing = await loadSites();
const updated = initialValues
? existing.map((s) => (s.url === initialValues.url ? newSite : s))
: [...existing, newSite];
await saveSites(updated);
await showToast(Toast.Style.Success, initialValues ? "Site updated" : "Site added");
// persist
try {
const existing = await loadSites();
const updated = initialValues
? existing.map((s) => (s.url === initialValues.url ? newSite : s))
: [...existing, newSite];
await saveSites(updated);
await showToast(Toast.Style.Success, initialValues ? "Site updated" : "Site added");
onDone();
} catch (error) {
showFailureToast(error, { title: "Failed to save site" });
}

Comment thread extensions/daily-sites/src/addsite.tsx Outdated
Comment on lines +24 to +32
// load existing categories
useEffect(() => {
(async () => {
const all = await loadSites();
const baseCategories = getCategories(all);
const merged = Array.from(new Set([initialCat, "custom", ...baseCategories]));
setCategories(merged);
})();
}, [initialCat]);

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logic: useEffect has no error handling for loadSites failure

Suggested change
// load existing categories
useEffect(() => {
(async () => {
const all = await loadSites();
const baseCategories = getCategories(all);
const merged = Array.from(new Set([initialCat, "custom", ...baseCategories]));
setCategories(merged);
})();
}, [initialCat]);
// load existing categories
useEffect(() => {
(async () => {
try {
const all = await loadSites();
const baseCategories = getCategories(all);
const merged = Array.from(new Set([initialCat, "custom", ...baseCategories]));
setCategories(merged);
} catch (error) {
showFailureToast(error, { title: "Failed to load categories" });
}
})();
}, [initialCat]);

Comment on lines +29 to +33
async function refresh() {
const loaded = await loadSites();
setSites(loaded);
setCategories(getCategories(loaded));
}

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: refresh() should be wrapped in try/catch to handle potential loadSites errors

Suggested change
async function refresh() {
const loaded = await loadSites();
setSites(loaded);
setCategories(getCategories(loaded));
}
async function refresh() {
try {
const loaded = await loadSites();
setSites(loaded);
setCategories(getCategories(loaded));
} catch (error) {
console.error('Error loading sites:', error);
await showToast(Toast.Style.Failure, 'Failed to load sites');
}
}

Comment on lines +124 to +137
return (
<List
searchBarPlaceholder="Filter by name, URL or category…"
searchBarAccessory={
<List.Dropdown tooltip="Filter by category" value={filterCategory} onChange={setFilterCategory}>
<List.Dropdown.Item title="All Categories" value="" />
{categories
.filter((cat) => cat !== "uncategorized")
.map((cat) => (
<List.Dropdown.Item key={cat} title={cat} value={cat} />
))}
</List.Dropdown>
}
>

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: List should use isLoading prop while sites are being loaded to avoid empty state flicker

Suggested change
return (
<List
searchBarPlaceholder="Filter by name, URL or category…"
searchBarAccessory={
<List.Dropdown tooltip="Filter by category" value={filterCategory} onChange={setFilterCategory}>
<List.Dropdown.Item title="All Categories" value="" />
{categories
.filter((cat) => cat !== "uncategorized")
.map((cat) => (
<List.Dropdown.Item key={cat} title={cat} value={cat} />
))}
</List.Dropdown>
}
>
return (
<List
isLoading={sites.length === 0}
searchBarPlaceholder="Filter by name, URL or category…"
searchBarAccessory={
<List.Dropdown tooltip="Filter by category" value={filterCategory} onChange={setFilterCategory}>
<List.Dropdown.Item title="All Categories" value="" />
{categories
.filter((cat) => cat !== "uncategorized")
.map((cat) => (
<List.Dropdown.Item key={cat} title={cat} value={cat} />
))}
</List.Dropdown>
}
>

Comment on lines +61 to +62
console.error("handleDelete error:", error);
await showToast(Toast.Style.Failure, "Error deleting site");

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Replace with showFailureToast from @raycast/utils for consistent error handling

Suggested change
console.error("handleDelete error:", error);
await showToast(Toast.Style.Failure, "Error deleting site");
console.error("handleDelete error:", error);
showFailureToast(error, { title: "Error deleting site" });

Comment on lines +26 to +29
} catch (e) {
console.error(e);
await showToast(Toast.Style.Failure, "Import failed");
}

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Use showFailureToast from @raycast/utils instead of manual error handling. Example: showFailureToast(error, { title: "Could not import sites" })

Suggested change
} catch (e) {
console.error(e);
await showToast(Toast.Style.Failure, "Import failed");
}
} catch (error) {
console.error(error);
await showFailureToast(error, { title: "Could not import sites" });
}

Comment on lines +21 to +24
} catch (e) {
console.error(e);
await showToast(Toast.Style.Failure, "Export failed");
}

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Use showFailureToast from @raycast/utils instead of manual error handling. Example: showFailureToast(error, { title: 'Could not export sites' })

Suggested change
} catch (e) {
console.error(e);
await showToast(Toast.Style.Failure, "Export failed");
}
} catch (error) {
console.error(error);
await showFailureToast(error, { title: "Could not export sites" });
}

Comment thread extensions/daily-sites/src/utils.ts Outdated

if (!raw || !raw.trim().startsWith("<?xml")) {
const empty = `<?xml version="1.0"?><sites></sites>`;
await LocalStorage.setItem(STORAGE_KEY, empty).catch(() => {});

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logic: Empty catch block silently ignores storage errors. Use showFailureToast from @raycast/utils instead.

Suggested change
await LocalStorage.setItem(STORAGE_KEY, empty).catch(() => {});
await LocalStorage.setItem(STORAGE_KEY, empty).catch((error) => showFailureToast(error, { title: "Failed to initialize sites storage" }));

Comment thread extensions/daily-sites/src/utils.ts Outdated
export async function saveSites(sites: Site[]): Promise<void> {
const sorted = sortSites(sites);
const xml = sitesToXml(sorted);
await LocalStorage.setItem(STORAGE_KEY, xml);

ghost Apr 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logic: Missing error handling for LocalStorage.setItem. Should wrap in try-catch with showFailureToast.

Suggested change
await LocalStorage.setItem(STORAGE_KEY, xml);
try {
await LocalStorage.setItem(STORAGE_KEY, xml);
} catch (error) {
showFailureToast(error, { title: "Failed to save sites" });
}

Derek Scott added 2 commits April 26, 2025 00:26
- Adding media directory and adding new images to metadata
- Made changes suggested by greptile-apps bot so my PR can be approved. :)
… issue with Site Manager where the isLoading state would continue to be true even when there were no sites to be loaded.
@pernielsentikaer

ghost commented Apr 30, 2025

Copy link
Copy Markdown
Contributor

There are still some CI errors you need to look into, do you need help?

I'm waiting until checks complete to review it 🙂

@pernielsentikaer pernielsentikaer self-assigned this Apr 30, 2025
… in my package.json which caused a ci error, so I changed the version number back and properly ran npm install @raycast/api@latest

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

The PR has been updated with significant improvements to documentation, error handling, and core functionality for the Daily Sites extension.

  • Added comprehensive setup and usage documentation in README.md with clear examples and screenshots
  • Implemented showFailureToast from @raycast/utils across all error handling in exportsites.tsx, importsites.tsx, and utils.ts
  • Added URL validation in addsite.tsx to ensure valid http/https URLs and defaulting new URLs to 'https://'
  • Improved XML handling with proper escaping and error handling in utils.ts
  • All view commands now use consistent "Daily Sites" subtitle in package.json for better organization

Note: The PR now addresses all major points from the previous review and implements proper error handling and validation throughout the codebase.

7 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

Comment thread extensions/daily-sites/package.json Outdated
"type": "directory",
"name": "xmlFolder",
"title": "XML Folder",
"description": "Where your exported sites XML file will live",

ghost Apr 30, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: The description should end with a period for consistency with other descriptions

Suggested change
"description": "Where your exported sites XML file will live",
"description": "Where your exported sites XML file will live.",

Comment thread extensions/daily-sites/README.md Outdated

Daily Sites lets you collect frequently used websites, filter them by name, URL, and category, and easily open them in your default web browser.

![launcher.png](media/launcher.png)

ghost Apr 30, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Image path 'media/launcher.png' should be relative to the metadata folder for store submission

Suggested change
![launcher.png](media/launcher.png)
![launcher.png](metadata/launcher.png)

Comment thread extensions/daily-sites/README.md Outdated

The first time you open the extension you will be asked to choose an XML folder, this defaults to your Documents folder. This folder is used by the “Export Sites” and “Import Sites” commands. It’s where exported XML files are saved and the default import directory.

![setup](media/setup.png)

ghost Apr 30, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Image path 'media/setup.png' should be relative to the metadata folder for store submission

Suggested change
![setup](media/setup.png)
![setup](metadata/setup.png)

Comment on lines +18 to +19
const out = path.join(values.folder[0], `${values.filename || "sites"}.xml`);
fs.writeFileSync(out, xml, "utf8");

ghost Apr 30, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Use fs.promises.writeFile instead of synchronous writeFileSync to avoid blocking the main thread

Comment on lines +65 to +67
const updated = initialValues
? existing.map((s) => (s.url === initialValues.url ? newSite : s))
: [...existing, newSite];

ghost Apr 30, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Consider adding duplicate URL check when updating to prevent accidental duplicates

Suggested change
const updated = initialValues
? existing.map((s) => (s.url === initialValues.url ? newSite : s))
: [...existing, newSite];
const isDuplicate = !initialValues && existing.some(s => s.url === newSite.url);
if (isDuplicate) {
showToast(Toast.Style.Failure, "A site with this URL already exists");
return;
}
const updated = initialValues
? existing.map((s) => (s.url === initialValues.url ? newSite : s))
: [...existing, newSite];


async function handleSubmit(values: { file: string[] }) {
try {
const xmlPath = values.file[0]; /* or `${xmlFolder}/yourfile.xml` */

ghost Apr 30, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Remove commented code suggestion since it's not being used

Suggested change
const xmlPath = values.file[0]; /* or `${xmlFolder}/yourfile.xml` */
const xmlPath = values.file[0];

Comment on lines +46 to +51
useEffect(() => {
setTimeout(() => {
refresh();
setIsLoading(false);
}, 1500);
}, []);

ghost Apr 30, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Consider removing artificial delay of 1500ms - it may make the app feel slow without providing value

@dubsdotla

ghost commented Apr 30, 2025

Copy link
Copy Markdown
Contributor Author

There are still some CI errors you need to look into, do you need help?

I'm waiting until checks complete to review it 🙂

I appreciate the heads-up! The CI errors should now be resolved, thank you!

…loading indicator won\'t fire if there are no sites to be loaded like on the initial launch.

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

The PR has been further refined with improvements to the Daily Sites extension's file handling and error management.

  • Implemented non-blocking file operations using fs.promises.writeFile in exportsites.tsx for better performance
  • Added proper file path handling using path.join() in exportsites.tsx for cross-platform compatibility
  • Improved error handling in importsites.tsx with better error messages and validation for XML imports
  • Added default directory handling in exportsites.tsx using user preferences

Note: The changes show continued improvement in code quality and robustness, particularly around file system operations.

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +32 to +38
useEffect(() => {
(async () => {
const all = await loadSites();
const baseCats = getCategories(all);
setCategories(Array.from(new Set([initialCat, "custom", ...baseCats])));
})();
}, [initialCat]);

ghost Apr 30, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: useEffect has no cleanup function to cancel the async operation if the component unmounts during the load

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

The PR has been updated with improvements to form handling and state management in the Daily Sites extension.

  • Added cleanup for async operations in addsite.tsx using isActive flag to prevent state updates after unmount
  • Improved form validation in addsite.tsx with separate error states for name and URL fields
  • Implemented proper state management for custom categories with useState and conditional rendering
  • Added proper type definitions for form props and values in addsite.tsx

Note: The changes demonstrate better React practices and form handling, particularly around component lifecycle and validation.

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +140 to +142
value={customCategory}
onChange={setCustomCategory}
/>

ghost Apr 30, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Consider trimming whitespace from customCategory as it's entered rather than only on submit

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Recent changes focus on improving the Daily Sites extension's error handling and storage operations.

  • Implemented proper error handling for LocalStorage operations in utils.ts using showFailureToast
  • Added XML validation in utils.ts to ensure proper format before parsing with startsWith("<?xml")
  • Improved error recovery in loadSites() by resetting to empty XML state on parse failures
  • Added sorting functionality in utils.ts to maintain consistent site ordering

Note: These changes enhance the robustness of data handling and storage operations, particularly around error cases and data consistency.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@dubsdotla

ghost commented May 2, 2025

Copy link
Copy Markdown
Contributor Author

There are still some CI errors you need to look into, do you need help?
I'm waiting until checks complete to review it 🙂

I appreciate the heads-up! The CI errors should now be resolved, thank you!

@pernielsentikaer I had some other style related changes recommended by the bot after fixing the CI errors, but everything should be ready to go now! 🙌

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi 👋

Thanks for your contribution 💪

I have now tested your extension, and I have some feedback ready for you:

  • You should popToRoot after adding a new site (or add a preference to let the user switch between popToRoot and going back to root

I'm looking forward to testing this extension again 🔥

Request a new review when you are ready. Feel free to contact me here or at Slack if you have any questions.

…add. If you choose yes, the fields reset to default values. If you choose no, popToRoot is called if you launched Add Site directly, otherwise it returns to Site Launcher. Import Site now calls popToRoot after a successful import if you launched Import Sites directly, otherwise it returns to Site Launcher. Export Site now calls popToRoot after a successful export if you launched Export Sites directly, otherwise it returns to Site Launcher.

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

The PR has been updated with improved navigation handling in the Daily Sites extension, particularly around form submission flows.

  • Added popToRoot() after site addition in addsite.tsx to ensure consistent navigation behavior
  • Implemented "Add Another" confirmation dialog in addsite.tsx to improve user workflow
  • Added form reset functionality when adding multiple sites consecutively
  • Standardized navigation behavior across all commands using popToRoot()

Note: These changes provide a more consistent and user-friendly navigation experience throughout the extension.

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment thread extensions/daily-sites/src/addsite.tsx Outdated
Comment on lines +93 to +99
// Ask user if they want to add another
const again = await confirmAlert({
title: "Add another site?",
message: "Would you like to add one more site?",
primaryAction: { title: "Yes" },
dismissAction: { title: "No" },
});

ghost May 3, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Consider moving confirmAlert call before saveSites to prevent showing success toast if user cancels

…t call before saveSites to prevent showing success toast if user cancels

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Recent changes to the Daily Sites extension introduce potential issues with the site saving workflow in addsite.tsx.

  • The saveSites operation in addsite.tsx should occur before showing the "Add another site?" dialog to prevent data loss if save fails
  • Consider adding error handling around the confirmAlert call in addsite.tsx to handle potential failures
  • The form reset logic in addsite.tsx should be moved into a separate function to improve code organization

Note: These changes focus on improving the reliability and error handling of the site addition workflow.

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment thread extensions/daily-sites/src/addsite.tsx Outdated
Comment on lines +90 to +96
// Ask user if they want to add another
const again = await confirmAlert({
title: "Add another site?",
message: "Would you like to add one more site?",
primaryAction: { title: "Yes" },
dismissAction: { title: "No" },
});

ghost May 3, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logic: confirmAlert should only be shown when not in edit mode (initialValues is undefined), as it doesn't make sense to ask about adding another when editing

Suggested change
// Ask user if they want to add another
const again = await confirmAlert({
title: "Add another site?",
message: "Would you like to add one more site?",
primaryAction: { title: "Yes" },
dismissAction: { title: "No" },
});
// Ask user if they want to add another (only in add mode)
const again = !initialValues && await confirmAlert({
title: "Add another site?",
message: "Would you like to add one more site?",
primaryAction: { title: "Yes" },
dismissAction: { title: "No" },
});

… edit mode (initialValues is undefined), as it doesn\'t make sense to ask about adding another when editing

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Recent changes to the Daily Sites extension improve the site saving workflow and error handling in addsite.tsx.

  • Reordered operations in addsite.tsx to save sites before showing the "Add another" dialog
  • Added proper error handling around confirmAlert using try-catch in addsite.tsx
  • Improved form state management with proper cleanup and error handling in addsite.tsx

Note: These changes enhance the reliability of the site addition workflow and maintain data consistency.

1 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Comment thread extensions/daily-sites/src/addsite.tsx Outdated
Comment on lines +100 to +101
await saveSites(updated);
await showToast(Toast.Style.Success, initialValues ? "Site updated" : "Site added");

ghost May 3, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Consider moving showToast after the 'again' check to avoid showing success when user might continue adding more

Comment on lines +179 to +182
onDone={async () => {
// runs when Add Site is invoked directly
await popToRoot();
}}

ghost May 3, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logic: popToRoot should be wrapped in try-catch to handle potential navigation errors

…oid showing success when user might continue adding more. Fixed logic issue by wrapping popToRoot in try-catch to handle potential navigation errors.

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Recent changes improve error handling and navigation in the Daily Sites extension's core commands.

  • Added proper error handling for popToRoot navigation in all command wrappers (addsite.tsx, importsites.tsx, exportsites.tsx)
  • Improved error feedback using showFailureToast consistently across import/export operations
  • Implemented non-blocking file write operations in exportsites.tsx for better performance

Note: These changes enhance the robustness of navigation and file operations throughout the extension.

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +48 to +49
defaultValue="dailysites"
placeholder="dailysites"

ghost May 3, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: defaultValue and placeholder are identical - consider removing placeholder since it's redundant

…e identical, removed placeholder since it was redundant.

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Recent changes focus on minor improvements to the export functionality in the Daily Sites extension.

  • Removed redundant placeholder in exportsites.tsx filename field since it matched the defaultValue
  • Improved file path handling in exportsites.tsx by using proper path joining for cross-platform compatibility

Note: These changes represent minor refinements to the export functionality, with no significant changes to core behavior.

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@dubsdotla

ghost commented May 3, 2025

Copy link
Copy Markdown
Contributor Author

Hi 👋

Thanks for your contribution 💪

I have now tested your extension, and I have some feedback ready for you:

* You should popToRoot after adding a new site (or add a preference to let the user switch between popToRoot and going back to root

I'm looking forward to testing this extension again 🔥

Request a new review when you are ready. Feel free to contact me here or at Slack if you have any questions.

@pernielsentikaer

When Add Site is opened directly and you add a new site it now asks if you want to add another site, if yes it replaces fields/popup with default values, if no it does a popToRoot.

When the Add Site action is invoked from Site Launcher and you choose no after adding a site, it returns to Site Launcher.

For consistency sake I updated the functionality of Import Sites and Export Sites to behave in the same manner.

Definitely feels a little bit more polished now, pretty happy with these changes! 😀

@dubsdotla
dubsdotla requested a review from pernielsentikaer May 3, 2025 15:14
@dubsdotla

ghost commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

Hi 👋
Thanks for your contribution 💪
I have now tested your extension, and I have some feedback ready for you:

* You should popToRoot after adding a new site (or add a preference to let the user switch between popToRoot and going back to root

I'm looking forward to testing this extension again 🔥
Request a new review when you are ready. Feel free to contact me here or at Slack if you have any questions.

@pernielsentikaer

When Add Site is opened directly and you add a new site it now asks if you want to add another site, if yes it replaces fields/popup with default values, if no it does a popToRoot.

When the Add Site action is invoked from Site Launcher and you choose no after adding a site, it returns to Site Launcher.

For consistency sake I updated the functionality of Import Sites and Export Sites to behave in the same manner.

Definitely feels a little bit more polished now, pretty happy with these changes! 😀

@pernielsentikaer Realizing that I didn't mention that I had requested a new review, figured I would leave a comment here just in case, thank you!

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi 👋

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit bfb8c95 into raycast:main May 9, 2025
@github-actions

ghost commented May 9, 2025

Copy link
Copy Markdown
Contributor

@raycastbot

ghost commented May 9, 2025

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@dubsdotla
dubsdotla deleted the ext/daily-sites branch May 11, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new extension Label for PRs with new extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants