BibliothecaDAO / eternum

onchain eternal game
https://alpha-eternum.realms.world
MIT License
36 stars 30 forks source link

Fix/storehouse cap #1073

Closed cwastche closed 5 days ago

cwastche commented 6 days ago

PR Type

Enhancement, Formatting


Description


Changes walkthrough ๐Ÿ“

Relevant files
Formatting
Combat.tsx
Reformat text for better readability in Combat hints         

client/src/ui/components/hints/Combat.tsx
  • Reformatted text for better readability by breaking long lines into
    shorter ones.
  • +4/-2     
    Enhancement
    Resources.tsx
    Fetch and display storehouse capacity from SDK                     

    client/src/ui/components/hints/Resources.tsx
  • Imported STOREHOUSE_CAPACITY from SDK.
  • Updated storehouse capacity display to use STOREHOUSE_CAPACITY
    constant.
  • Reformatted text for better readability by breaking long lines into
    shorter ones.
  • +3/-1     

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    vercel[bot] commented 6 days ago

    The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

    Name Status Preview Comments Updated (UTC)
    eternum โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Jul 4, 2024 0:50am
    github-actions[bot] commented 6 days ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก Key issues to review

    **Possible Bug:** The division of `STOREHOUSE_CAPACITY` by 1000000 in `Resources.tsx` assumes that the capacity is always in the millions, which might not be the case if the constant changes. Consider adding a utility function to format the number based on its actual value.
    github-actions[bot] commented 6 days ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Accessibility
    Improve the alt attribute of the image for better accessibility and SEO ___ **Consider using a more descriptive alt attribute for the image tag to improve accessibility
    and SEO. The current alt attribute value "coin" does not seem to match the displayed image
    which is related to "attack".** [client/src/ui/components/hints/Combat.tsx [60]](https://github.com/BibliothecaDAO/eternum/pull/1073/files#diff-7b23abb989c0a5df3246c7c9c4a5efde28f897e7fd9355f7cbc409f263033a40R60-R60) ```diff -coin +attack icon ```
    Suggestion importance[1-10]: 9 Why: The suggestion improves accessibility and SEO by providing a more descriptive `alt` attribute, which is crucial for screen readers and search engines.
    9
    Readability
    Improve readability by breaking a long sentence into shorter ones ___ **Break the long text inside the paragraph into multiple shorter sentences or separate
    paragraphs for better readability and user experience.** [client/src/ui/components/hints/Combat.tsx [62-63]](https://github.com/BibliothecaDAO/eternum/pull/1073/files#diff-7b23abb989c0a5df3246c7c9c4a5efde28f897e7fd9355f7cbc409f263033a40R62-R63) ```diff -Battles erupt when armies clash, with duration dependent on troop numbers. These engagements are open to all, involving both offensive forces and defenders of structures. +Battles erupt when armies clash, with duration dependent on troop numbers. These engagements are open to all. They involve both offensive forces and defenders of structures. ```
    Suggestion importance[1-10]: 8 Why: The suggestion enhances readability by breaking a long sentence into shorter, more digestible sentences, which improves user experience.
    8
    Enhancement
    Use formatted strings for displaying large numbers ___ **Consider using a formatted string to handle large numbers more gracefully and ensure
    consistency across different locales.** [client/src/ui/components/hints/Resources.tsx [36]](https://github.com/BibliothecaDAO/eternum/pull/1073/files#diff-d19afd508f5ca24a4c6b7aa3350cf9d813e38ea9f6dcf8a76d2fda9e3ae08d8dR36-R36) ```diff - {STOREHOUSE_CAPACITY / 1000000}M capacity per resource type + {new Intl.NumberFormat().format(STOREHOUSE_CAPACITY / 1000000)}M capacity per resource type ```
    Suggestion importance[1-10]: 7 Why: The suggestion improves the display of large numbers by using a formatted string, which ensures consistency and readability across different locales.
    7