Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive Book Integration Phase 1 | GSoC 2021 #110

Merged
merged 47 commits into from
Jul 20, 2021
Merged

Interactive Book Integration Phase 1 | GSoC 2021 #110

merged 47 commits into from
Jul 20, 2021

Commits on Jul 6, 2021

  1. Bringup Interactive Book UI Views.

    * Moved common drawer tile to components as CVDrawerTile.
    * Added a IbTheme class for custom styles.
    * Bringup "Hardcoded" IbLandingView and it's UI Test.
    * Bringup "Hardcoded" IbPageView and it's UI Test.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    313e772 View commit details
    Browse the repository at this point in the history
  2. IbPageView: Implement Table of Contents UI.

    * Uses Function Callback to run the function in IbPageView when TOC button is pressed in AppBar (present in
    IbLandingView)
    * Intentially added Future.delayed() when callback function is recieved, as in our hardcoded scenerio,
    setState() is called even before the Widget fully builds. This will be not required when data is coming from
    ViewModel via async methods.
    * Table of Contents uses Bottom Modal Sheets with Scroll Controller.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    fe2031e View commit details
    Browse the repository at this point in the history
  3. IbPageView: Fading Floating Action Buttons for readability

    * Floating Action Buttons now fades in if we scroll down and accordingly fades out if we scroll up.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    dc88b2b View commit details
    Browse the repository at this point in the history
  4. IbPageView: Improve Floating Action Buttons.

    * Made Button size smaller.
    * Color Scheme follows white as bg color and primary color as Icon's color.
    * Restore elevation to default (6.0) to show drop shadow.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    29618f5 View commit details
    Browse the repository at this point in the history
  5. IbLandingView: Seperate Actions for Expandable tile Drawer

    The current Interactive Book has pages for Parent pages like "Binary Algebra". Currently, mobile-app has the
    expandable tile which will be just expanding and showing sub-pages. We want to have seperate actions for arrow
    and text such that the text will open it's "Parent Page" and arrows/whitespace will expand to show child pages.
    
    * Uses Gesture Detector to incorporate different action for Text.
    * Produces no UI differences and works as expected.
    
    ref: https://stackoverflow.com/a/61573993
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    5bdcdfd View commit details
    Browse the repository at this point in the history
  6. UI Tests: Fix Landing View Test due to recent changes

    * Future.delayed() introduced in callback function causes Timer to throw errors.
    ref: https://stackoverflow.com/q/56600290
    
    * Incorporate Floating Action Buttons changes to fix test.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    b4d06a5 View commit details
    Browse the repository at this point in the history
  7. GH Actions: Temporarily enable ib branch to run CI.

    * I almost forgot to run Tests after doing changes.
    * Should be reverted before merging back to master.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    d4701bd View commit details
    Browse the repository at this point in the history
  8. Models: Bringup Interactive Book Models.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    db8c834 View commit details
    Browse the repository at this point in the history
  9. Services: Implement Interactive Book APIs

    * API for fetching Raw Page Data and Fetching Pages list
    * We are not serializing and returning  modal for fetching pages list since directory modals are redundant and
    we only want to use them for recursively reading pages from directories, which will be handled by our Interactive Book Engine Service.
    * For Raw Page Data, our response is serialized in `IbRawPageData` model.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    dc140e6 View commit details
    Browse the repository at this point in the history
  10. IbPageView: Use camelCasing for constructor variable.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    a1e9e07 View commit details
    Browse the repository at this point in the history
  11. Tests: Fix IbApiTest typo.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    c3e4704 View commit details
    Browse the repository at this point in the history
  12. Models: Replace IbRawPage with IbChapter.

    * In-order to build Navigation and Drawer List Items, we realized that IbRawPage is just too overkill for the
    requirement. We just need title and ids to build Navigation and Drawer Lists. Also, since data is not getting
    serialized directly from API, IbEngineService is expected to create models from this RAW JSON. Moreover, this
    IbRawPage is already included in IbRawPageData which will fetched for every page content.
    
    * From now onwards, IbChapter[] will be received from the IbEngineService and will be used just for Book
    Structure and Navigation.
    
    * IbChapter includes previous page id, next page id because IbRawPageData won't have this. The only way to get
    prev and next is finding them while preparing Navigation and structure. Accordingly, IbPageView should also
    require prev and next from the IbLandingView to show Previous and Next buttons action.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    7cdae74 View commit details
    Browse the repository at this point in the history
  13. Ib: Models: Format code

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    27a6898 View commit details
    Browse the repository at this point in the history
  14. Services: Bringup Interactive Book Engine

    * Implemented getChapters() and getPageData().
    * IbChapter now includes navOrder since it was needed to sort the navigation pages.
    * IbChapters that includes prev, and next for FABs and navigation are not implemented yet.
    * getPageData() supports basic Mardkdown parsing like #,##,###,--- and { tags } as done in POC: #44
    * Table of Contents is yet to be implemented while fetching getPageData()
    
    Testing -
    * IbEngineService Tests are running well which uses mocked real-time data.
    * IbChapters since due to nested paging, was expected to take time. I ran a quick real-time test of it on
    mobile-app to see the performance, it takes approx 1-2 secs on a normal broadband. Also, according to the
    plans, ViewModel will be able to cache the data for the whole session.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    ed6a262 View commit details
    Browse the repository at this point in the history
  15. Implement Interactive Book ViewModels.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    cb0a2f0 View commit details
    Browse the repository at this point in the history
  16. IbEngineService: Implement Navigation

    * Navigation includes previous and next buttons are not included in the APIs responses, so we have
    to manually build using the list of chapters.
    * The logic involves flattening the nested list and assigning prev and next in IbChapter
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    60e4064 View commit details
    Browse the repository at this point in the history
  17. IbEngineService: Implement Table of Contents parsing

    * The strategy is to parse using html package and recursively parse the lists.
    * The list data will be stored in IbTocItem as part of IbContent.
    * Added a new test case for a regular page (Contributing Guidelines) which uses almost every kind of
    content, it will be helpful in future testing as well as to test Table of Contents.
    * Since the data was too long, data is stored in JSON for clean and untouched response.
    * Logic computes the numbers and alphabetes while parsing and prepends to the content.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    2ca4e28 View commit details
    Browse the repository at this point in the history
  18. IbEngine: Include Table of Contents Filters.

    * Table of Contents has it's title and list text which is not required in mobile-app as it's now in
    bottom sheet.
    * These filters will simply won't add them to Content models.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    2c3fd0c View commit details
    Browse the repository at this point in the history
  19. IbChapter: Use obj ref for prev, next attrs

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    e6191f0 View commit details
    Browse the repository at this point in the history
  20. Implement ViewModels to Interactive Book views.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    39c1d0c View commit details
    Browse the repository at this point in the history
  21. IbPageView: Format Code.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    1d0c322 View commit details
    Browse the repository at this point in the history
  22. Interactive Book: Switch to flutter_markdown

    * We found out that flutter_markdown which is maintained by flutter team, is already supporting GitHub
    flavoured Markdown, therefore we replaced our parser with flutter_markdown.
    * Creates almost no UI changes.
    * Already supports inline markdown syntaxes (not HTML inline syntaxes which is TODO)
    * Supports img and anchor links (needs to be reworked with respect to local and absolute URLs)
    * Added Custom Syntaxes and Builders for our purposes.
    * API Utils: Now supports UTF-8 Decoder as well. It was noticed that API Raw Page Data was not UTF-8
    decoded.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    78c4217 View commit details
    Browse the repository at this point in the history
  23. IB: Bringup Simulator embeds extension using webview.

    * flutter_markdown has some issues because of which we are using our own fork of the same.
    (manjotsidhu/packages@29bb87f)
    * We have updated flutter_markdown from 0.5.2 -> 0.6.2.
    * flutter_html needed update because of Sub6Resources/flutter_html#500.
    * flutter_html updated from 1.0.2 -> 1.3.0, which depends on flutter_svg, flutter_svg updated from 0.19.3
    -> 0.20.0-nullsafety.3
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    57179ee View commit details
    Browse the repository at this point in the history
  24. Switch to CV fork of flutter_markdown package

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    52d2fa0 View commit details
    Browse the repository at this point in the history
  25. Ib: Implement Chapter Contents for parent pages.

    * Added support for Liquid syntax parsing.
    * Chapter Contents is parsed from HTML content and then passed via PageData.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    e7d1cd8 View commit details
    Browse the repository at this point in the history
  26. Markdown: Fix h4 style.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    fa5e854 View commit details
    Browse the repository at this point in the history
  27. Markdown: Set image root path as IB_BASE_URL.

    * There are 3 types of img tags used in Interactive Book:
    
      Type 1: Markdown Image: `![alternate text](https://img-link/file.png)`
      Type 2: Liquid Syntax Image (Recommended in Guidelines): `{% include image.html
    url="https://img-link/file.png" description="alternate text" %}`
      Type 3: HTML Image Tag: `<img src="https://img-link/file.png" />` (Not supported)
    
    * This will not fix *every* image tag in interactive book but it does fix type 1 Images.
    * Type 3 Images will be converted to Type 2 and Type 2 implementation is a TODO.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    08efe82 View commit details
    Browse the repository at this point in the history
  28. Ib: Ignore Parsing Pop Quizes

    * Ideally, we should not parse pop quizes using markdown.
    * We will have a special widget that will build Pop Quizes.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    7f1ba0d View commit details
    Browse the repository at this point in the history
  29. IbLiquidSyntax: Add support for images via liquid tags.

    * Still this is not a full working solution since Flutter's Image.network is not capable of handling
    SVG.
    * We will need to override and add our custom Image Builder that will use flutter_svg package.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    60ff798 View commit details
    Browse the repository at this point in the history
  30. IbEngine: Encode HTML characters using HtmlUnescape.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    1d5fe7d View commit details
    Browse the repository at this point in the history
  31. IbPageView: Launch absolute links on external browser. #104

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    bfc546d View commit details
    Browse the repository at this point in the history
  32. IbTheme: Independent of CVTheme.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    a6c6d63 View commit details
    Browse the repository at this point in the history
  33. IbPageView: Use Scrollbar with ScrollView

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    1de0db9 View commit details
    Browse the repository at this point in the history
  34. IbPageView: Scrollbar: Disable always shown.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    45ff247 View commit details
    Browse the repository at this point in the history
  35. Upgrade Packages

    * Get.snackbar now accepts message and title mandatory.
    * Http package now accepts Uri instead of String.
    * Manual Testing is highly recommended.
    
    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    ad6b3d9 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    2ccdad1 View commit details
    Browse the repository at this point in the history
  37. conf: update pubspec.lock

    Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    0a4a2fd View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    2d43532 View commit details
    Browse the repository at this point in the history
  39. Services: Bringup hive database service.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    e78340e View commit details
    Browse the repository at this point in the history
  40. Fix typos.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    f652b82 View commit details
    Browse the repository at this point in the history
  41. DatabaseServiceTest: Fix test for MacOS.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu authored and Nitish145 committed Jul 6, 2021
    Configuration menu
    Copy the full SHA
    b875812 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2021

  1. Ib: Cache getChapters API using Hive.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu committed Jul 13, 2021
    Configuration menu
    Copy the full SHA
    0a393ab View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2021

  1. IbPageView: Reduce divider thickness.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu committed Jul 14, 2021
    Configuration menu
    Copy the full SHA
    d2c69a5 View commit details
    Browse the repository at this point in the history
  2. IbLandingView: Highlight and expand selected chapter.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu committed Jul 14, 2021
    Configuration menu
    Copy the full SHA
    1af9117 View commit details
    Browse the repository at this point in the history
  3. IbLandingView: Fixes and Improvements

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu committed Jul 14, 2021
    Configuration menu
    Copy the full SHA
    9483557 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2021

  1. IbLandingView: properly init and dispose valueNotifier.

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu committed Jul 15, 2021
    Configuration menu
    Copy the full SHA
    5fed1ed View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2021

  1. Ib: Bringup HTML Interactions!

    Signed-off-by: Manjot Sidhu <[email protected]>
    manjotsidhu committed Jul 20, 2021
    Configuration menu
    Copy the full SHA
    fea7d6b View commit details
    Browse the repository at this point in the history