Coder Social home page Coder Social logo

signal-k / client Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 4.0 729.65 MB

Frontend for viewing citizen science proposals on Lens Protocol

Home Page: https://starsailors.space

JavaScript 1.40% TypeScript 92.13% CSS 2.98% PLpgSQL 2.53% Sass 0.01% SCSS 0.95%
citizen-science foldingathome lens-protocol zooniverse

client's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

client's Issues

πŸŽˆβ™»οΈ ↝ Thirdweb SDK -> "Switch network" function in thirdweb-button loop error

image

(Demo screen clip taken during proposal creation).

Currently, if the user's connected and on the Polygon -> Mumbai network, their profile picture shows. However, all Lens interactions require the user to be on Polygon -> Mainnet (at least for now, in the future we'll build on top of the Lens Mumbai network as well). I've taken a look through the constants scripts and can't find anything (this could be related to the Supabase issue where the [...thirdweb].js supabase interaction wasn't working because it was forcefully connecting to the Rinkeby network: Signal-K/sytizen#16).

πŸ₯ΆπŸ‘œ ↝ Posts with large meta/tags overlap other components

Examples:
image
image
image
image

Firstly, comments shouldn't show up on the post feed -> they should show up below posts.

This is a rendering issue where the individual lines in the codesnippet are quite long and stretch out further than the width of the screen (let alone the container they're supposed to be contained in). Likely will need to edit components/PostFeed.tsx

Another issue that has come up here is that now the sidebar isn't able to be interacted with on my profile page, which houses the large comment. At first I thought this could be the result of some dependency mixups (I'm adding some new features, see commit below) but the sidebar works fine on the index page and on other profiles without this overlap error. So let's try and figure out a way to filter out/minimise large posts

Related to #8 #9

πŸ•ΈοΈπŸ‰ ↝ First set of posts cut off by header

Image:
image

Page:
Index (starprotocol.vercel.app)

Problem:
At least half of the first post in the feed is cut off, possibly more are hidden

Likely cause:
Feed items hidden behind heading

Notes:
Feed is still very much a WIP, as when released it will show posts from users that are being followed by the logged-in user
(maybe we could have two modes, where it shows all posts (from all appIds) in a user's feed, and then only posts/publications that are proposals).

πŸŒ¬οΈπŸ” ↝ Different methods of `[isMobile]`

See in pages/planets/[id].tsx:

 const [isMobile, setIsMobile] = useState(false);

    useEffect(() => {
        if (typeof window !== "undefined") {
        const checkIsMobile = () => {
            setIsMobile(window.innerWidth <= 768);
        };
        checkIsMobile();
        window.addEventListener("resize", checkIsMobile);
        return () => {
            window.removeEventListener("resize", checkIsMobile);
        };
        }
    }, []);

    if (!id) {
        return null;
    };

    if (isMobile) {
        return (
            <LayoutNoNav>
                <IndividualBasePlanet id={id as string} />
            </LayoutNoNav>
        );
    };

While in the main <Layout> component in components/Section/Layout.tsx:

const Layout: React.FC<DashboardLayoutProps> = ({ children }) => {
  const [isMobile, setIsMobile] = useState(false);

  useEffect(() => {     // Check if window is defined before accessing it
    if (typeof window !== "undefined") {
      const checkIsMobile = () => {
        setIsMobile(window.innerWidth <= 768);
      };
      checkIsMobile();
      window.addEventListener("resize", checkIsMobile);
      return () => {
        window.removeEventListener("resize", checkIsMobile);
      };
    }
  }, []);

  return (
    <>
        <main className="h-max pb-10 grow pt-6">
          <Navbar />
          <div className="py-12">
            {children}
          </div>
        </main>
      {isMobile && (
        <div className="md:hidden overflow-y-auto h-screen p-4">
          <main className="h-max pb-10 grow">{children}</main>
          <Bottombar />
        </div>
      )}
    </>
  );
};

export default Layout;

This could cause problems, I just noticed this when I was creating the route for individual sectors. We need to define a coherent syntax for mobile configuration before this new repo gets messy.

<awaiting jira/plane linked issue tag>

πŸ¦€πŸ›Ό ↝ Thirdweb-dev/sdk module missing

cf8288e

Used in the sidebar

Currently creating a new test next template to see if this issue persists. If it does, it's something to do with the version/package management (likely) and I'll ignore it before merging it back in with wb3-10. Will keep this issue updated.

πŸ«’πŸ― ↝ Invalid input syntax & planet tabs

First up, we've got an issue that I'm assuming is related to our database.types.ts or potentially with our Lens client (however I'm doubting that is the case because when using the Lens client as a standalone NextJs app we're not getting that error AFAIK).

error - unhandledRejection: {
  code: '22P02',
  details: null,
  hint: null,
  message: 'invalid input syntax for type uuid: "undefined"'
}```

We just need to look through the `profiles`, `planets`, `posts`, & `articles` tables to find any references in the current codebase to `uuid` type entries and see if we've got any calls to those Supabase/postgres fields that are causing this issue.

Second issue:
https://user-images.githubusercontent.com/31812229/221401121-d3d2cf16-3a27-4248-9075-a23699598fbd.mov
What's going on here?
1. For some reason, clicking on some of the tabs on a planet results in an "undefined" tag replacing the `id` slug from the `planets` table. This might be related to the above issue
2. Clicking on the tabs on a planet doesn't change what data/contents is shown. This could again be because of the invalid input syntax issue. I'll create a copy of this section, but again for the `profiles` table with the same behaviour as the pages in `/posts/profile` to see what's going on.

Third issue:
Upserting data isn't working -> see `function claimPlanet` in `pages/planets/planet.tsx` (this should be moved into one of the tabs once we fix the second issue

```ts
function claimPlanet () {
        supabase.from('planets').upsert({
            'id': planetId,
            //'userId': 'profile?.username',
            'ownerId': session?.user?.id,
        })
    }

For now, I'm just working around this by setting up certain content/div tags/elements to show only if the user owns the anomaly/object they're viewing, and will add the XP section next.

Signal-K/sytizen#29

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.