def action_bookmark_this(self) -> None:
        """Add a bookmark for the currently-viewed file."""

        location = self.query_one(Viewer).location

        # Only allow bookmarking if we're actually viewing something that
        # can be bookmarked.
        if not isinstance(location, (Path, URL)):
            self.app.push_screen(
                ErrorDialog(
                    "Not a bookmarkable location",
                    "The current view can't be bookmarked.",
                )
            )
            return

        # To make a bookmark, we need a title and a location. We've got a
        # location; let's make the filename the default title.
        title = (location if isinstance(location, Path) else Path(location.path)).name

        # Give the user a chance to edit the title.
        self.app.push_screen(
            InputDialog("Bookmark title:", title),
            partial(self.add_bookmark, location),
        )
Add a bookmark for the currently-viewed file.
frogmouth/screens/main.py